Welcome to the nuBuilder Forums!

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

How to run report PDF generation from a procedure?

Questions related to nuBuilder Forte Reports and the Report Builder.
Post Reply
chpwebmaster
Posts: 72
Joined: Mon Jun 10, 2019 5:00 pm
Has thanked: 6 times
Been thanked: 4 times

How to run report PDF generation from a procedure?

Unread post by chpwebmaster »

Reading https://forums.nubuilder.cloud/viewtopic.php?f=21&t=9905 I've managed to create a button to email a report for the current record on a button press. If a custom cookie ("ReportFormID") is passed when nuRunPDF.php is called it creates a PDF file with the passed current record's ID (Report-ID.pdf) then checks if the file exists and sends the email. What I want to be able to do is push a button from an administration form that runs a query to get a list of record ID's that match a criteria (EmailStatements) and generate Statement-ID.pdf then email Statement-Month_Year.pdf.

What I need to know is if there is a way to call nuRunPDF.php and pass the report name and ID and have it generate the PDF using my existing modification?

Code: Select all

if(isset($_COOKIE['ReportFormID'])){
	$PDF->Output(__DIR__ .  '/nuEmailReports/' . $_COOKIE['ReportFormID'] . '-report.pdf', 'F');
}
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: How to run report PDF generation from a procedure?

Unread post by Janusz »

Hi,
Please find enclosed not solution but maybe some other ideas to consider:

Consider JS:

Code: Select all

in SQL Builder:

SELECT ........
WHERE con_part='#parts_id2#'
-------------------------------------
on the form you can create temp input box parts_id2
-----------------------
and run in sequnce ex.:
from the onclick button or any JS

$('#parts_id2').val('5d7f8b2b4333c3d').change();
nuRunReport('FR_PART_RAP');
$('#parts_id2').val('c15686241200321002').change();
nuRunReport('FR_PART_RAP');
In this specific case you would have 2 raports generated. You can generate in the loop as many raport as you want.
Additionally you would need to adjust other code to get what you want.

But sometimes reworking is more difficult then writing new module so you can consider as well tcpdf (it's part on nuBuilder)
to write your own specific raport generator.
https://www.youtube.com/watch?v=m50DZkIwd-s
If you like nuBuilder, please leave a review on SourceForge
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: How to run report PDF generation from a procedure?

Unread post by admin »

.
Post Reply