Author Topic: Export to Excel is converting all numbers to text format  (Read 4380 times)

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Export to Excel is converting all numbers to text format
« on: December 23, 2015, 02:28:10 am »
I'm finding that all my table data is being exported to excel as "String" type in the xml file...

    <Cell><Data ss:Type="String">980</Data></Cell>

I'd like columns like this one...

    { title: "Total", cls: 'bold_column', minWidth: 75, dataIndx: "total", dataType: "integer", align:"center", editable: false},

...to export as a number type for Excel.  I thought that the dataType parameter would do it but it didn't change the export.  Have I overlooked something?

Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6173
    • View Profile
Re: Export to Excel is converting all numbers to text format
« Reply #1 on: December 23, 2015, 12:51:51 pm »
Currently all the data is exported as a string, more options ( including export of number datatypes ) and functionality has been added in the upcoming version.

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: Export to Excel is converting all numbers to text format
« Reply #2 on: December 23, 2015, 03:49:01 pm »
Ok.  Thanks for the confirmation.  Do you have a target release date for the updated version?  And as I'm still new to using your fantastic grids will I have to download an updated version or should my files link to external js updates?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6173
    • View Profile
Re: Export to Excel is converting all numbers to text format
« Reply #3 on: December 23, 2015, 08:20:40 pm »
ETA is approx middle of Jan 2016. It would be downloadable from your account.

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: Export to Excel is converting all numbers to text format
« Reply #4 on: December 24, 2015, 07:41:15 pm »
Ok.  Many thanks as always.

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: Export to Excel is converting all numbers to text format
« Reply #5 on: November 08, 2017, 01:02:08 am »
Can you please confirm whether any of the versions of ParamQuery Grid have the option to export numbers yet, or is it still only possible to export as String?  Having read through some of the updates I wondered if exportRender was the thing but it's not helping for me.  Many thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6173
    • View Profile
Re: Export to Excel is converting all numbers to text format
« Reply #6 on: November 08, 2017, 05:28:27 pm »
In version 4.x, numbers are exported as numbers and dates as dates in most cases. It falls back to string when the desired output is not achievable by applying formatting to numbers.

Please compare the exported files from v3.x and v4.x

https://paramquery.com/pro/demos33/export

https://paramquery.com/pro/demos/export

Moreover export in v4 is 2 step process.

1. Export of grid to javascript workbook

2. Export of js workbook to Excel xlsx.

Any customization to spreadsheet which is not achievable by configuration options and parameters to exportData() method alone can be done by imperatively modifying the javascript workbook.
« Last Edit: November 08, 2017, 08:15:16 pm by paramquery »

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: Export to Excel is converting all numbers to text format
« Reply #7 on: November 15, 2017, 05:34:19 pm »
Thanks, that's great.  I'll upgrade my software again soon...I'm still on v3.4.1