Creación de la BD
create table saleslog ( id numeric(5), name varchar(50), city varchar(50), product varchar(50), value numeric(15,2) );
1,"Eustaquio Rangel","Sao Jose do Rio Preto, SP","Book - Linux Programming",25
1,"Eustaquio Rangel","Sao Jose do Rio Preto, SP","Book - Design Patterns" ,35
2,"Ana Carolina" ,"Sao Jose do Rio Preto, SP","Book - Photoshop 7.0" ,22.50
3,"Andre Kada" ,"Sao Paulo, SP" ,"CD - Kreator - Violent Revolutions",15
Inserción de la data:
insert into saleslog values (1,"Eustaquio Rangel","Sao Jose do Rio Preto, SP","Book - Linux Programming",25);
insert into saleslog values (1,"Eustaquio Rangel","Sao Jose do Rio Preto, SP","Book - Design Patterns",35);
insert into saleslog values (2,"Ana Carolina" ,"Sao Jose do Rio Preto, SP","Book - Photoshop 7.0",22.5);
insert into saleslog values (3,"Andre Kada" ,"Sao Paulo, SP","CD - Kreator - Violent Revolutions",15);
El XML
sales7.xml
El PHP
if(!file_exists('/var/www/phpreports/PHPReportMaker.php') ) {
echo 'can not include';
} else {
include "PHPReportMaker.php";
// include the PHPReports classes on the PHP path! configure your path here
sSQL = "select id,name,city,product,value,concat('http://www.mysite.com/customers.php?id=',id) url from saleslog order by city,id"; oRpt = new PHPReportMaker();
oRpt->setXML("sales7.xml"); oRpt->setUser("root");
oRpt->setPassword("******"); oRpt->setConnection("localhost");
oRpt->setDatabaseInterface("mysql"); oRpt->setSQL(sSQL); oRpt->setDatabase("phpreports");
$oRpt->run();
El PHP
if(!file_exists('/var/www/phpreports/PHPReportMaker.php') ) {
echo 'can not include';
} else {
include "PHPReportMaker.php";
// include the PHPReports classes on the PHP path! configure your path here
sSQL = "select id,name,city,product,value,concat('http://www.mysite.com/customers.php?id=',id) url from saleslog order by city,id"; oRpt = new PHPReportMaker();
oRpt->setXML("sales7.xml"); oRpt->setUser("root");
oRpt->setPassword("******"); oRpt->setConnection("localhost");
oRpt->setDatabaseInterface("mysql"); oRpt->setSQL(sSQL); oRpt->setDatabase("phpreports");
$oRpt->run();