Export Object is not working



  • When i click on Export option i am getting below shown error.

    Unable to prepare export Request has been terminated
    Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.

    FYI: we are using PostGres to store reports.

    please let us know how do we fix this.


  • administrators

    what version of jsreport are you using? what node version are you using? what OS are you using?



  • we have installed the JSreports on AWS using Docker image file
    jsreport:1.7.0-full
    "AWSEBDockerrunVersion": "1",


  • administrators

    so far i don't see any error when trying it in my local machine with jsreport@1.7.0, i will try with the docker image... but it seems like a network issue because the browser is cancelling the request, maybe there is something misconfigured in the AWS part



  • The logs could help here. Can you provide the jsreport logs to us?
    I think you need to connect to the host machine and then through docker exec get the logs.



  • This post is deleted!


  • I have tried in different browser in firefox and it is working good.

    thanks, earlier i was trying this in safari.



  • This is happening because of the CORS (Cross Origin Resource Sharing) error. This error occurs when you try to access a domain/resource from another domain. You cannot issue requests through the XMLHttpRequest to other domains or subdomains. For example, if you are doing something like writing HTML and Javascript in a code editor on your personal computer, and testing the output in your browser, you might probably get error messages about Cross Origin Requests .

    JSONP ( JSON with Padding ) is a method commonly used to bypass the cross-domain policies in web browsers.

    If this is for local development and you are using Chrome , you need to run Chrome with a couple of arguments to relax security like this:

    "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files --disable-web-security

    If you need to enable CORS on the server in case of localhost, you need to have the following on request header.

    Access-Control-Allow-Origin: http://localhost:9999

    The other easy way out, would be to create a proxy on your local server, which gets the remote request and then just forwards it back to your javascript.

    http://net-informations.com/js/err/xml.htm



  • "If you need to enable CORS on the server in case of localhost, you need to have the following on request header.

    Access-Control-Allow-Origin: http://localhost:9999 "

    How to do it in server ?


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.