KoolReport's Forum

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

Export to excel simply does not work at all, no data #1081

Closed Sergio de Sousa opened this topic on on Sep 11, 2019 - 3 comments

Sergio de Sousa commented on Sep 11, 2019

I get absolutely no data when exporting the simplest table:

Table::create(array(
                    "dataSource"=>$this->dataStore('demographics'),
                    
                ));

My setup() is like this:

public function setup() {

    	$query0 = "select * from ".$this->db_prefix."_POSTALS";

        $this->src('database')
        ->query("select * from ".$this->db_prefix."_POSTALS")
        ->pipe($this->dataStore('demographics'));

    }

The db_prefix is set in constructor, like this:

    function __construct($init_prefix) {

        $this->db_prefix = $init_prefix;

    }

Can you please help? Thank you

Sergio de Sousa commented on Sep 12, 2019

I am new with KoolReport, how can I get support, what's the right way to contact for support? Thank you.

KoolReport commented on Sep 12, 2019

Hi Sergio,

Could you please show me the export to excel part?

Also, don't overwrite the __constructor() method.

You can do:

$report = new MyReport([
    "db_prefix"=>"tbl"
]);

and then in the setup() function you can do:

$query0 = "select * from ".$this->params["db_prefix"]."_POSTALS";
Sergio de Sousa commented on Sep 13, 2019

Excellent, problem solved. Thank you!

I also have another question but I'll post it separately. Thank you again.

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

Excel