Getting Dev Tools error trying to print to PDF

Stimulsoft Reports.JS discussion
Post Reply
bradlymathews
Posts: 7
Joined: Tue Nov 22, 2022 11:03 pm

Getting Dev Tools error trying to print to PDF

Post by bradlymathews »

(Reposting this into the correct forum)

I have a report displaying in Retool - a low code platform I am hoping to get Stimulsoft work on.

Retool runs in a sandbox and I am using their "Custom Component" feature which puts my code in an iFrame. I have all iFrame permissions enabled. This may be a case of the two not playing well together, but I am hoping you can give me some insight to help me get this working. I am guessing a lot of Retool customers will throw money at you if this works.

I am getting this warning in Dev Tools: Blocked a frame with origin "https://retool-edge.com" from accessing a cross-origin frame and no PDF shows up:

Image

Here is a screenshot of my Retool window showing code and settings:

Image
Lech Kulikowski
Posts: 4969
Joined: Tue Mar 20, 2018 5:34 am

Re: Getting Dev Tools error trying to print to PDF

Post by Lech Kulikowski »

Hello,

Please provide more detailed information:
1. I have all iFrame permissions enabled. - show your code or any information on how do you set these permissions
2. need the HTML page headers that you set
3. need the cross-domain.xml files that are used for your services

Thank you.
bradlymathews
Posts: 7
Joined: Tue Nov 22, 2022 11:03 pm

Re: Getting Dev Tools error trying to print to PDF

Post by bradlymathews »

Sorry, I should have been more clear.

Retool is a web-based low-code platform focusing on back-end applications where you drag and drop components to make your page, add API and database access, and then wire it all together with some javascript as needed. Custom Components like I am coding to make the Reports.Js work are iFrames where you can do almost anything if you build it yourself. But since the entire platform, including the iFrame is run within the browser's sandbox, there are limitations.

I have shown you everything there is to show that is under my control within this platform. Those sliders represent the permissions set. The code is everything I did. There are no XML files.
bradlymathews
Posts: 7
Joined: Tue Nov 22, 2022 11:03 pm

Re: Getting Dev Tools error trying to print to PDF

Post by bradlymathews »

I created a public facing Retool app so you can see what is happening:

https://captiontracker.retool.com/embed ... b67207935e

While testing this I noticed that Firefox behaves differently than Chrome. If you try and get a PDF in FF, the print dialog comes up. In Chrome, nothing happens. Also the warning and messages in Dev Tools on Chrome and FF are different.

Another interesting, but possible unrelated, difference is that Chrome does not show the toolbar icons, while FF does. I now there is ticket out on this already.
Lech Kulikowski
Posts: 4969
Joined: Tue Mar 20, 2018 5:34 am

Re: Getting Dev Tools error trying to print to PDF

Post by Lech Kulikowski »

Hello,

Please check the following discussion:
https://stackoverflow.com/questions/250 ... igin-frame

without iFrame, it is not possible to call Print To PDF.

Thank you.
bradlymathews
Posts: 7
Joined: Tue Nov 22, 2022 11:03 pm

Re: Getting Dev Tools error trying to print to PDF

Post by bradlymathews »

Hmmm, I will check with Retool on why the blob seems to want to come from retool-edge.com and loop back around with you in case their answer is illuminating as it seems if all is happening in the the same iFrame then there is no origin problem.

As a workaround, is there a way to get the binary or base64 of the generated PDF? I can then save that out myself.
Lech Kulikowski
Posts: 4969
Joined: Tue Mar 20, 2018 5:34 am

Re: Getting Dev Tools error trying to print to PDF

Post by Lech Kulikowski »

Hello,

You can export report to PDF in code:
https://www.stimulsoft.com/en/documenta ... export.htm

Thank you.
Post Reply