Active Reports 14 JSViewer Export

Posted by: ricardo.pereira on 19 February 2020, 4:15 am EST

    • Post Options:
    • Link

    Posted 19 February 2020, 4:15 am EST

    I’m using Active Reports 14 with the JS Viewer running in one application calling a dotnet core hosted AR web service in another (using the JSViewerCoreMVCApplication1 sample application as the server); as shown in the following diagram from yourselves:

    https://www.grapecity.com/activereports/docs/v14/online/images/DifDomain_CORS.png

    Although I am able to get reports displaying correctly using the following viewer code:

    <script type="text/javascript">
        let viewer;
        function loadViewer() {
          viewer = GrapeCity.ActiveReports.JSViewer.create({
            element: '#viewerContainer',
    		reportService: {
    			url: 'http://localhost:5050/api/reporting',
    			securityToken: '42A9CD80A4F3445A9BB60A221D042FCC'
    		}
          });
          viewer.openReport("RdlReport1.rdlx");
        }
      </script>
    

    When exporting the report as for example a PDF, rather than the resultant file being called RdlReport1.pdf, instead it is exporting as RdlReport1.rdlx. If I then change the extension of the file to .pdf I can see that the file is actually a PDF, and that it is just being named incorrectly. Is there any guidance you can provide to resolve this issue?

  • Posted 19 February 2020, 7:39 pm EST

    Hello,

    I am able to reproduce the issue at my end. I am unable to find the workaround for this. Hence, I have escalated this to our development team(278478) and will inform you once I got any information from them.

    Thanks,

    Mohit

  • Posted 23 February 2020, 9:42 pm EST

    Hello Mohit,

    Any further news on this subject? Do you have an estimate on when this matter will be sorted?

    Thank you,

    Ricardo Pereira

  • Posted 23 February 2020, 10:06 pm EST

    Hello Ricardo,

    This issue is still with our development team and they are working on this. I will inform you once there is any update on the case.

    As a workaround, you can use IE as a browser.

    Thanks,

    Mohit

  • Posted 17 March 2020, 8:49 pm EST

    Hello Ricardo,

    This issue occurs because of restriction to access response headers when using Fetch API (which we use to download the exported file) over CORS. You can use the following CORS policy to avoid this issue:

    HttpContext.Current.Response.AddHeader("Access-Control-Expose-Headers", "Content-Disposition")
    

    Hope it helps.

    Thanks,

    Mohit

  • Posted 17 March 2020, 9:48 pm EST

    Hello Mohit,

    That fix worked. Thank you very much.

    Best regards,

    Ricardo Pereira

Need extra support?

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

Learn More

Forum Channels