isc Version: v12.0p_2019-08-11/Enterprise Deployment
GWT Version: 2.7.0
Browser: Chrome 76.0.3809.100 (Official Build) (64-bit
OS: Windows 10
SuperDevMode
Hi, I am running into an error exporting a ListGrid to Excel when the grid contains fields that are too long to fit in an Excel cell (the max length in Excel is 32,767 characters). The export does not outright fail or display an error, but the exported file is an unformatted, incomplete result set that ends at the problematic cell. Below are the steps to reproduce my issue in the built-in-ds sample project.
Setup Steps
1. Modify /war/WEB-INF/db/hsqldb/isomorphic.script
In the animals table declaration on line 71, replace "INFORMATION VARCHAR(1000)" with "INFORMATION VARCHAR(50000)"
2. Modify /war/ds/animals.ds.xml
In the information field definition on line 22, set length="50000"
3. Modify /src/com/smartgwt/sample/client/BuiltInDS.java
Add an export button to the form at line 171
Test Steps
1. Start the server and select the Animals DataSource
2. Edit the Alligator record and set "Interesting Facts" to a string longer than 32767 characters.
3. Save the animal record.
4. Click export.
Results
The file is exported, but only contains one row (everything up to the Interesting Facts cell)
A stack trace is displayed in the server console:
I know the data being exported is incompatible and so the export should fail in some way, but I am not sure if this particular outcome is expected or not. Or is there something I should be doing in the export request itself (maybe in the requestProperties) to ensure the offending data is truncated or excluded?
Thanks!
GWT Version: 2.7.0
Browser: Chrome 76.0.3809.100 (Official Build) (64-bit
OS: Windows 10
SuperDevMode
Hi, I am running into an error exporting a ListGrid to Excel when the grid contains fields that are too long to fit in an Excel cell (the max length in Excel is 32,767 characters). The export does not outright fail or display an error, but the exported file is an unformatted, incomplete result set that ends at the problematic cell. Below are the steps to reproduce my issue in the built-in-ds sample project.
Setup Steps
1. Modify /war/WEB-INF/db/hsqldb/isomorphic.script
In the animals table declaration on line 71, replace "INFORMATION VARCHAR(1000)" with "INFORMATION VARCHAR(50000)"
2. Modify /war/ds/animals.ds.xml
In the information field definition on line 22, set length="50000"
3. Modify /src/com/smartgwt/sample/client/BuiltInDS.java
Add an export button to the form at line 171
Code:
IButton exportBtn = new IButton("Export"); exportBtn.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { DSRequest requestProperties = new DSRequest(); requestProperties.setExportAs(ExportFormat.OOXML); boundList.exportClientData(requestProperties); } }); hLayout.addMember(exportBtn);
1. Start the server and select the Animals DataSource
2. Edit the Alligator record and set "Interesting Facts" to a string longer than 32767 characters.
3. Save the animal record.
4. Click export.
Results
The file is exported, but only contains one row (everything up to the Interesting Facts cell)
A stack trace is displayed in the server console:
Code:
java.lang.IllegalArgumentException: The maximum length of cell contents (text) is 32,767 characters at org.apache.poi.xssf.streaming.SXSSFCell.setCellValue(SXSSFCell.java:325) at com.isomorphic.rpc.ExcelDataExport.getExportObject(ExcelDataExport.java:877) at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:642) at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:452) at com.isomorphic.rpc.BuiltinRPC.downloadClientExport(BuiltinRPC.java:1139) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ...
Thanks!
Comment