Location: PHPKode > scripts > SDReport > sdreport/demo.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>SDReport - Demo</title>
<meta name="Author" content="Silvio Delgado - www.silviodelgado.com.br" />
<style type="text/css">

.header
{
	background: #09a;
	color: #fff;
	font-family: Arial, Verdana, Sans-serif;
	font-size: 11px;
	font-weight: bold;
	text-align: center;
	border: 1px solid #369;
	padding: 2px;
	margin: 1px;
}

.item
{
	background: #fff;
	color: #000;
	font-family: Arial, Verdana, Sans-serif;
	font-size: 11px;
	font-weight: normal;
	text-align: left;
	padding: 2px;
	margin: 1px;
	border: 1px solid #dedede;
}

.footer
{
	background: #6699aa;
	color: #fff;
	font-family: Arial, Verdana, Sans-serif;
	font-size: 10px;
	font-weight: bold;
	text-align: left;
	border: 1px solid #dedede;
	padding: 3px;
	margin: 1px;
}

h1
{
	margin: 0;
	font-family: Verdana, Arial;
	font-size: 18px;
	font-weight: bold;
	color: #6699aa;
}

</style>
</head>

<body>

<?php

$language = 'pt-BR';
$language = 'en-US';
include('class.SDReport.php');

// report fully functional
$rpt = new SDReport(array("localhost", "root", "password", "database"));
$rpt->Title("Relatório geral de clientes");
$rpt->HeaderStyle("header");
$rpt->ShowHeader(1);
$rpt->FooterStyle("footer");
$rpt->ShowFooter(1);
$rpt->ItemStyle("item");
$rpt->TableWidth("100%");
$rpt->Columns(array("Nome", "Email", "Telefone"));
$rpt->Generate("SELECT NOME, EMAIL, TEL FROM CLIENTES ORDER BY NOME ASC");
$rpt->Show();

// introducing an error
$rpt2 = new SDReport(array("localhost", "root", "password", "database"));
$rpt2->Show();

?>

</body>
</html>
Return current item: SDReport