I have 3 files
- index.php
- SalesByCustomer.php
- SalesByCustomer.view.php
The report fetches data from db and renders on browser, but i wanted to export it to pdf, for that i did the below coding in my index.php
My index.php code
<?php
// index.php
//require "MyPage.php";
//$mypage = new MyPage;
//$mypage->export()
//->pdf(array(
// "format"=>"A4",
// "orientation"=>"portrait"
//))
//->toBrowser("mypage.pdf");
require_once "SalesByCustomer.php";
$salesByCustomer = new SalesByCustomer;
// for pdf start
$salesByCustomer->export()
->pdf(array(
"format"=>"A4",
"orientation"=>"portrait"
))
->toBrowser("salesByCustomer.pdf");
// for pdf end
// to open in browser
//$salesByCustomer->run()->render();
Error i am facing is - Fatal error: Call to undefined method SalesByCustomer::export() in C:\xampp\htdocs\reports\report1\index.php on line 19
In short, below line is not working
$salesByCustomer->export()->pdf(array("format"=>"A4","orientation"=>"portrait"))->toBrowser("salesByCustomer.pdf");
but $salesByCustomer->run()->render();
is working, Please help
Before buying the pro version, we need to evaluate the result with around 15000 rows. Because the result is not upto the mark with tcpdf.