Open PDF after rendering
Open PDF after rendering
I have this code in my index.php
$report->loadFile($t);
$report->render();
$report->exportDocument(StiExportFormat::Pdf);
$report->printHtml();
It export my report to pdf, and the user can click on the upper right of the screen to open it.
Is it possible to create the pdf and then open it without the user having to click to open?
Alan
$report->loadFile($t);
$report->render();
$report->exportDocument(StiExportFormat::Pdf);
$report->printHtml();
It export my report to pdf, and the user can click on the upper right of the screen to open it.
Is it possible to create the pdf and then open it without the user having to click to open?
Alan
-
- Posts: 7122
- Joined: Tue Mar 20, 2018 5:34 am
Re: Open PDF after rendering
Hello,
You can set the Open After Export option:
$report->exportDocument(StiExportFormat::Pdf, null, true);
Thank you.
You can set the Open After Export option:
$report->exportDocument(StiExportFormat::Pdf, null, true);
Thank you.
Re: Open PDF after rendering
Thank you.
Worked perfectly.
Alan
Worked perfectly.
Alan
-
- Posts: 7122
- Joined: Tue Mar 20, 2018 5:34 am
Re: Open PDF after rendering
Hello Alan,
You are welcome.
You are welcome.
Re: Open PDF after rendering
When I do this the pdf opens in a tab on the browser, but the index.php tab also stays open. Can that be automatically closed, or have the pdf open in the index.php tab?
Thanks
Alan
Thanks
Alan
-
- Posts: 7122
- Joined: Tue Mar 20, 2018 5:34 am
Re: Open PDF after rendering
Hello Alan,
Unfortunately, it is not possible.
Thank you.
Unfortunately, it is not possible.
Thank you.