How to Export PDF from RDL from .NET 7 REST API application

Posted by: admin on 8 May 2023, 10:29 am EST

    • Post Options:
    • Link

    Posted 8 May 2023, 10:29 am EST

    I am a new ActiveReports.Net developer with a trial version of ActiveReports.Net Professional version 17.0.3.0. I have been able to use the ActiveReports designer to implement a complex report from our current system. The report is RDL and successfully queries the database and rapidly produces the report we want. So far, so good.

    My problem is that I am having difficulty finding examples or documentation explaining how to integrate the report with my existing .NET 7 REST API application. I understand that using section reports is problematic with .NET core, but I don’t need to use section reports as RDL reports work fine for our purposes. Can you point me to samples, documentation or resources that demonstrate how to implement RDL reports with .NET core. I have spent a couple of days looking through documentation and samples without finding any.

    Thanks

  • Posted 9 May 2023, 2:46 am EST

    Hi Jeff,

    For exporting your report to PDF the process is the same as .NET Framework, i.e. you’ll need to load your report in a PageReport object and use the PdfRenderingExtension to export your ‘PageReport.Document’ to a PDF.

    You may refer to the following page of our documentation to learn more about the same: PDF Export.

    Please find attached a sample API application implementing the same.

    Regards,

    Anand

  • Posted 9 May 2023, 2:47 am EST

    It seems the attachment didn’t go through my previous response, please find it attached to this response!

    RDLtoPDF_API.zip

  • Posted 9 May 2023, 10:06 am EST

    Thanks, Anand! This helps a lot. Perhaps this could be added to your samples. Another issue I ran into but eventually solved was trying to pass a parameter from my API controller to the report. While this would seem a pretty basic requirement, it was not easy to find on the GrapeCity website. Figured it out by looking for the parameters in Visual Studio debug mode. Found it in report.Document.Parameters and was then able to modify the parameter value before rendering the report.

    Thanks again for your quick response.

  • Posted 9 May 2023, 11:40 pm EST

    Hi Jeff,

    We’re glad we were able to help!

    Regards,

    Anand

Need extra support?

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

Learn More

Forum Channels