OpenPro PHP Report Writer Module

Back

How To Use Openpro To Create A Php Report

OpenPro has the ability to create custom customer reports. This feature is excellent for consultants and administrators who need to provide custom reports. The process of setting up new customer reports can be outlined as follows:

  • Login to the system under administrator, Developement Report Template.
  • Add new report.
  • Fill out header information, add header
  • Fill out table information, add table.
  • Fill out line item detail information, add fields.
  • Compile report
  • Add report to the menu system.
  • Advance items, select records, how to change the reports, merge tables etc.

The tutorial that follows will walk you through the process step-by-step. If you do not have an OpenPro installation in your business, you are invited to follow this tutorial using our OpenPro live demo site on the Internet. If you have a log in account, please go to the demo site and log in before proceeding. If you do not have a demo account, please contact OpenPro and we will set one up for you.

Login to the system under administrator, go to Developement then Report Template.

Click on the blue Add new Report button, or if you wanted to edit an existing report you can select the existing report to edit.

The next screen will be the header information. Reports are broken up into sections, you have header section level 0, detail section level 1, totals are level 2 and 3. Fill out the report name, title, restrict to company should be checked, bold your title, center your title, change your title color. In the bottom section of the page check show date and page numbers and select ADD.

Table information needs to be added to let the report writer know where to get the fields from. The tables can also be linked together.

Select the IC_ITEMS table to display the part number and name and price 1 fields. Click the ADD button.

Fill out the table alias and report level 1 and click ADD.

Then you receive the message data table successfully edited. To add the fields you want to see on the report, select the data table next to EDIT button, select IC_ITEMS and click EDIT.

When you edit the table all the fields will then be added to the report.

To the right of the screen select the fields you want to show up on the report, partnum, name and price_1. Select the field then click ADD, the*n next screen will popup.

This page is the detailed line item field information. If you want to just take the default size color fonts etc, just click the ADD button. Select each field you want to see on the screen, they will show up on the order that you select them in from left to right.

After you have added the fields to see the field in the EDIT button you will have to click SAVE and then edit the table again or refresh the screen.

When all the fields are added to the report you then can compile the php code for the report. On the top right hand side, fill out the file name and click on compile report.

Note the name can not have any special characters, or spaces in it and needs to be 10 characters or less.

Then you receive the message php report file successfully created.

Add the new report to the menu

Go into menu edit mode under Admin.

Copy an existing menu item (green button), then edit the copied version (blue button). In the script you need to put in the following:

index.php?act=item55&rptfolder=true

where item55 is the name you gave the report when you compiled it.

When you run the report from the menu the following displays. If you put selection criteria it will display on this page. Then click make report.

Then the following report appears. To make changes to the report go into edit mode, or even bring up the php source code and make the changes manually. If you change the source code using php commands, the next time you compile this report it will overwrite all changes made to the system.

Selecting certain records when creating a report. Then go back and edit the report.

Pull up your Data table and click EDIT the screen below will appear.

Then in the selection criteria, you can select certain fields to limit your report searching.

So then before you run the report it will ask for selection criteria.

Click Save, re-compile the report as item 55 and run it again.

Now when running the report, it ask for the selection criteria, you can enter in something it will find all the records with that something in there.

Below is an example all the records with fg in the part number.

You can have up to 4 fields to search for during the report process.

During the selection process, you can have the following choices, Greater than, Equal, Less Than, Match% (the beginning of a field), and %Match% will be any thing in that field with this information.

Match examples:

  • Match% will pick up all parts start with FG.

Match% will pick up all parts with FG anywhere in the part number.

When running the report it will ask for the multiple questions.

To do this you have to know the basics of how to link tables to create a report.

  1. select the table in value tables (ic inventory) for this example.
  2. Click the ADD button.
  3. Select the Table, EDIT the new table and fill out the Table Alias, and the Report level (same as the first table). Table Alias needs to be different than the first table, then click the ADD button.

Then go to table links. This is where you can link table 1 to table 2. In this example we are linking Ic Inventory (id) with the Ic_Inventory Item. Then click the ADD button.

Once the link has been added you can select some fields from the secondary table, We selected the serial number.

Then save it and recompile the item 55 report.

When you run the report it will then show serial number details for each item.

You can clean up the report by changing the report headers fields when you edit each field and other changes.

Other things you can do is modify the code. Here is an example of the code generated from the report writer.

Click to open code block

[Last review date June 2017]