The basic sample

Its the smallest thing you can do with PHPReports, make a XML report file like this and name it sales.xml:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
   <TITLE>Sales Report</TITLE>
   <PAGE SIZE="25"></PAGE>
      <GROUP NAME="maingroup">
               <COL TYPE="FIELD">id</COL>
               <COL TYPE="FIELD">name</COL>
               <COL TYPE="FIELD">city</COL>
               <COL TYPE="FIELD">product</COL>
               <COL TYPE="FIELD">value</COL>
Now you need the PHP code to make it works. Put the following code inside a file called sales.php:
   // include the PHPReports classes on the PHP path! configure your path here
   include "PHPReportMaker.php";

   $sSQL = "select * from saleslog order by city,id";
   $oRpt = new PHPReportMaker();

If everything is ok, Apache is running, Sablotron was correctly installed, when you point your browser
to sales.php you'll see something like this:

sales.xml result file

Argh! Ugly uh? Where's that cute report we saw on the previous section? Just hold on and we'll see it soon. :-)