Single RDLC file to populate any type of custom object passed to it

邮差的信 提交于 2019-12-13 23:28:27

问题


I have a list of stored procedures which return different types of object (with varying column) to my business layer. Also, I created a single RDLC file named allreports.rdlc in my mvc application and put it in some .cshtml page.

Now, I want to call any of the stored procedure (based on user input passed as query parameter to my controller) and retrieve data in dataset (or any better format if available) and want to pass it to my rdlc report.

Can I achieve this using a single rdlc file which will be used to populate my any of the stored procedure dataset results. Also, please suggest if there is any other approach to achieve this?

Goal: To integrate all the reports in a single report page by changing underlying data formats. I don't want to make my application releases for each new report requirement by changing the underlying codes.

If any more clarification is needed; let me know instantly so that I could search the solution for it.


回答1:


Syncfusion.EJ.ReportViewer library can dynamically create RDL reports in code behind by using ReportDefinition object. Please refer to sample that populates Tablix report item based on Datatable columns.

Sample Link

The whole product is available for free through the community license if you qualify (less than 1 million USD in revenue).

I work for Syncfusion.



来源:https://stackoverflow.com/questions/37447788/single-rdlc-file-to-populate-any-type-of-custom-object-passed-to-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!