Dear support team,
I need you help for the package Export a table to an Excel file. Allthough I've followed the example documentation for the Excel export, it's not possible to triggering the export!
My autorepchart.php
class autorepchart extends koolreport\KoolReport
{
use \koolreport\clients\FontAwesome; //für die Collapse + icons
use \koolreport\clients\Bootstrap;
use \koolreport\inputs\Bindable;
use \koolreport\inputs\POSTBinding;
use \koolreport\export\Exportable;
use \koolreport\excel\ExcelExportable;
My autorepchart.view.php
<script type="text/javascript">
function doExportExcel()
{
//alert(1);
var _form = document.getElementById("parameterForm");
_form.action = "exportexcel.php";
_form.submit();
_form.action = "index.php";
}
</script>
...
<div id="col1">
<h3> <img src="icon_barchart.png"/> Tabellarische Detailansicht</h3>
<div style="float:right"><button style="min-width:200px;" onclick="doExportExcel()" class="btn btn-primary">Export<br />Test</button></div>
<?php
Table::create(array(
"dataStore"=>$this->dataStore('AutoRepTabelle'),
"showFooter"=>"bottom",
"columns"=>array(
"WerbegruppeVerbund"=>array(
"label"=>"Werbegruppe",
),
"KdName"=>array(
"label"=>"Kundenname",
),
"Ort"=>array(
"label"=>"Kundenort",
),
"ArtBez"=>array(
"label"=>"Artikel",
),
"Verkaufsmenge"=>array(
"label"=>"Menge",
"footer"=>"sum",
"footerText"=>"<span style='font-size:150%;'><b>@value</b></span>",
"cssStyle"=>"text-align:right;font-weight:bold;font-size:100%;",
),
),
"removeDuplicate"=>array("WerbegruppeVerbund", "KdName", "Ort", "ArtBez"),
));
?>
</div>
My exportexcel.php
error_reporting(0);
require_once "autorepchart.php";
$report = new autorepchart;
$report->run()->exportToExcel()
->toBrowser("autorepchartexcel.xlsx");
If I click in the "Test export" button nothing happen! I trie to alert(1) to test whether the JavaScript is working or not: It works!
What could be the reason?
Kind regards,