PHP Classes

PHP Report Designer: Display interactive report data from arrays

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 457 All time: 6,113 This week: 67Up
Version License PHP version Categories
report-designer 1.0GNU General Publi...5.0HTML, PHP 5
Description 

Author

This class can display interactive report data from arrays.

It can take an array of data records and generates an HTML table to display the data on a Web page.

The displayed report data may be filtered according to options chosen by the user interactively.

The report data can be exported in Excel, CSV or PDF format using the mPDF class.

Picture of Leonid
Name: Leonid <contact>
Classes: 1 package by
Country: Kazakhstan Kazakhstan

Recommendations

Excel reports
Create reports to Excel format

Example

<?php

/**PHP rep designer Demo
 * @author leonid martynov
 * @copyright 2014
 */

include 'repdesigner.php';


$rd = new RepDesigner();
$rd->cache_on = true;
if(!
$rd->ValidateCache())
    {
   
$sales[] = 'John';
   
$sales[] = 'Dru';
   
$sales[] = 'Colt';
   
$sales[] = 'Harry';
   
$sales[] = 'Mary';

   
$city[] = 'NY';
   
$city[] = 'Paris';
   
$city[] = 'London';
   
$city[] = 'Berlin';
   
$city[] = 'Madrid';

   
$prods[] = 'TV';
   
$prods[] = 'PC';
   
$prods[] = 'Mobile';
   
$prods[] = 'Tablet';
   
$prods[] = 'Notebook';

   
$month[] = 'August';
   
$month[] = 'May';
   
$month[] = 'April';
   
$month[] = 'September';
   
$month[] = 'June';

    for(
$i=0;$i<3000;$i++)
    {
   
       
$table['salesman'] = $sales[rand(0,4)];
       
$table['city'] = $city[rand(0,4)];
       
$table['product'] = $prods[rand(0,4)];
       
$table['month'] = $month[rand(0,4)];
       
$table['qty'] = rand(10,20);
       
$table['sum'] = $table['qty'] * 500;
       
$data[] = $table;
    }
   
   
$rd->SetSourceData($data);
   
    }

$rd->SetHorizontal(["month","city"]);
$rd->SetVertical(["salesman","product"]);
$rd->SetData(["qty","sum"]);
$rd->labels['qty'] = 'pcs';
$rd->labels['sum'] = 'usd';
$rd->title = 'PHP reportDesigner Demo';
$rd->description = 'Demo report';
$rd->PerformIfAction('./reporter.css','','','./pdf/mpdf.php');
$rd->cache_on = true;
$rd->TransformData();

?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Demo PHP RepDesigner</title>
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta name="viewport" content="width=960"/>
    </head>
      <link rel="stylesheet" href="./css/reporter.css" />
     <script type="text/javascript" src="./js/jq.js"></script>
     <script type="text/javascript" src="./js/repdesigner.js"></script>
  </head>
  <body>
    <?php
   
echo $rd->DrawTb();
   
?>
</body>
  </html>


Screenshots (1)  
  • shot
  Files folder image Files (9)  
File Role Description
Files folder imagecss (1 file)
Files folder imageimages (3 files)
Files folder imagejs (1 file)
Accessible without login Plain text file demo.php Example demo
Accessible without login Plain text file quickstart.txt Doc. quick guide
Plain text file repdesigner.php Class main class

  Files folder image Files (9)  /  css  
File Role Description
  Accessible without login Plain text file reporter.css Data css

  Files folder image Files (9)  /  images  
File Role Description
  Accessible without login Image file btn_csv.png Icon png
  Accessible without login Image file btn_excel.png Icon icon
  Accessible without login Image file btn_pdf.png Icon icon

  Files folder image Files (9)  /  js  
File Role Description
  Accessible without login Plain text file repdesigner.js Data js script

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  
 0%
Total:457
This week:0
All time:6,113
This week:67Up