Changing the value of a label

Sep 29, 2011 at 3:35 PM

I crated a label in the report. i wanted to change its value dynamically after adding data to the tables. Can anybody help

Sep 29, 2011 at 11:58 PM

This isnt necessarily the best way to do this but what I found was that you can make your text variable a property of the report and then set that property when you are collecting all of your data for the tables. So you have the template with the property (and formatting) and then when you call the template you just set the property and voila, you now have a report with your data and a custom label.

Sep 30, 2011 at 5:11 AM

Thanks for the reply jim I will try it

Nov 20, 2011 at 2:18 PM

You can achieve this in a few simple steps:

First - modify the codereason.reports.reportdocument file to contain the variable you're lookign to use. For example, i'm using patient names in a report so I have

private string _patientName = "";

 

public string PatientName

 

 

 

 

{

get { return _patientName; }

set { _patientName = value; }

}

 Then in my code behind the report, I add the following line:

 

data.ReportDocumentValues.Add("PatientName", myPatientName);

 

Finally, add a line to show the info in your textbox in the xaml file for the report:

<Paragraph>

Report

<xrd:InlineDocumentValue PropertyName="ReportNumber" />for<xrd:InlineDocumentValue PropertyName="PatientName" /></Paragraph >

Nov 21, 2011 at 3:55 AM

Thank you for the reply