This article demonstrates how to use the FactoryPMI Reporting Plugin to dynamically fill an existing PDF report. For this example, we will fill in a 1040EZ Income Tax Return with data from a MySQL database.
The database we are using for this example is called
Accounting. There are two tables inside the database, one called
Contactsand one called
The contacts data can be retrieved from the accounting database with the following SQL query:
SELECT C.* FROM Contacts C ORDER BY C.ID;
The income data can be retrieved from the accounting database with the following SQL query:
SELECT I.* FROM Income I ORDER BY I.ContactID;
You can retrieve the combined data for the first contact with the following query:
SELECT C.*, I.* FROM Contacts C, Income I WHERE C.ID = I.ContactID AND C.ID = 1;
Begin by installing the Reporting Plugin in the FactoryPMI Gateway Configuration under the section labeled Plugins. Once you have the plugin installed open up the FactoryPMI Designer and select the project you want to configure. Now create a new window and drag down a
Report Viewerfrom the Reporting tab. Next, populate the
Datadynamic dataset property by binding it to the combined sql query from the last section. Now click on the Customizer (Cntl+U) button to start designing the report.
Creating the Report
First drag and drop an existing PDF from Windows into your report designer. This will make the existing PDF the background of your report.
Now, select the
Keystab on the right hand side of the report designer. Next, select Data and then drag and drop the
Firstnamekey into the report. It is as simple as that!
Finish dragging in all of the keys for the report. You can even do dynamic calculations inside the report as well. Once you are done click OK and the report will look like this:
Learn more about Ignition® Reporting Software