KoolReport's Forum

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

Trying to export to pdf, giving error #273

Open saurabh opened this topic on on May 9, 2018 - 3 comments

saurabh commented on May 9, 2018

I have 3 files

  1. index.php
  2. SalesByCustomer.php
  3. 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.

KoolReport commented on May 9, 2018

Make sure that:

  1. You have the Export package installed
  2. In your report, you have use \koolreport\export\Exportable;
saurabh commented on May 9, 2018

we need to evaluate before we buy, please help. We are from sapphireprofits.com and if you want we can send a mail from our official mail so you can help us test for evaluation.

katia lagha commented on Jun 20, 2019

Export package isn't free?

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
help needed

None