Esempio n. 1
0
$sHTMLOut = tempnam(null, "html");
print "Code output: {$sCode}\n";
print "XML output: {$sXMLOut}\n";
print "HTML output: {$sHTMLOut}\n";
// create the report maker object with all the debugging stuff we can
print "Creating the report maker object ...\n";
$oRpt = new PHPReportMaker();
$oRpt->setXML("sales.xml");
$oRpt->setUser($sUser);
$oRpt->setPassword($sPass);
$oRpt->setDatabase($sData);
$oRpt->setDatabaseInterface($sInte);
$oRpt->setConnection($sConn);
$oRpt->setCodeOutput($sCode);
$oRpt->setXMLOutputFile($sXMLOut);
$oRpt->setOutput($sHTMLOut);
print "Creating the default output plugin ...\n";
$oOut = $oRpt->createOutputPlugin("default");
if (is_null($oOut)) {
    print "ERROR: could not create an output plugin.";
    return;
}
$oOut->setClean(false);
$oRpt->setOutputPlugin($oOut);
print "Running the report, please wait ...\n";
$oRpt->run();
// check if everything was ok
if (!file_exists($sCode)) {
    print "ERROR: code file {$sCode} does not exists, no code to process.";
}
if (filesize($sCode) <= 0) {