Report Generator REPGEN
This program consists of two parts:
- A part to define a report with an HTML-Interface and to store this definition in a SQL-table called reports.
- A second part, to create an PDF-File out of the stored defintion.
A report is completely stored in the table 'reports' and you can therefor print a PDF-File without any manual ineraction. The PDF-File is created in the memory(without an intermediate file creation) and sent to your web-browser, where your Acrobat Reader - plugin can store or print the record. To create a PDF-File you have only to include the file 'repgen.inc' and to call the function 'create_report($database, $host, $user, $password, $id)'. $id is the Id-number of the report-definition, the other values are used to connect to the database (you will get them from your database administrator).
The report definition ist based on the stored SQL-statement, which creates a result set. Every record of this resultset can create a whole page or can only create a line in the report. If the value in one specified database field changes, you can define a new Group Header or Group Footer. For every page there is a Page Header and a Page Foot declared. In every section of the page (Page Header, Group Header, Detail, Group Foot and Page Foot) you can define a String, a DB-Field or one of the predeclared functions with the predefined fonts and fontsizes. As to now, the functions cannot be declared at runtime. The graphical elements which may be declared are lines or rectangles.
An example with the report-id '1' is included and may give you an impression of the possibilities.
The definition begins with repgen_main.php, where you are asked for the database, host, user,password to connect to the database with the report definition. If you chose to create a new report, you will come to repgen_create.php. Otherwise you will come to repgen_select.php, where you can select a report to work with. After selection of a report you will be guided to repgen_create.php too. In this screen you define the common properties of the report: