I have this code:
<?php
/*
* Please put this file in the same folder with KoolControls folder
* or you may modify path of require and scriptFolder to refer correctly
* to koolpivottable.php and its folder.
*/
require "kphp/KoolControls/KoolPivotTable/koolpivottable.php";
$dbcon = sqlsrv_connect('localhost', array( 'Database'=>'IOCP', 'UID'=>'sa', 'PWD'=>'Guardian*01'));
$ds = new SQLSVRPivotDataSource($dbcon);
$ds->select("ANOFISCAL, ANOMESFISCALINT, N3, CMV_PLANEJADO, MARKDOWN, CMV_REALIZADO, ESTOQUE_FINAL_CUSTO_PLANEJADO, ESTOQUE_DISPONIVEL_CUSTO, ESTOQUE_RECEBIMENTOS_CUSTO, ESTOQUE_TOTAL_DISPO_CUSTO, OTB_PROX_PERIODO, PEDIDOS_CONSUMO, OTB_DISPO ")
->from("otb_inseason");
// ->selectCommand("SELECT * FROM otb_inseason");
$pivot = new KoolPivotTable("pivot");
$pivot->scriptFolder = "KoolControls/KoolPivotTable";
$pivot->DataSource = $ds;
$pivot->Pager = PivotPrevNextAndNumericPager();
$pivot->AllowCaching = true;
$pivot->ExportSettings->IgnorePaging = true;
$pivot->ExportSettings->config(array(
"fileName"=>"CompassExport",));
$field = new PivotSumField("CMV_PLANEJADO");
$field->Text = "CMV Planejado";
$field->DecimalNumber = 2;
$field->DecimalPoint = ",";
$field->ThousandSeperate = ".";
$field->FormatString = "R$ {n}";
$pivot->AddDataField($field);
$field = new PivotSumField("MARKDOWN");
$field->Text = "Markdown";
$field->DecimalNumber = 2;
$field->DecimalPoint = ",";
$field->ThousandSeperate = ".";
$field->FormatString = "R$ {n}";
$pivot->AddDataField($field);
$field = new PivotField("N3");
$field->Text = "Nível 03 EM";
$pivot->AddRowField($field);
$field = new PivotField("ANOMESFISCALINT");
$field->Text = "Mês";
$field->AllowReorder = true;
$pivot->AddColumnField($field);
$pivot->Process();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>KoolPivotTable</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
<?php echo $pivot->Render(); ?>
</body>
</html>
But im having problem with the datasource ... I have other PHP application working ok.
Tks