How to run report PDF generation from a procedure?

Questions related to nuBuilder Forte Reports and the Report Builder.

How to run report PDF generation from a procedure?

Postby chpwebmaster » Mon Sep 16, 2019 1:43 am

Reading 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');
}
chpwebmaster
 
Posts: 15
Joined: Tue Jun 11, 2019 12:30 am

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

Postby Janusz » Tue Sep 17, 2019 1:14 am

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
Janusz
 
Posts: 229
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

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

Postby admin » Wed Oct 09, 2019 2:01 pm

.
admin
Site Admin
 
Posts: 3123
Joined: Mon Jun 15, 2009 9:53 am


Return to Reports