Location: PHPKode > scripts > Report Generator > report-generator/example.php
$style  = "<style>";
$style .= ".grid {font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: #000000}"; 
$style .= "</style>"; 
echo $style;
$mireporte = new Reporte();

if (!($link=mysql_connect($host,$user,$pass))){ 
	echo "Error conectando a la base de datos.\n"; 
if (!mysql_select_db($db,$link)){
	echo "Error seleccionando la base de datos.\n"; 

/** Name of the report*/
$mireporte->set_reporte_nombre("Reporte de equipos");

/** Pass the link to the database */

/** Name of the central table  */

/** Fields that you want to show in the result report*/

/** Special Condition to retrieve data, if non leave it 1*/

/** Field to sort the output data in the report */
$mireporte->set_reporte_ordenar("alias ASC");

/** Colors of the title,headers,left frame,font */

/** Header for each fields of the table */
																			array("Serial","MAC","Firmware","Alias","Password","IP","Fecha Entrada","Accesorios","Modelo","Estado","Ubicaci&#243n","Propietario"));

/** Retrieve data from normalized data. Name of the field that references, name of the tabla that is referenced, primary key of that table, field of the table that you want to show, the way to sort the data */	$mireporte->normalizar_referencia("fk_modeloid","modelo","id","nombre","nombre ASC");
	$mireporte->normalizar_referencia("fk_estadoid","estadoequipo","id","nombre","nombre ASC");
	$mireporte->normalizar_referencia("fk_ubicacionid","empresa","id","nombre","nombre ASC");
	$mireporte->normalizar_referencia("fk_propietarioid","empresa","id","nombre","nombre ASC");
/** Check if submit is set. If it is show the result report, if not show the choices for the user. */
	echo $mireporte->get_reporte();
	echo $feedback = $mireporte->get_reporte_feedback(); 
	echo $mireporte->get_prereporte();
Return current item: Report Generator