number 17 character export excel become E+17

Questionsnumber 17 character export excel become E+17
Samsun Hidayat asked 4 years ago

Dear Abu,

I have field with varchar type and the contain is number like 1234567899907777776, the problem is when exported to excel the character become E+17. How to solve the problem?

Regards,

Samsun

1 Answers
Abu Ghufran Staff answered 4 years ago

You can set cell value type to string using phpexcel api. set $column, $rowno, $value.

$type = PHPExcel_Cell_DataType::TYPE_STRING;
$sheet->getCellByColumnAndRow($column, $rowno)->setValueExplicit($value, $type);

You can have this code in http://gridphp.com/demo/demos/export/export-phpexcel.phps line 55

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff replied 4 years ago

You can also check stackoverflow for phpexcel api usage and apply it in grid callback function.

Your Answer

3 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?