Combined Address

I have reviewed other postings in the forum regarding combing the city,state,zip in one line. I copied the script form the sample detailed workorder, and made sure that that I changed the label number to match the label the script is in. I also made sure that it is in the same band. Here is what I have:

{

xrLabel12.Text = string.Format("{0} , {1} {2}", DetailReport.GetCurrentColumnValue(“LT_Address_Label_City”), DetailReport.GetCurrentColumnValue(“LT_Address_Label_StateProv”), DetailReport.GetCurrentColumnValue(“LT_Address_Label_Postal”));

}

From what I can tell, I have this script in the correct location, before print.

I am still gettnig the following error:

Error CS0103: The name “xrlabel12” does not exist in the current context.

Template attached.

Thanks!

Hi again Mike

The error message is telling you that there is no such thing as a control called xrlabel12 as you have in your script

If you click on that field in your report template where you are using this script, what is its (Name) property?

The report template you attached when I click on that control field shows that field as called label12 , not xrLabel12, so you would need to edit your script so that it is calling that control field label12

Note that case is sensitive as well as the exact spelling, so you can not callLabel12 (with a capital L) neither - it must be the exact name of that control as per its property.

Your script should be :

label12.Text = string.Format("{0} , {1} {2}", DetailReport.GetCurrentColumnValue(“LT_Address_Label_City”), DetailReport.GetCurrentColumnValue(“LT_Address_Label_StateProv”), DetailReport.GetCurrentColumnValue(“LT_Address_Label_Postal”));

And then it will work.

Just in case this comes up if a combined script is used elsewhere on the report template,you do have the correct name of the band being referred to (DetailReport) so that too is also correct, but if the control field was in a detail band for another dataset, you would need to edit the script so that you are getting the current column value from the dataset it is from. For example, if the control field was actually in the detail band of the DetailReportItem, your script would instead have… DetailReportItem.GetCurrentColumnValue(“LT_Address_Label_City”), …etc)

Do note that due to the holiday, support is now closed for the weekend, returning Tuesday as per http://forum.ayanova.com/Topic4830-62-1.aspx

  • Joyce

Thank you and have a nice weekend.