Hi,
i'm doing a listgrid excel export (ooxml) with "exportClientData" (see code below), but there's an issue with the columns, they all get the type "general" when opened in Excel. Date columns for example, becomes just a bunch of numbers, you have to go in manually on each column and set it right, really annoying.
The reason for doing exportclientdata is to 1. avoid costly db queries and 2. preserve client-side Nordic formatting of fields.
I looked but didn't find any way to tell the excel export what column types i want in the exported file.
Happy for pointers!
EDIT: I checked other threads and saw that you in one wrote:
this is not my experience, all become "general" data type, regardless of what i have in the datasource XML.
export code:
i'm doing a listgrid excel export (ooxml) with "exportClientData" (see code below), but there's an issue with the columns, they all get the type "general" when opened in Excel. Date columns for example, becomes just a bunch of numbers, you have to go in manually on each column and set it right, really annoying.
The reason for doing exportclientdata is to 1. avoid costly db queries and 2. preserve client-side Nordic formatting of fields.
I looked but didn't find any way to tell the excel export what column types i want in the exported file.
Happy for pointers!
EDIT: I checked other threads and saw that you in one wrote:
If you use a DataSource where you have declared the field type as a number type (eg "integer") then it will be exported to Excel as a number.
export code:
Code:
DSRequest dsRequestProperties = new DSRequest(); dsRequestProperties.setExportAs(ExportFormat.OOXML); dsRequestProperties.setExportDisplay(ExportDisplay.DOWNLOAD); dsRequestProperties.setAttribute("exportFilename", getFileName()); dsRequestProperties.setExportFields(reportFields); dsRequestProperties.setExportDelimiter(";"); reportGrid.exportClientData(dsRequestProperties);
Comment