Page 1 of 2
Saving report as a pdf
Posted: Fri Jan 15, 2021 11:31 pm
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?
Re: Saving report as a pdf
Posted: Sat Jan 16, 2021 12:59 am
by treed
Further information, placed a pdf file on the server, opened it in the browser and saved with no problem.
Re: Saving report as a pdf
Posted: Sat Jan 16, 2021 9:08 am
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
Re: Saving report as a pdf
Posted: Sat Jan 16, 2021 9:36 pm
by treed
Well how bizarre, today it works as expected. Thanks for your help!
Re: Saving report as a pdf
Posted: Fri Jan 22, 2021 10:28 pm
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.
Re: Saving report as a pdf
Posted: Fri Jan 22, 2021 11:55 pm
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
Re: Saving report as a pdf
Posted: Tue Feb 02, 2021 11:26 pm
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.
Re: Saving report as a pdf
Posted: Wed Feb 03, 2021 6:32 am
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.
Re: Saving report as a pdf
Posted: Wed Feb 03, 2021 7:08 pm
by apmuthu
Fixed in v4 too and reduced PDF size - font subsetting.
Re: Saving report as a pdf
Posted: Wed Feb 03, 2021 10:28 pm
by treed
Which github???