HTML5Viewer Export Functionality Options

Posted by: sboyer on 3 October 2017, 3:38 am EST

    • Post Options:
    • Link

    Posted 3 October 2017, 3:38 am EST

    We are using the HTML5Viewer to export reports in a web application. The user interface for the HTML5Viewer includes a “Save As…” button. Pressing that button displays a menu with 5 options,

    1. PDF Document
    2. Word Document
    3. Image File
    4. MHTML Web Archives
    5. Excel Workbook

    Examination of the ActiveReports 11 documentation did not surface any other export options. No additional formats to add to the list above. No way to further refine the options in the list above.

    The only avenue to change or augment export functionality was to use the JavaScript AddListener method to setup a function that would handle ‘click’ events raised by the “Save As…” button.

    Two questions:

    1. Is there any export functionality built into the HTML5Viewer that we have neglected to discover?
    2. Are there any other avenues to change or augment export functionality that we have neglected to discover?
  • Posted 3 October 2017, 6:00 pm EST

    The export formats listed in the dropdown are the most common ones. There are other formats as well, that are supported in the Html5 Viewer. You can use the client side ‘export’ method in javascript and mention the export format as an argument. Please see the following documentation link for info on the export method: http://help.grapecity.com/activereports/webhelp/AR11/index.html#HTML5WorkingwithViewerUsingJavascript.html

    Here’s a list of the supported formats that can be used with the export method :

    • Microsoft OpenXML (xlsx and docx formats are supported (but docx for PageReports only))
    • Microsoft Office - xls and doc formats are supported
    • CSV (supported through txt with delimiter)
    • HTML
    • XML (only for PageReports)
    • RTF
  • Posted 4 October 2017, 1:17 am EST

    Thank you for your response.

    I was aware of the “Export” method but did not know about the additional formats. Thanks for bringing that to my attention.

    There is still an issue that I would like to explore further. When I referred to “augmenting export functionality” I was thinking about functionality (UI or programmatic) that would allow for specification of properties or options about the process of exporting to a particular format. For example suppose I decided to export to an Excel spreadsheet. Is there functionality that allows for further specification of how that export to an Excel spreadsheet should be performed?

  • Posted 4 October 2017, 4:39 pm EST

    The fourth argument in the export method is for specifying the settings for the export. Please see the documentation link I sent earlier for information on when the settings will work and when they wont.

  • Posted 15 May 2018, 7:08 am EST

    Can we have the “Save As…” button to display only the following,

    1. PDF Document
    2. Excel Workbook

    Do you have any sample code for it?

  • Posted 15 May 2018, 3:29 pm EST

    You can use the ‘availableExports’ option to specify what export options are available in the dropdown -

    http://help.grapecity.com/activereports/webhelp/AR12/webframe.html#HTML5WorkingwithViewerUsingJavascript.html

  • Posted 16 May 2018, 2:21 am EST

    Tried that but the SaveAs button still displays the default values.

  • Posted 16 May 2018, 6:02 pm EST

    I could see the availableExports option working correctly at my end. I’ve attached a screen shot and the default HTML5 Viewer application as well. I’ve verified this with ActiveReports 12 SP1. Here’s the relevant code:

    var viewer = GrapeCity.ActiveReports.Viewer({
                    element: '#viewerContainer',
                    reportService: {
                        url: '/ActiveReports.ReportService.asmx'
                    },
                    uiType: 'desktop',
                    reportLoaded: function () {
                        reportsButtons.prop('disabled', false);
                    },
                    availableExports: ['Xls', 'Pdf'],
    ```[img]https://gccontent.blob.core.windows.net/forum-uploads/file-9ebba846-e9d8-401c-bd77-b44f7454b56a.PNG[/img][zip filename="HTML5 Viewer_availableExports.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-334c5b0b-54f7-47bd-9b29-e5ff5617fe08.zip[/zip]
  • Posted 20 November 2019, 10:28 am EST

    When I run your sample (after upgrading version to ActiveReports 12 SP2 and repointing all data sources to my user documents folder instead of yours), I still see the full default list.

    I was hoping that this sample app would let me figure out how to get the Save As… button to show the dropdown list - I am using an MVC5 web app. I was able to get everything else to work - as long as I use the mobile view (the rdlx parameter combo lists don’t dropdown either in the desktop view).

  • Posted 20 November 2019, 4:04 pm EST

    Hello,

    I am able to successfully run the sample at my end after upgrading to the latest version of AR12. Please download the latest version of AR12 SP3 from the following link:

    https://cdn.grapecity.com/ActiveReports/ar12/hotfixes/ActiveReports-v12.3.18467.0.msi

    Also, refer to the modified sample with the latest version.

    Thanks,

    Mohit

    (M)HTML5 Viewer_availableExports.zip

  • Posted 22 November 2019, 12:01 pm EST

    I figured out why the Save As button wasn’t working - I had updated the Bootstrapper package to a version that required Popper.js and this was blocking the pulldown on the Save As button and on parameter pulldowns in the desktop view. Once I reverted to a version of Bootstrapper that didn’t require Popper.js and uninstalled Popper.js, I was able to get it all to work.

  • Posted 25 November 2019, 2:02 am EST

    Hello Jennifer,

    I am glad that your issue has resolved now. Please feel free to revert if you face any issues further.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels