Hi Isomorphic,
please see this modified testcase (v12.0p_2020-01-04).
If you hit "Export", the generated file has the problem that the "Empty column" has width zero, while you can see the column in the GUI and it also has autoFitWidthApproach: "both". IMHO there are two problems here:
For me (v12.0p_2019-12-14) it also happens for columns with data that they have no width. They all have setCellFormatter(), but this seems not to be the reason, as you can see in the sample where Nationhood and Area do have widths and use the SmartClient equivalent of above function, formatCellValue.
Do you have an other idea what might influence column width in the export here?
Thank you & Best regards
Blama
please see this modified testcase (v12.0p_2020-01-04).
If you hit "Export", the generated file has the problem that the "Empty column" has width zero, while you can see the column in the GUI and it also has autoFitWidthApproach: "both". IMHO there are two problems here:
- It would be good to see the column in Excel in order to know what column has no data.
- Also, there is a problem with the "˛" in "km˛" in the area column.
For me (v12.0p_2019-12-14) it also happens for columns with data that they have no width. They all have setCellFormatter(), but this seems not to be the reason, as you can see in the sample where Nationhood and Area do have widths and use the SmartClient equivalent of above function, formatCellValue.
Do you have an other idea what might influence column width in the export here?
Thank you & Best regards
Blama
Code:
isc.ListGrid.create({ ID: "countryList", width: 800, height: 250, top: 50, autoFitWidthApproach: "both", alternateRecordStyles: true, dataSource: worldDSExport, autoFetchData: true, fields: [{ name: "countryName", title: "Country" }, { name: "capital", title: "Capital" }, { name: "continent", title: "Continent" }, { name: "area", title: "Area", type: "number", formatCellValue: "isc.NumberUtil.format(value, ',0') + ' km²'" }, { name: "independence", title: "Nationhood", type: "date", width: "25%", formatCellValue: function(value) { if (isc.isA.Date(value)) { return (new Date().getYear() - value.getYear()) + " years ago"; } } }, { name: "emptycolumn", title: "Empty column" }, { name: "member_g8" }, { name: "population", type: "number", title: "Population", format: ",0" }, { name: "gdp", title: "GDP", type: "float", format: ",0.00" } ], showFilterEditor: true, headerSpans: [{ fields: ["countryName", "capital"], title: "Master data" }, { fields: ["area", "independence"], title: "Formatted with formatCellValue" }, { fields: ["population", "gdp"], title: "Formatted with format" } ] }); isc.Button.create({ ID: "exportButton", title: "Export", top: 10, click: function() { countryList.exportClientData({ exportAs: "ooxml", exportDisplay: "download", lineBreakStyle: "dos", exportDatesAsFormattedString: true }); } });
Comment