KoolReport's Forum

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

Convert decimal when export excel #485

Open Hoang Nguyen opened this topic on on Oct 2, 2018 - 2 comments

Hoang Nguyen commented on Oct 2, 2018

Now, I have an issue about export excel. In my Query have a column with data type is decimal, when I export excel one, then, it had been converted data type is INT? How to let me transfer it?

Thanks

David Winterburn commented on Oct 2, 2018

Hi Hoang,

Before you save the data to a datastore, please set the decimal number column's meta info like this:

use \koolreport\processes\ColumnMeta;

...
  ->pipe(new ColumnMeta(array(
  		"column1"=>array(
  			"type" => "number",
			"decimals" => 2,
			"thousand_sep" => ",",
			"dec_point" => ".",
			"prefix" => "",
			"suffix" => "",
  		),
  )))
  ->pipe($this->dataStore('dataStore1'));

This should help the excel export process format column1 to a decimal number. Please let us know if there's still any problem. Thanks!

Hoang Nguyen commented on Oct 3, 2018

Hi David Winterburn, That be great thanks a lot

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
solved

Excel