Hello, I'm integrating my report class and view in an already existing project. I'm trying to export my report in pdf format using the same code I previously used in my index.php file (used for testing). The code is the following:
$report = new PdfPaging; //my report class
$report->run()
->cloudExport("PdfPagingPDF")
->chromeHeadlessio($myKey)
->pdf([
"displayHeaderFooter" => true,
"headerTemplate" => "<div class='page-header'></div>",
"footerTemplate" => "<div class='page-footer'></div>",
"format" => "A4",
"margin" => [
'top'=> '50px',
'right'=> '20px',
'bottom'=> '20px',
'left'=>'20px'
]
])
->toBrowser("myreport.pdf");
When I ran this piece of code in index.php it worked just fine. However, I'm trying to run it in another file, where I do other stuff prior to running the report part. It doesn't work and my page remains stalled, looping for a long time until it reaches a timeout. What could be the reason? Thank you!