Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Saving report as a pdf

Questions related to nuBuilder Forte Reports and the Report Builder.
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Saving report as a pdf

Unread post by treed »

It used to be that when a report was printed to a pdf reader tab in my browser (Brave) clicking the down load button would save it as a pdf. Since upgrading to 4.5 and activating SSL when I try to save the report to a file this way it has a .php file extension and my browser reports a network error. Any idea on what might be going on here? Or where to look to find out?
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: Saving report as a pdf

Unread post by treed »

Further information, placed a pdf file on the server, opened it in the browser and saved with no problem.
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Saving report as a pdf

Unread post by Janusz »

Hi treed,
Was checking the latest option of PDF generation and on my configuration it works OK.
(Debian server with PHP8 and local computer Win10 with Chrome).

Please find enclosed in the video how it works on my computer and how you can extend functionality if you need any other.
Does it behave on your configuration the same way or differently?

https://drive.google.com/file/d/1kbKyL1 ... sp=sharing
If you like nuBuilder, please leave a review on SourceForge
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: Saving report as a pdf

Unread post by treed »

Well how bizarre, today it works as expected. Thanks for your help!
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: Saving report as a pdf

Unread post by treed »

And now for the last couple days we're back to the same error. The system try's to save a php and gets a network error when saving. And I think I have a clue, when saving to the network attached storage I get the failure and to a local drive it works as expected. The workstation is Ubuntu 20.04 desk top. Could it be some sort of sandboxing that Ubuntu is doing? Where I eventually plan to go with this is to save a copy on the server and email the report to the customer.
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Saving report as a pdf

Unread post by Janusz »

Hi,
You can try to save the pdf report to the disk on the server to the temp directory with:
https://wiki.nubuilder.cloud/ ... ReportSave

File name with path info will be stored in the mysql table pdf_temp
You can download as well the pdf from server to the local computer as following:
https://your.address/temp/nupdf_600b54434c864f0.pdf

Make sure that temp folder has proper writing permission:
chmod 744 temp
chown -R www-data:www-data temp
If you like nuBuilder, please leave a review on SourceForge
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: Saving report as a pdf

Unread post by treed »

Hi Janusz, Finally got around to trying this and it works! While I can see the entry in pdf_temp, what are your thoughts on how to use that data? It would be nice to have the report code in there so we'd at least know what report it was.
kev1n
nuBuilder Team
Posts: 4291
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 443 times
Contact:

Re: Saving report as a pdf

Unread post by kev1n »

treed,

I added a new column pdf_code in the table pdf_temp.
So when you call nuRunReportSave() to save a report, the report code is stored in the table too.

Updated these 2 files on Github:

core/nusystemupdatelibs.php
core/nurunpdf.php

Run "Update" after replacing these files.

Please let me know if it works for you.
apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

Re: Saving report as a pdf

Unread post by apmuthu »

Fixed in v4 too and reduced PDF size - font subsetting.
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: Saving report as a pdf

Unread post by treed »

Which github???
Post Reply