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

Pass parameters through to a dataset

1 Answer 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 15 Dec 2009, 06:57 AM
Hello,

I've got two parameters that are defined in a report. I want to be able to pass these parameters through to the dataset that provides data for the report. I was able to do this in the autogenerated New() sub by just adding things like Me.ReportParameters("LastFind").Value to the line that fills the datatable.

The problem is that when somebody changes a parameter in the parameters editor when the report is displayed, those changes do not get passed through to the dataset.

Anybody know how I can pass those through? am I missing something obvious?

Thanks,

Mike

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 18 Dec 2009, 07:33 AM
Hi Mike,

You cannot use the report parameters in the report constructor as the report is not initialized yet - you can easily spot that by debugging the report and notice what is the report parameter value in the report constructor. Instead you can use the NeedDataSource event of the report and use the parameter values to alter the query there.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Mike
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or