Generate report on controller with an EF DB as datasource

Posted by: sebastian73 on 9 August 2023, 5:17 pm EST

    • Post Options:
    • Link

    Posted 9 August 2023, 5:17 pm EST

    Hi!

    I need some help on the way to implement the report generation for my solution, I was unable to solve it using the documentation.

    My app is an ASP.NET MVC Core solution, but I have the Studio Enterprise, and I need to generate report without an external or additional api.

    My main problem is how to generate the reports definitions using the designer, my database is using Entity Framework, so I want to use “object in external assembly”.

    Can you provide some examples on:

    • how to connect the report designer to custom classes that will contain the data.
    • Generate the report on the controller using the C1FlexReport class, using as DataSource the data generated by app logic gathered form EF classes and send a PDF to the PDFViewer on a View.

    Thanks in advance!!

  • Posted 10 August 2023, 3:26 am EST - Updated 10 August 2023, 3:32 am EST

    Hello,

    Please refer to the following screenshot to bind the FlexReport with the Object in the external assembly.

    The sample is under ComponentOne Samples\WinForms same as the specified path in the screenshot.

    This sample shows how to generate the DLL that can be used as RecordSet in the FlexReportDesigner or the FlexReport in the C# code.



    Please refer to the following documentation that shows how to bind the FlexReport to DataSource:

    https://www.grapecity.com/componentone/docs/win/online-flexreport/DataSourcesinFlexReport.html

    *** Generate the report on the controller using the C1FlexReport class, using as DataSource the data generated by app logic gathered form EF classes and send a PDF to the PDFViewer on a View.

    You would like to generate the PDF and send to the PDFViewer. But setting up the PDFViewer also required the ComponentOne WebAPI PDF service. So in the same way you may also setup the C1 WebAPI report service that can direct show the FlexReport in the FlexViewer.

    If you would like to customize the DataSource dynamically, please refer to the attached sample that shows how to customize the FlexReport data source.

    Hope it helps!

    Regards,

    Manish Gupta

    CustomReportViewer_Param.zip

  • Posted 10 August 2023, 1:21 pm EST

    Thanks for your help and guidance!!!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels