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

How to pass a param to report book?

8 Answers 393 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
harry
Top achievements
Rank 1
harry asked on 10 Jan 2017, 02:20 PM

I want to pass a param from html5 viewer to the report book,then generate the report,like this

var p=params.split(',');

foreach(var c in p)

{

var bill = new ReportBill();

bill.ReportParameters["BillCode"].Value = c;

this.Reports.Insert(0, bill);

}

but i cant find any way to pass it,can anyone help me?

 

8 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 10 Jan 2017, 04:09 PM
Hi harry,

Please check my post in Pass old Report viewer web form To Html5 report viewer web form.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
harry
Top achievements
Rank 1
answered on 11 Jan 2017, 02:07 PM

Thanks for reply,but You don't understand my problem.

I know how to pass params to report. but i dont know how to pass params to report book,because in report book,i cant find a method to get the param.

0
Stef
Telerik team
answered on 12 Jan 2017, 05:19 PM
Hi harry,

If each report in the ReportBook has entries in its ReportParameters collection (How to add a report parameter), you can pass values through the viewer's reportSource. Please check the Report Book, Report Instances and Parameters forum discussion.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
harry
Top achievements
Rank 1
answered on 13 Jan 2017, 04:03 PM

Hi,Stef,Thank u very much.

but.

I'm not sure about the number of reports, because I added it cyclically.I want to detemine the number from the param.

0
Accepted
Stef
Telerik team
answered on 13 Jan 2017, 04:22 PM
Hello harry,

Then the question is how to create a ReportBook at run-time by using a parameterized constructor or method that returns the ReportBook object.
In such case, you need a custom resolver for the Reporting REST service. The resolver's Resolve method receives a string that is passed by the HTML5 viewer's reportSource.report string. You can include information in string format in the reportSource.report string and handle it manually on the server.

An example of a custom resolver is available here. Note that the resolver is used on interaction with the viewer (refresh, print, export, parameters update), and the custom code has to return the same ReportBook object on each call.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
harry
Top achievements
Rank 1
answered on 14 Jan 2017, 10:07 AM

Hi,Stef,

that's a great Solution ,Thank u very much!

0
harry
Top achievements
Rank 1
answered on 14 Jan 2017, 10:08 AM

Hi,Stef,

that's a great Solution ,Thank u very much!

0
harry
Top achievements
Rank 1
answered on 14 Jan 2017, 10:21 AM
Hello Stef,That's a good solution.Thank u very much!
Tags
General Discussions
Asked by
harry
Top achievements
Rank 1
Answers by
Stef
Telerik team
harry
Top achievements
Rank 1
Share this question
or