[Simple Reports With PDF] ERROR when clicking PDF Download

[Simple Reports With PDF] ERROR when clicking PDF Download

  
Forge Component
(10)
Published on 2017-01-05 by Huarlem Lima
10 votes
Published on 2017-01-05 by Huarlem Lima

Folks - first, I REALLY LOVE Simple Reports. Thank you so much for creating it!

I am using the Simple Reports with PDF and when I click the "Download" from the PrintMenu, when I debug, here is the exception that is thrown:

"Could not find file 'C:\Windows\TEMP\TEMPEAMWQILQHQ00000000000000000000000000000000.pdf'.
The switch --print-media-type, is not support using unpatched qt, and will be ignored.The switch --disable-smart-shrinking, is not support using unpatched qt, and will be ignored.SetProcessDpiAwareness failed: "COM error 0xffffffff80070005  (Unknown error 0x0ffffffff80070005)"
Error: Failed loading page https://rbcadc-dev.outsystemsenterprise.com/Sales/RFP_ReviewPDF.aspx?OpportunityId=87&CompanyId=7&(Not.Licensed.For.Production)= (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1, due to unknown error."

--------------------------------------------------------

The Html2PdfConverter module is correctly configured and works on the demo URLs like Google.com and OutSystems.com and I tried a few other public URLs that work so it looks like it is not the problem.

I don't quite understand the directions in this exception ... any hints?

Thanks!

Hello Bruce,

Probably you know that and this is not the problem, but, just to take out this possibility, as this component is based on the HTMLtoPDF component, I have to ask.

The Web Screen you are trying to convert on your app, is set to Anonymous?

The HTMLtoPDF will be executed outside the context of the application, so if the page is not accessible as anonymous, it will not work.

If this is not the case, you can try to make a simpler test on your server and on a personal to see if it is something related to the application itself, or related to your environment.

Cheers,
Eduardo Jauch

Solution

Eduardo Jauch wrote:

Hello Bruce,

Probably you know that and this is not the problem, but, just to take out this possibility, as this component is based on the HTMLtoPDF component, I have to ask.

The Web Screen you are trying to convert on your app, is set to Anonymous?

The HTMLtoPDF will be executed outside the context of the application, so if the page is not accessible as anonymous, it will not work.

If this is not the case, you can try to make a simpler test on your server and on a personal to see if it is something related to the application itself, or related to your environment.

Cheers,
Eduardo Jauch

Actually, this is my 1st time using HTMLTOPDF So I did not know the page must be anonymous.

changing to anonymous did the trick -But- now I have to find a to way secure the report page. You see, it has sensitive info.

Any tips how to secure it?


Solution

Hello Bruce,

One way is to provide Tokens and the page that is used to generate the report to refuse if it is not correct.
There is an example in forge, on how to use tokens: https://www.outsystems.com/forge/Component_Versions.aspx?ProjectId=1664

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hello Bruce,

One way is to provide Tokens and the page that is used to generate the report to refuse if it is not correct.
There is an example in forge, on how to use tokens: https://www.outsystems.com/forge/Component_Versions.aspx?ProjectId=1664

Cheers,
Eduardo Jauch

Funny about 5 min after I sent that note I got to thinking I might pass in an encrypted session token that is saved to the DB just before calling the report. The report decrypts and validates the token against the DB in the top of the preparation.

I guess brilliant minds think alike!!

Thx for the tips!!!


lol

Nice to see things got solved :)
Have a nice week!

Cheers,
Eduardo Jauch

For some reason I have the same issue, but less descriptive:

Could not find file 'C:\Windows\TEMP\TEMPVQUYQVPTKW00000000000000000000000000000000.pdf'.

The form is already set to anonymous. Any ideas?


Thanks,

Diana