Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
set up page
function setup()
{
$this->src("mydata")->query("SELECT b.SubcategoryName as subcatname,SUM(a.quantity) as quantity,SUM(a.totalamount+a.TaxAmount) as amt FROM `salesitems` as a LEFT JOIN product_subcategory as b ON b.SubCategoryId = a.ProductsubCategoryId AND a.Appcode= b.AppCode WHERE a.AppCode= '$appCode' $saledate GROUP BY a.ProductsubCategoryId ORDER BY quantity desc")->pipe($this->dataStore("data"));
}
view page
<?php
use \koolreport\drilldown\MultiView;
use \koolreport\processes\CopyColumn;
use \koolreport\processes\DateTimeFormat;
use \koolreport\widgets\google\LineChart;
use \koolreport\widgets\google\ColumnChart;
use \koolreport\widgets\koolphp\Table;
$outletArray = $this->dataStore('data'); // all products ?> <div class="row">
<div class="col-md-12">
<div class="tab-content px-1 pt-1">
<div role="tabpanel" class="tab-pane fade active in" id="available" aria-labelledby="StocksTab" aria-expanded="true">
<div class="table-responsive">
<?php
MultiView::create(array(
"name"=>"saleMultiView",
"dataSource"=>$this->dataStore('data'),
"title"=>"Sale By Month",
"views"=>array(
array(
"handler"=>"<i class='fa fa-line-chart'></i>",
"widget"=>array(LineChart::class,array(
"columns"=>array(
"subcatname"=>array(
"label"=>"Subcategory Name"
),
"quantity"=>array(
"label"=>"Order quantity"
)
),
))
),
array(
"handler"=>"<i class='fa fa-bar-chart'></i>",
"widget"=>array(ColumnChart::class,array(
"columns"=>array(
"subcatname"=>array(
"label"=>"Subcategory Name"
),
"quantity"=>array(
"label"=>"Order quantity"
)
),
))
),
array(
"handler"=>"<i class='fa fa-table'></i>",
"widget"=>array(Table::class,array(
"columns"=>array(
"subcatname"=>array(
"label"=>"Subcategory Name"
),
"quantity"=>array(
"label"=>"Order quantity"
),
"amt"=>array(
"label"=>"Total Amount"
)
),
"cssClass"=>array(
"table"=>"table table-striped table-bordered"
),
"options"=>array(
"paging"=>true,
"searching"=>true,
"order"=>array(
array(2,"desc")
),
"responsive" => array(
"details" => "function() {
$.fn.dataTable.Responsive.display.modal( {
header: function ( row ) {
var data = row.data();
return 'Details for '+data[0]+' '+data[1];
}
} )
}()",
"renderer" => "function() {
$.fn.dataTable.Responsive.renderer.tableAll( {
tableClass: 'table'
} )
}()",
)
),
))
),
)
));
?>
</div>
</div>
</div>
</div>
</div>
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo