PHP Classes

PHP ODT Template SQL Reports: Generate report from MySQL data using ODT template

Recommend this page to a friend!
  Info   Documentation   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 70%Total: 442 All time: 6,242 This week: 45Up
Version License PHP version Categories
odtreportsql 1.5GNU Lesser Genera...5PHP 5, Databases, Printing, Templates
Description 

Author

This package can generate report from MySQL data using ODT template.

It can process document templates in the ODT format used by OpenOffice and replaces the template placeholder values with data from MySQL database query results.

The template engine supports variable substitution by text or even pictures, blocks to iterate over data, nested blocks, picture substitution.

Innovation Award
PHP Programming Innovation award nominee
April 2017
Number 2
Many applications need to generate reports from data retrieved from a database.

This class can generate reports from MySQL database query results using templates in the ODT format used by OpenOffice.

This allows creating report documents formatted with user defined templates and replacing placeholders with data from a database.

Manuel Lemos
Picture of Marco Sillano
  Performance   Level  
Name: Marco Sillano <contact>
Classes: 4 packages by
Country: Italy Italy
Age: ???
All time rank: 201279 in Italy Italy
Week rank: 49 Up3 in Italy Italy Up
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

Recommendations

generate pdf with php
i need to generate a pdf from php and mysql

Adding excel object in docx
Adding excel in docx and edit the excel content using php

What is the best PHP mysql report class?
Build a nice report

Generate Report
I need a php class that will output a pdf or excel document r

Documentation

Pre-requisites: A WAMP installed. Install: 1) Download all files. 2) Create a web dir (e.g. www/odtdocument/ ). 3) Copy all files in www/odtdocument/, www/odtdocument/lib, www/odtdocument/templates. 4) Using phpMyAdmin, create a database (e.g. odtdbase). 5) Import the SQL files: odt_queries.sql. odt_reports.sql in odtdbase to create tables. (In production, you must add it to your application: 'www/odtdocument' is the application web dir, and DB 'odtdbase' is the application main DB) Setup: 6) Copy language_xx.php to language.php. 7) Edit and updates: config.php, language.php and odtphpsql.php (see TODO in files). Demo: 1) download demo.zip (from https://github.com/msillano/odtReportSQL/tree/master/demo ) 2) Unzip demo.zip in www/odtdocument/ 3) Import the SQL file: odtphp.sql on odtdbase to create and populate all tables for demo. 4) Run demo starting fom odtdocument/index.php 5) You can see demo screenshot here: https://github.com/msillano/odtReportSQL or here: https://www.phpclasses.org/package/10276-PHP-Generate-report-from-MySQL-data-using-ODT-template.html#view_files/files/demo/img

Details

# odtReportSQL This scalable library defines a complete reports/documents system for php-mySQL applications. ![demo screenshot](./demo/img/2017-04-19.210908.shot.png) Features: - Based on templates created using OpenOffice (.odt files) - Templates can be of any size (A4, A3...) and multipage. - On templates this system can do: * Simple substitution based on couples #field#/value. * Blocks and nested blocks duplication (any deep) or deletion. * Pictures substitution. - The HTML User Inteface is build by System and can be easy added at an existing php application. Add 2 lines ( see odtReportSQL-test.php) * <?php include('odtReportSQL.php'); ?> * <?php echo getReportMenu('this_page'); ?> - This system is DB driven, using 2 tables to define all templates substitutions and UI - Scalable: * odtphp.php defines template substitution engine * odtphpsql.php adds substitution queries definitions in DB * odtReportSQL.php adds an UI defined in DB - Any document as an URL definition. - To add a new document is only required to make the new template and to update the DB. - The resulting documents can be open using OpenOffice and saved in almost any format. This system was developped to be used with a school examinations management software, with more than 25 different documents (letters, certificates, ufficial records, grade tables, notices...) from 1 to 68 pages. ![demo template](./demo/img/2017-04-20.075902.shot.png)![demo document](./demo/img/2017-04-20.080141.shot.png) see install.txt. TODO - More translations (files language_xx.php). - More DB Interfaces (file commonSQL.php)

Screenshots (1)  
  • examples
  Files folder image Files (24)  
File Role Description
Files folder imagedemo (1 file, 1 directory)
Files folder imagelib (1 file)
Files folder imagesql (2 files)
Files folder imagetemplates (1 file)
Accessible without login Plain text file commonSQL.php Aux. mysql base functions
Accessible without login Plain text file common_pdo.php Aux. Update for commonSQL (obsolete)
Accessible without login Plain text file config.php Conf. db config
Accessible without login Plain text file install.txt Doc. install instructions
Accessible without login Plain text file language-en.php Aux. en messages
Accessible without login Plain text file language-it.php Aux. it messages
Accessible without login Plain text file language.php Aux. used messages
Accessible without login Plain text file LICENSE Lic. License text
Plain text file odtphp.php Class replacements engine
Plain text file odtphpsql.php Class mySQL substitutions
Plain text file odtReportSQL.php Class mySQL UI definitions
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Image file update.gif Icon button ico

  Files folder image Files (24)  /  demo  
File Role Description
Files folder imageimg (5 files)
  Accessible without login HTML file demo.readme Doc. demo

  Files folder image Files (24)  /  demo  /  img  
File Role Description
  Accessible without login Image file 2017-04-19.210908.shot.png Output update
  Accessible without login Image file 2017-04-20.075902.shot.png Output update
  Accessible without login Image file 2017-04-20.080141.shot.png Output update
  Accessible without login Plain text file Notice-example_A3.pdf Doc. new
  Accessible without login Plain text file Notice-template_A3.pdf Doc. new

  Files folder image Files (24)  /  lib  
File Role Description
  Plain text file pclzip.lib.php Class required library

  Files folder image Files (24)  /  sql  
File Role Description
  Accessible without login Plain text file odt_queries.sql Aux. SQL to create table odt_queries
  Accessible without login Plain text file odt_reports.sql Aux. SQL to create table odt_reports

  Files folder image Files (24)  /  templates  
File Role Description
  Accessible without login HTML file reportSQL.html Data for UI

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 91%
Total:442
This week:0
All time:6,242
This week:45Up
User Ratings User Comments (3)
 All time
Utility:100%StarStarStarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:100%StarStarStarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:70%StarStarStarStar
Rank:300
 
Thats a very good class !
7 years ago (José Filipe Lopes Santos)
70%StarStarStarStar
Thats a very good class !
7 years ago (José Filipe Lopes Santos)
70%StarStarStarStar
Thats a very good class !
7 years ago (José Filipe Lopes Santos)
70%StarStarStarStar