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

Setting report parameters within reportViewer using C#

2 Answers 42 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 28 Apr 2014, 05:00 PM
I have a report (myReport) built in a library class. In my web application, I am using a report viewer (ReportViewer1) with the reportsource set to: "ReportLibrary.MyReport, ReportLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null". This report has three (3) parameters. 

I have failed in many attempts to set those parameters in the reportViewer using C#. Can anyone help?

Tom

2 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 01 May 2014, 08:11 AM
Hello Tom,

Report parameters values can be passed through the report source object's Parameters collection (key-value pairs) mapped by key to the wrapped report's ReportParameters collection by key.
  1. Add the report parameters in the report - How to: Add Report Parameters
  2. Create a report source object and set the report
  3. Pass parameters values e.g. TypeReportSource
  4. Set the report source object as the ReportViewer.ReportsSource

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.

 
0
Tom
Top achievements
Rank 1
answered on 01 May 2014, 01:14 PM
Thanks Stef, I stumbled across a couple things I didn't have set in the properties. All is ok now.

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