KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

PivotTable Export to Pdf Rendering the view but not working #2926

Open daniel chandra opened this topic on on Jan 4, 2023 - 3 comments

daniel chandra commented on Jan 4, 2023

Hi, i've tried to download the pivot table to pdf but it's not working (it's working fine on rendering to view or export to xls), but on export to pdf, it just rendering the table (screenshot below)

My export code :

$report = new CustomReportPivot([
                'data' => $result['data'],
                'setting' => [
                    "column" => "Gender, Marital Status",
                    "row" => "Job Position, Job Level",
                    "count" => "Employee ID",
                    'sum' => '',
                ]
            ]);


            
            $report->run();
            $report->export()->pdf(array(
                                "format"=>"A4",
                                "orientation"=>"landscape",
                            )
            )->toBrowser('test.pdf', true);
Sebastian Morales commented on Jan 4, 2023

I think the export command missed the pdf view name:

            $report->export()->...

It should be:

            $report->export("CustomReportPivotPDF")->... //add pdf view name in export(), make sure there's a file called "CustomReportPivotPDF.view.php" exactly
daniel chandra commented on Jan 4, 2023

I'm using koolreport on yii2 framework, where should I put the view file?

Sebastian Morales commented on Jan 5, 2023

The PDF view file should be in the same place as your report view file.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None