KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

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

Closed Sergio de Sousa opened this topic on 4 days ago - 3 comments

Sergio de Sousa commented 4 days ago

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 4 days ago

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

KoolReport commented 3 days ago

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 2 days ago

Excellent, problem solved. Thank you!

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

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
help needed

Excel