Export RDL Report to docx from HTML5 Viewer

Posted by: bill on 12 July 2018, 2:21 am EST

  • Posted 12 July 2018, 2:21 am EST

    We are using Active Reports 12, version 12.1.13124. We are displaying some RDL reports in the HTML 5 viewer. Exporting to docx seems to be a valid choice on teh export type enumeration in javascript, but when we choose it we get an “Unknown Export Type” error.

    We stepped in to the javascript that is doing the export and we see this:

    this.Export = function(exportType, callback, saveAsDialog, settings) {

    if (!callback || !callback.call) {

    throw new Error(‘Cannot export without callback function.’);

    }

    if (exportType != ExportType.Pdf &&

    exportType != ExportType.Html &&

    exportType != ExportType.Word &&

    exportType != ExportType.Xls &&

    exportType != ExportType.Xml) {

    throw new Error('Unknown export type.
    ');

    }

    if (! settings) {

    settings = { };

    }

    if (saveAsDialog) {

    settings[‘SaveAsDialog’] = ‘true’;

    }

        _this.exportImpl(exportType, settings, callback);
    }; 
    

    If would appear from that function that docx is not actually supported. Can we export to docx. from the HTML 5 viewer?

  • Posted 12 July 2018, 2:49 pm EST

    Hello Bill,

    You are using AR12 SP1 in which Docx export support introduce. However, I have checked at my end with “HTML5 Viewer” located at (~\Documents\GrapeCity Samples\ActiveReports 12) and found that report is successfully exported to Docx format. Could you please try with the same sample.

    Also, could you please try after replacing your “GrapeCity.ActiveReports.Viewer.Html.js” with the new one located at (C:\Program Files (x86)\GrapeCity\ActiveReports 12\Deployment\Html).

    Hope it resolves your issue.

    Thanks,

    Mohit

  • Posted 13 July 2018, 5:17 am EST

    Thanks for your reply. I used incorrect terminology in my original post. We do not use the HTML 5 viewer, we use the .NET Viewer control in an ASP.NET page. Does the .NET viewer control support exporting to docx?

  • Posted 15 July 2018, 2:57 pm EST

    Hello Bill,

    WebViewer of ActiveReport does not have an inbuilt export functionality. I think you customized our web viewer to add export functionality. Therefore, you can add the code to export AR to Docx format as AR supports Docx export.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels