Custom Export

QuestionsCustom Export
german asked 5 years ago

Numeric values are exported with single quote in excel.How to export the numeric values as it is

5 Answers
Abu Ghufran Staff answered 5 years ago

Hello,

You can use custom export code and format your columns as required using phpexcel api.

https://www.phpgrid.org/demo/demos/export/export-phpexcel.phps (line 72)

PHPExcel docs are located here.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
german answered 5 years ago

I have tried this also sir.i could not use custom query inside the phpexcel.the db2query could not placed inside.

Abu Ghufran Staff answered 5 years ago

You need to either connect database again inside function OR use some global variables to be accessible inside function.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
german answered 5 years ago

i get the code for export

<Workbook xmlns=”urn:schemas-microsoft-com:office:spreadsheet” xmlns:x=”urn:schemas-microsoft-com:office:excel” xmlns:ss=”urn:schemas-microsoft-com:office:spreadsheet” xmlns:html=”http://www.w3.org/TR/REC-html40″&gt;

<Styles>

<Style ss:ID=”sDT”><NumberFormat ss:Format=”Short Date”/></Style>

</Styles>

<Worksheet ss:Name=”Sheet1″>

<Table>

<Row>

<Cell><Data ss:Type=”String”>Id</Data></Cell>

<Cell><Data ss:Type=”String”>Route Code</Data></Cell>

<Cell><Data ss:Type=”String”>Route Name</Data></Cell>

<Cell><Data ss:Type=”String”>State Name </Data></Cell>

<Cell><Data ss:Type=”String”>District Name </Data></Cell>

<Cell><Data ss:Type=”String”>Area Name </Data></Cell>

<Cell><Data ss:Type=”String”>ASO1 Name</Data></Cell>

Abu Ghufran Staff answered 5 years ago

Check following:

  • Make sure there is no new line or blank character at start / end of file.
  • Check for BOM character using notepad++
  • Make sure you have php’s zlib extension installed.
  • If still does not work, you can still use old excel export lib and for that rename ‘PHPExcel’ folder in <phpgrid>/lib/inc/excel/ with ‘_PHPExcel’
_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

6 + 18 =

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?