Welcome to the nuBuilder Forums!

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

Customised PDF report File Name

Post your ideas & suggestions for new nuBuilder features or other improvements
Post Reply
nc07
Posts: 118
Joined: Tue Jun 04, 2019 4:05 am
Has thanked: 5 times
Been thanked: 22 times

Customised PDF report File Name

Unread post by nc07 »

Hello Everyone,

Current PDF when downloaded had to be renamed manually, this can be done automatically based on the description set in your reports and titles without sending additional data from the form via javascript.
Below is the code that is required in nurunpdf.php. This can be changed to one's preference or the original configuration could be left as it is.

Just thought of sharing with everyone.

Code: Select all

$desc = $JSON->description;
$title = $JSON->title;
$date = date('Y-m-d_H-i-s');
$file_name = 'Report_' . $title . '_' . $desc . '-' . $date . '.pdf';

//$PDF->Output('nureport.pdf', 'I');
$PDF->Output($file_name, 'I');
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Customised PDF report File Name

Unread post by kev1n »

Thank you for your suggestion. I even think of going one step further so that you can specify any file name (something like this)
I will get back to you as soon as I have something worked out.
Post Reply