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

Getting Parameter values in NeedDataSource

0 Answers 75 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 2
Dan asked on 28 Mar 2013, 01:18 PM
After upgrading to Q1 2013 of Reporting my parameter code does not work.  I'm getting parameter values in NeedDataSource in order to construct my report/chart datasource.  This code used to work:
private void report_NeedDataSource(object sender, EventArgs e)
{
    String siteParm = this.ReportParameters["Site"].Value.ToString().Trim();
    Int32 timespanParm = Convert.ToInt32(this.ReportParameters["TimeSpan"].Value.ToString());

After the upgrade the parameter values are not the values that I have entered in the UI, then previewing.  I tried changing the code to:
private void report_NeedDataSource(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;
    string siteParm = report.Parameters["Site"].Value.ToString();
    string timespanParm = report.Parameters["TimeSpan"].Value.ToString();


With this code the values of report.Parameters["xxxx"].Value are the new expected values, but setting them to a string variable results in:

The name 'siteParm' does not exist in the current context
The name 'timespanParm' does not exist in the current context
Why is this?

Also, with my Chart page if I try:

Telerik.Reporting.Processing.Chart chart = (Telerik.Reporting.Processing.Chart)sender;

then chart has no Parameters property!  How do I get the parameters then?

Dan

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Dan
Top achievements
Rank 2
Share this question
or