KoolReport's Forum

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

How to hide export button on exported pdf or jpg ? #390

Open Anita opened this topic on on Jul 24, 2018 - 2 comments

Anita commented on Jul 24, 2018

Dear Support,

I would like to hide the export button on the exported pdf or jpg. Would you have any tips how to do it ? Many thanks,

KoolReport commented on Jul 25, 2018

Hi Anita,

There are two ways:

  1. You may have separate view file for pdf export, for example MyReportPDF.view.php like we do in our example. The view file that use to export to PDF will not contain button. I personally prefer this way.
  2. You can use parameters. Set a report parameter name "exportMode" that received boolean value. If the "exportMode" is true then you hide the Export button. You can access this parameter through $this->params["exportMode"] in the view file. With this way, the export function of your will look like this:
$report = new MyReport(array(
    "exportMode"=>true,
));

$report->run()->export()->pdf()->toBrowser("myreport.pdf");
Anita commented on Jul 25, 2018

Thank you very much, it works.

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

Export