JSViewer change export filename

Posted by: rgreen on 13 July 2021, 2:08 pm EST

    • Post Options:
    • Link

    Posted 13 July 2021, 2:08 pm EST

    Hello,

    I am adding my own export button onto the JsViewer. Is there a way to set the filename it’ll use when it exports using the viewer.export() call?

  • Posted 14 July 2021, 4:25 am EST

    Hello,

    You can give the “FileName” in the setting.

    Thanks,

    Mohit

  • Posted 14 July 2021, 12:21 pm EST

    Hello,

    That did not work, it still saves the file as the report Id.

  • Posted 15 July 2021, 1:59 pm EST

    Hello,

    Following code is working at my end successfully:

    viewer.export(‘Pdf’, downloadReport, true, { FileName: ‘1997 Annual Report’ });

    Could you please share the JS snippet?

    Thanks,

    Mohit

  • Posted 15 July 2021, 3:32 pm EST

    viewerWindow.export('Pdf', null, true, { Title: 'QA Report Sheet', FileName: 'QAReportSheet' });
    

    It is not saving as QAReportSheet, it is saving as the ReportID.

  • Posted 16 July 2021, 1:38 am EST

    Hello,

    I am not able to reproduce the issue with same code. Could you please try after upgrading the AR to the latest version. You can download the same from the following link:

    https://www.grapecity.com/activereportsnet/download

    Thanks,

    Mohit

  • Posted 20 July 2021, 11:19 am EST

    I figured it out. You have to have the callback function like in your example downloadReport. I was using null. You also have to have the parameter for show save as dialog be false. Otherwise if it’s true, it’ll download the report once with the filename specified and another time with the filename as the report Id.

Need extra support?

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

Learn More

Forum Channels