This is a migrated thread and some comments may be shown as answers.

Changing an item (ie. TextBox) in a subreport.

1 Answer 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Les
Top achievements
Rank 1
Les asked on 23 Nov 2011, 06:15 PM

I cant seem to find an example on this site that shows changing an item (ie. TextBox) in a subreport.

I'm trying to update the textbox in the subreport, but it will not show the updated value.

I tried the following code as an example and when I debug and I can see the subreport text box. This example changes the value of all textbox items in the main report but not in the subreport.

ReportItemBase[] allTextBoxes = report.Items.Find(typeof(Telerik.Reporting.TextBox), true);
int i  = 0;
foreach (Telerik.Reporting.TextBox textBox in allTextBoxes)
{
   textBox.Value = (i++).ToString();
}


1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 24 Nov 2011, 01:01 PM
Hi Les,

As far as we understand from your post, you want to change the value of a TextBox located in a SubReport. Such change does not require you to iterate over all items and we need more information on the condition under which you have to change the value. For example if this change is going to be based on a report parameter value or the value of another column from our database, then you can use the built-in functions to create an appropriate expression to show different value based on the condition.

If your scenario differs, please elaborate so we can guide you accordingly.

Greetings,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Les
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or