We developed a report using FOP technology: fop listener in the .xml file, event treatment in corresponding program (.nsp file) and, of course, the *_fop.xml file
When the user clicks FOP button , an pop up window shows and it is possible to download a .pdf file.
I know FOP is great to export data from a specific (you have a screen where is showed a specific record and you want to know to generate a .pdf)
I would like to know if there is way to fire the click event without user click.
Our purpose is to use FOP as way to generate reports. For instance, the user clicks a button and the fop popup is opened automatically.
Yes, you can trigger the corresponding event from within the Natural program.
Do the following:
Add a “Trigger Natural Event” control to your layout - tag is njx:triggerevent.
Set the property withclientrefresh=“true”
<natpage….>
<njx:triggerevent withclientrefresh="true >
This will generate the following 2 fields in your Natural program: 1 XCICLIENTREFRESH (L) 1 XCITRIGGEREVENT (U) DYNAMIC
The following shows the code snippet to open a pdf report in a pop-up from your Natural program: XCICLIENTREFRESH:=TRUE
XCITRIGGEREVENT := “onPrintPDF”
…
PROCESS PAGE UPDATE FULL
This is supported in versions NJX911Fix3 or higher.
Additionally this might also be an interesting feature for your scenario:
You can also dynamically set the file name of your pdf page - the page with the cisfo:* controls - from within your Natural program. With this you can dynamically show different pdf reports from the same Natural program/natpage layout.
<natpage pdfpageprop=“mypdfpage” …
In the Natural program: 1 MYPDFPAGE (U) DYNAMIC
…
MYPDFPAGE :=‘MyFopPage.xml’