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

set TextBox value programatically

0 Answers 223 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Saima Gul
Top achievements
Rank 1
Saima Gul asked on 20 Aug 2010, 08:17 AM
Hi
I want to set value in textbox placed in report header section
i see following threads to do it
http://www.telerik.com/community/forums/reporting/telerik-reporting/assign-value-programmatically-to-textbox-in-page-header.aspx
http://www.telerik.com/community/forums/reporting/telerik-reporting/how-to-change-the-content-of-a-textbox-programmatically.aspx
Here is my code
rptAccLedgerReport myReport = new rptAccLedgerReport();
myReport.prm1.Value = "A/c:" +vAccName;
myReport.prm2.Value = "From: " + vFromDate + " To: " + vToDate;
rptAccLedger rptSource = new rptAccLedger();
myReport.DataSource = rptSource.dataSource(vAccNo,vFromDate,vToDate);
rptViewer.Report = myReport; //Set report to reportviewer control

//Here prm1 is text box name and i make it public
When i debug it value is set in text box but when report is rendered value is not displayed 
i also try this
Telerik.Reporting.Report report = (Telerik.Reporting.Report)rptViewer.Report;
Telerik.Reporting.TextBox txt = report.Items.Find("prm1", true)[0] as Telerik.Reporting.TextBox;
txt.Value = "A/c:" + vAccName;
but it does not work
Please help me what is my mistake?

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Saima Gul
Top achievements
Rank 1
Share this question
or