Get KoolPHP UI with 30% OFF!

Error on DS SQL Server

Carlos Eduardo
Hello all, how are you ?
I have this code:
     * 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);
    //   ->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;
    $field = new PivotSumField("CMV_PLANEJADO");
    $field->Text = "CMV Planejado";
    $field->DecimalNumber = 2;
    $field->DecimalPoint = ",";
    $field->ThousandSeperate = ".";
    $field->FormatString = "R$ {n}";
    $field = new PivotSumField("MARKDOWN");
    $field->Text = "Markdown";
    $field->DecimalNumber = 2;
    $field->DecimalPoint = ",";
    $field->ThousandSeperate = ".";
    $field->FormatString = "R$ {n}";
    $field = new PivotField("N3");
    $field->Text = "Nível 03 EM";
    $field = new PivotField("ANOMESFISCALINT");
    $field->Text = "Mês";
    $field->AllowReorder = true;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns="">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <?php echo $pivot->Render(); ?>

But im having problem with the datasource ... I have other PHP application working ok.
Posted Feb 24, 2019 Kool
Carlos Eduardo
Error Message:
Fatal error: Uncaught Error: Class 'SQLSVRPivotDataSource' not found in C:\Program Files\NetMake\v9\wwwroot\compass_pivot.php:11 Stack trace: #0 {main} thrown in C:\Program Files\NetMake\v9\wwwroot\compass_pivot.php on line 11
Posted Feb 24, 2019 Kool
Carlos Eduardo
Is the class SQLSVRPivotDataSource ok in koolphp ?
I took the example like this in the koolphp site code generator itself.
I changed the connection to the sql server and it was quiet, but it ran into this class.
I did not renew the signature koolreport because you have not released anything new. But I have koolreport signed until 2020.
If anyone can give a tip, I'll be grateful.
Thank you.

Posted Feb 24, 2019 Kool
Carlos Eduardo
Wow i had this erros in past hahahaha
this point is ok ... but ... now occur a new problem
Posted Feb 24, 2019 Kool
Anthony Amolochitis
Sometimes I would get datasource errors when I encountered an empty set in the select statement.
Maybe check that. I have the source code version of KoolPHP, so sometimes I'll fix the issue quickly, and submit the ticket to KoolPHP with my solution.
I'll ask them to double check it and add it to their updated version when they update it.
Anyways, when you get the error, check the sql results to see if it returns an empty set. That is likely the error with datasource.
If a class is not found, make sure you have the file. Otherwise submit a ticket to the guys at KoolPHP. They usually get it handled pretty quickly.
Let me know if I helped you out Carlos.
Take care
Posted Feb 25, 2019 Kool