How to run report PDF generation from a procedure?
Posted: Sun Sep 15, 2019 6:13 pm
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?
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');
}