Any way to hook into export from viewer?

Posted by: joshuadmatthews on 25 July 2023, 7:36 am EST

    • Post Options:
    • Link

    Posted 25 July 2023, 7:36 am EST

    I have implemented paging in my reports using interactive features. One remaining issue is that typically with paging if the user prints the report all pages should be printed.

    Is there any way I can hook into the export flow to update a parameter and have it re-query the dataset so that the all pages are fetched and entire report is exported?

  • Posted 25 July 2023, 7:37 am EST

    Also want to hide my custom paging controls during export.

  • Posted 26 July 2023, 10:09 pm EST

    Hi Joshua,

    I have attached a sample application for you. In the attached sample, I have modified the Print button and now if you print the report it will first modify the report Parameters and select all values and then perform a print operation.

    For more information on modifying the viewer toolbar, please refer to the following pages of our documentation: Customisation

    >> Also want to hide my custom paging controls during export.

    You can add another layer to the report and set the Paging TextBox.Layer property with this new layer. As for the layer make sure to set the Target Device as ‘Screen’ only. This way the Layer will only be visible on the Viewer. I have attached a sample report and a screenshot for reference as well.

    I hope this resolves your query!

    Layer Sample.zipCustom Print Sample.zip

  • Posted 26 July 2023, 11:47 pm EST

    That works well for print, but I’d like to handle the export button also from the export panel. How can I do the same there?

  • Posted 30 July 2023, 6:52 pm EST

    Hi Joshua,

    I have attached a modified sample. In the attached sample I have modified the startExport method of the ActiveReports Viewer such that when the export button is clicked the Viewer exports the Report with all the parameters selected similar to the Custom Print implementation.

    arjs-react-viewer-custom-print-button-app.zip

  • Posted 31 July 2023, 3:07 am EST

    This works, thanks!

    It would be nice if this were possible without using css selectors. My boss doesn’t like solutions that require I step outside of the provided api.

  • Posted 1 August 2023, 6:04 am EST

    Hi Joshua,

    I have modified the sample such that it no longer use the “css selectors” approach. Please refer to the attached sample.

    arjs-react-viewer-custom-print-button-app.zip

  • Posted 7 August 2023, 12:56 am EST

    Question. What was the reason for adding the convertToXYZExport settings versus in the previous example we just passed the settings object as it is?

  • Posted 7 August 2023, 10:51 pm EST

    Hi Joshua,

    I have converted the Viewer Export Settings as the export method of the viewer takes in settings as a flat JSON: Record<string, string | number | boolean>

    But for the sample we are not using the Viewer.Export() method we are using the export API which request Export Settings as a nested object. I noticed this behavior when creating the second sample so I have implemented a code for converting the settings as well.

    For more information on various export settings please refer to the following page of our documentations:

Need extra support?

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

Learn More

Forum Channels