Get KoolPHP UI with 30% OFF!

Export of XLS and PDF Issue

Shaun
Hey guys
When exporting to PDF or XLS with large datasets (20000 records) the page refreshes to blank and the file does not prompt to download . However CSV works correctly.
Heres the javascript I use to submit the post as I dont want to use submit buttons.
<ul class="dropdown-menu">
      <li><a href="#" onclick="handler('CSV');event.preventDefault();"><i class="fa fa-file-code-o fa-fw"></i> CSV</a></li>
      <li><a href="#" onclick="handler('EXCEL');event.preventDefault();"><i class="fa fa-file-excel-o fa-fw"></i> Excel</a></li>
      <li><a href="#" onclick="handler('PDF');event.preventDefault();"><i class="fa fa-file-pdf-o fa-fw"></i> PDF</a></li>
    </ul>
  </div>
 </div>   
 </div>
<input type="hidden" id="theParam" value="1"/>
<script>
    function handler(var1) {
        document.feedbackfrm.theParam.name = var1;
        document.feedbackfrm.submit();
     }
</script>

Heres the PHP
if(isset($_POST["EXCEL"]))
{
    ob_end_clean();
    $grid->ExportSettings->IgnorePaging = true;
    $grid->GetInstanceMasterTable()->ExporttoExcel();
}	
if(isset($_POST["PDF"]))
{
    ob_end_clean();
    $grid->ExportSettings->IgnorePaging = true;
    $grid->GetInstanceMasterTable()->ExportToPDF();
}	
if(isset($_POST["CSV"]))
{
    ob_end_clean();
    $grid->ExportSettings->IgnorePaging = true;
    $grid->GetInstanceMasterTable()->ExportToCSV();
}

Thanks for all your help :)
Posted Sep 4, 2015 , edited Sep 4, 2015 Kool
David
Hi Shaun,
PHP has a default 256 MB memory which is really not enough for holding 20.000 records in memory for exporting. I suggest you increase both PHP memory and its processing time to increase the number of exporting records. Though I think we will have to improve the exporting method as well as data source class to reach 20.000 records. Thanks for your feedback!
Rgds,
Posted Sep 5, 2015 Kool
Shaun
Thanks David, Ill read up on adjusting PHP memory and processing time.
I'm busy working on a Call Detail Record browser so the number of records to export can get pretty big. 20000 is not really that much in that regard. For now I'll just set CSV exporting on.
Posted Sep 5, 2015 Kool