Data
array (
‘Invoicing’ => 1000.01,
‘TargetPricePerHour’ => 1000.01,
)
colmodel
array (
0 =>
array (
‘name’ => ‘Invoicing’,
‘label’ => ‘Laskutus’,
‘formatter’ =>
array (
‘decimalSeparator’ => ‘.’,
‘thousandsSeparator’ => ‘ ‘,
‘decimalPlaces’ => 2,
‘defaultValue’ => ‘0.00’,
),
‘align’ => ‘right’,
‘sorttype’ => ‘numeric’,
),
1 =>
array (
‘name’ => ‘TargetPricePerHour’,
‘label’ => ‘Tavoitehinta / h’,
‘formatter’ =>
array (
‘decimalSeparator’ => ‘.’,
‘thousandsSeparator’ => ‘ ‘,
‘decimalPlaces’ => 2,
‘defaultValue’ => ‘0.00’,
),
‘align’ => ‘right’,
‘sorttype’ => ‘numeric’,
)
Excel options
“file_type”=>”Excel2007”,
“font”=>”Arial”,
“font_size”=>10,
“path_to_phpexcel_class”=>”External/phpexcel/PHPExcel.php”
Code
|
1 2 3 |
$conn = new \jqGridArray(); $grid = new \jqGridRender($conn); |
|
1 2 3 |
$grid->setColModel($this->getColModel()); $grid->setExcelOptions([as mentioned above]); |
|
1 |
$grid->renderGrid('#grid', '#pager', true, null, null, true, true); |
Expecting
Excel with Invoicing and TargetPricePerHour cells to be number with 2 decimals and thousand separator space
Getting
Excel with Invoicing and TargetPricePerHour cells being general format
Hello,
we now have newest version 5.2.0 but we’re still having problems with exports as rapantti stated earlier.
Can you offer example how to work with number fields when exporting to Excel? Earlier Will wrote:
To fix this we have made a decision to set default number formatting (in excel options) and in case there is a need of custom one we will include a special excel formatting in formatoptions array for a particular field.
How is this done, we’ve tried setting formatter to number (which should affect to grid only) and that didn’t do any good.
Does header row somehow affect to column format, if header is text should that set the whole column to string and if so, how can that be changed
Thanks
Seppo
When will this be up to date?
Hello,
we have jqGrid PHP 5.0.0 version and our licence only covers minor updates. Sadly new version, in which this is fixed, is major update and therefore we don’t have access to it.
Isn’t this bug a kind of a bug that should be fixed to older versions too? Since this has been working before and you have decided to use 3rd party library which has this behavior. Now exports doesn’t look like they should and it reduces user experiance significantly.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top