renderAsync does not show nothing

  • Hello,
    I built a template in jsreportOnline and it works if I run it from jsReport Studio.

    Then I incapsulated it in my web application so that I can run it from my javascript application.

    here my code that till some days ago worked, but now it does not show nothing in the browser page:

    //return false;
    jsreport.serverUrl = '';
    jsreport.headers['Authorization'] = "Basic " + btoa("xxxxxx:yyyyyyyy")
    var request = {
    	template: {
    		shortid: 'S16Ay4UzW', recipe: 'phantom-pdf'
    	data: reportData
    //display report in the new tab
    jsreport.renderAsync(request).then(function(res) {
    	//open in new window

    it runs, it opens a new browser tab with url like data:application/pdf;base64, JVBERi0xLjQKMSAwIG9iago8P........ but the page is blank, it doesn't show the report. Instead if I take the same reportData and put it in the STUDIO online, when I run the report it shows correctly

  • Hello,
    checking better the console messages I found this error
    "Not allowed to navigate top frame to data URL: data:application/pdf;base64"
    due to last Chrome update

    so I was able to fix it with this updates

    var url = res.toDataURI();
    var url_with_name = url.replace("data:application/pdf;", "data:application/pdf;name=myname.pdf;")
    var html = '<html>' +
    	'<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style>' +
    	'<body>' +
    	'<p>new viewer</p>' +
    	'<iframe type="application/pdf" src="' + url_with_name + '"></iframe>' +
    var a ="about:blank", "Zupfnoter");

  • Thank you for sharing this!

    It is now part of the documentation:

Log in to reply

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