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

How to load a prebuilt report with parameters in C#?

3 Answers 63 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 23 Apr 2014, 08:33 PM
Not sure if I'm doing this right.  I've been trying out various reporting tools for a pretty big project I'm starting.

I was able to design a report in the designer standalone the way I wanted it.  So now in C# I want to load that report using a parameter for the queries.

I assume I set the reportviewer reportsource property and then create the parameters.  I just can't seem to get it to work.  Says my connection string isn't right though I set that at design time and it works fine in the standalone designer.

Maybe I'm doing this all wrong?

3 Answers, 1 is accepted

Sort by
0
Brandon
Top achievements
Rank 1
answered on 23 Apr 2014, 08:56 PM
Well I can't edit the first post but I figured out my problem for the connection string not working..

So I'm past the unable to connect problem, but still unsure 

A) how to pass parameters into the reportviewer source. 

B) if I'm doing this correctly.
0
Brandon
Top achievements
Rank 1
answered on 24 Apr 2014, 03:51 PM
OK figured it out.  I set up the parameters in the data sources themselves, but not the report.

Had to assign the datasource params to the report param..  It's working now.

0
Stef
Telerik team
answered on 24 Apr 2014, 06:00 PM
Hi Brandon,

If you need to use a data retrieval method with parameter, the parameters should be mapped to report parameters. Consider the examples in the following articles:
When you display the report, report parameters values can be passed through the used Report Source object - the ReportSource.Parameters collection (key-value pairs) is mapped to the Report.ReportParameters collection by key.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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