Hi,
Thanks for this great package, I can create many great widgets for my Reports. I'm implementing PDF Export but I'm not sure how to configure it to switch views Portrait to Landscape view, and add a Header and Footer. Here's my current code:
Panel::create()->header("Partners Completed Audits")->width(1/1)->sub([
Dropdown::create("exportOptions")
->title("<i class='far fa-file-pdf'></i> Export To PDF")
->items([
"Export All"=>MenuItem::create()
->onClick(
Client::showLoader().
Client::widget("PartnersCompletedAudits_All")->exportToPDF("Partners Completed Audits",["all"=>true])
),
])
->align("right")
->cssStyle("margin-bottom:5px;")
->cssClass("text-right"),
PartnersCompletedAudits_All::create()->lazyLoading(true),
]),
class PartnersCompletedAudits extends TablePartner {
protected function onCreated()
{
$this->pageSize(10);
$this->pdfExportable(true); //Turn on pdf exportable for table
}
protected function onExporting($params)
{
if($params["all"]===true) {
$this->pageSize(null);
$this->params($params);
}
return true;
}
public function exportedView()
{
return Html::div([
Html::h1("Partners Completed Audits")
])->class("text-center")->view().
$this->view();
}
protected function dataSource()
{
return PartnerHelper::getNumberPartnerAudits(2);
}
}