Changing the PDF Export filename - ACtive Reports 13 JSViewer

Posted by: peter on 26 June 2022, 9:32 am EST

    • Post Options:
    • Link

    Posted 26 June 2022, 9:32 am EST

    I have an old system that has been working for several years using Active Reports 13. The Reports are all complex Sectional Reports, the viewer is the JSViewer, using MVC.

    I just found out that the PDF export options, while working fine, always create a file called ActiveReports Document.pdf. I am using the built-in PDF ability of the viewer - no custom JS scripts

    I’m hoping I can configure the PDF filename in the JSViewer.create() call?

    Note: Upgrading isn’t an option right now. I have a project request in to upgrade most of the components and the underlying Framework version, but this is several months away at least.

  • Posted 26 June 2022, 8:48 pm EST

    Hi Peter,

    Before loading the section reports in the JSViewer please set the report.Name property. If the report.Name property is null the default file name is used which is “ActiveReports Document”.

    For reference please refer to the following lines of code:

    
            SectionReport1 report = new SectionReport1();
            [b]report.Name = "TestExportName";[/b]
            return report;
    
    

    Regards,

    Akshay

  • Posted 27 June 2022, 4:39 am EST

    Thank - its the Name property of the Report object at RUNTIME. I’d set the Name in the designer - but this wasn’t being used, which was why I was confused.

    For reference to anyone looking for the same answer - I now set the Name property in the Report_Start event of my report and it works nicely. It also allows me to capture any report/parameter/runtime specific data and incorporate it into the Name.

  • Posted 27 June 2022, 9:37 pm EST

    Hi Peter,

    I tested this out with the latest version of ActiveReports i.e. ActiveReports 16.1.2. It seems that this issue has been fixed as when I changed the name of the report in the designer, the same name was used for the exported file as well.

    Thank you so much for sharing that information, it will be useful to others who might be considering doing something similar.

Need extra support?

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

Learn More

Forum Channels