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 :)