Report hyperlinks not grabbing right field values
I have a couple of hyperlinks that are being generated using field values on a property report. The problem I'm running into is that when running the report on multiple parcels, the links are grabbing the wrong parcel IDs to pass into the link URLs. Any ideas on what the issue is?
Example of how Parcel IDs are being passed into the hyperlink (formatted as Report page PID | Hyperlink PID):
- PID1 | PID3
- PID2 | PID4
- PID3 | PID5
- PID4 | PID6
- PID5 | PID6
- PID6 | PID6
This is in GE 3.14, the GVS 1.9, and Report Designer 2.18.
Script to generate hyperlink URLs when report is run
public void PageFooter1_Format()
{
Label hyperlink1 = rpt.Sections["PageFooter1"].Controls["Label11"] as Label;
string pid = rpt.Fields["PID_NO"].Value as string;
hyperlink1.HyperLink = "http://www16.co.hennepin.mn.us/pins/pidresult.jsp?pid=" + pid;
hyperlink1.Text = "Go to Hennepin County Property Page";
Label hyperlink2 = rpt.Sections["PageFooter1"].Controls["Label14"] as Label;
hyperlink2.HyperLink = "https://cityview.brooklynpark.org/SilverlightViewer_1_9/Viewer.html?ViewerConfig=https://cityview.brooklynpark.org/Geocortex/Essentials/REST/sites/CityView_test/viewers/CityView_test/virtualdirectory/Config/Viewer.xml&attributeSearch=SDE.GIS.Parcels,PID_NO," + pid;
hyperlink2.Text = "Go to Property in CityView";
}
-
Hi John,
I think the issue is that you are using the page footer format event, but accessing the field data directly.
The field data will change as the detail section formats - and we don't really have any control over when that happens versus when the footer is formatted.
Rather than pulling the values you want out of the rpt.Fields collection, consider generating a lookup of pages to values, then when you format the page footer, use the page number to retrieve the value from your lookup table.
Regards,
-Malcolm
0 -
Malcolm,
How do I generate a lookup of pages to values?
0 -
I moved the hyperlinks into the details section and now they grab the right values (kudos to Alejandro Mari at Latitude Support for his help). I'd still be interested in help on creating a lookup of pages to values, though.
Updated Script
public void PageDetail_Format()
{
Label hyperlink1 = rpt.Sections["PageDetail1"].Controls["Label11"] as Label;
string pid = rpt.Fields["PID_NO"].Value as string;
hyperlink1.HyperLink = "http://www16.co.hennepin.mn.us/pins/pidresult.jsp?pid=" + pid;
hyperlink1.Text = "Go to Hennepin County Property Page";
Label hyperlink2 = rpt.Sections["PageDetail"].Controls["Label14"] as Label;
hyperlink2.HyperLink = "https://www.oursite.org/SilverlightViewer_1_9/Viewer.html?ViewerConfig=https://www.oursite.org/Geocortex/Essentials/REST/sites/CityView_test/viewers/CityView_test/virtualdirectory/Config/Viewer.xml&attributeSearch=SDE.GIS.Parcels,PID_NO," + pid;
hyperlink2.Text = "Go to Property in CityView";
}0
Please sign in to leave a comment.
Comments
3 comments