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

Getting report parameter values during UI initialization

2 Answers 248 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 11 Mar 2014, 04:57 PM
Hi guys,

I would like to create the dynamic report where the most of UI will be created based on the data source information.
My data source depends on two report parameters which are received from html5 viewer.
I can see that I can use the NeedDataSource event handler to retrieve the report parameter values and then populate the report data source.

Ideally, I would like to programmatically build the report UI during the initialization stage, e.g. in the InitializeComponent() method. But I need to get the report parameter values.
Is it possible to get the values of the report parameters in the report constructor?
Or how can I pass the report parameter values from html5 viewer so I could get them before creating the report UI? 

Thanks,
Sergey. 

2 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 14 Mar 2014, 03:07 PM
Hi Sergey,

Since you are trying to build your report dynamically we can suggest you to first collect the user input using your own or other controls like Kendo. Then send those values to the server and based on them create your report definition programmatically. Then serialize the report definition and as an optional step you can save it in a database for example. Finally send the prepared report to the client - check this help article to see how to implement custom report resolver.

The other option will be similar, but you will not have to serialize your report. Instead you will send to the client an instance report source. To do so when the input of the client is collected convert it to a model and save it in the session or in a database under a guid. Then when the client requests a report with this guid find the model and use it to build an instance report source in the custom report resolver and return the resulting report.

That way you will simplify the process of report generation and your code will be more maintainable in the future. If you have any other questions please do not hesitate to ask.

Regards,
IvanY
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Sergey
Top achievements
Rank 1
answered on 17 Mar 2014, 02:52 PM
Hi IvanY,

Thanks for your suggestion. 

Sergey.
Tags
General Discussions
Asked by
Sergey
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Sergey
Top achievements
Rank 1
Share this question
or