We have a column "code" which is logically a string but can be numerals mixed with letters - see datasource below.
When we export to Excel we have one code that is "35D" and when put into a Excel general column it becomes 35 (decimal). Other than this it seems fine although pure numerals align right and those interpreted as strings align left in Excel.
Any help is appreciated - details follow.
Data returned is correct - snipped for privacy
INFO ISCInit - Isomorphic SmartClient/SmartGWT Framework (v8.3p_2013-01-12/Enterprise Deployment 2013-01-12) - Initialization Complete
Call to Export code
Request code
Portion of the datasource
Grid code - tried added field type but it didn't help.
Request from the server console.
Request from the DEV console
When we export to Excel we have one code that is "35D" and when put into a Excel general column it becomes 35 (decimal). Other than this it seems fine although pure numerals align right and those interpreted as strings align left in Excel.
Any help is appreciated - details follow.
Data returned is correct - snipped for privacy
Code:
{ code:"35D", id:184, intermediateCer:"N", organization:"clip", description:"clip", longDescription:"clip" },
INFO ISCInit - Isomorphic SmartClient/SmartGWT Framework (v8.3p_2013-01-12/Enterprise Deployment 2013-01-12) - Initialization Complete
Call to Export code
Code:
exportToExcelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { ExcelExportDsRequest exportRequest = new ExcelExportDsRequest(exportFileName); //grid.exportClientData(exportRequest); grid.exportData(exportRequest); // lose grid formatting } });
Code:
public class ExcelExportDsRequest extends DSRequest { /** * Create a request suitable for client export * * @param exportFileName - base file name */ public ExcelExportDsRequest(String exportFileName) { this.setExportAs(ExportFormat.OOXML); // 2007 Excel format this.setTimeout(0); // do not timeout //this.setExportDisplay(ExportDisplay.DOWNLOAD); //this.setExportResults(true); // NEW not sure what this is for DateTimeFormat fmt = DateTimeFormat.getFormat("yyyy-MM-dd"); this.setExportFilename(exportFileName + "-" + fmt.format(new Date())); this.setExportDatesAsFormattedString(true); } }
Code:
<DataSource ID="Cer" serverType="generic" dropExtraFields="true" > <fields> <field name="id" type="integer" title="Id" hidden="true" primaryKey="true" /> <field name="code" type="text" title="CER Code" length="20" required="true"> <validators> <validator type="regexp" expression="^[A-Z0-9]{3}$" errorMessage="Please enter a valid 3 character CER code with only capital letters and numbers"/> </validators> </field> <field name="description" type="text" title="Title" required="true"/> <field name="longDescription" type="text" title="CER Description" required="true"/> <field name="organization" type="text" title="Organization" required="true"/> <field name="intermediateCer" type="text" title="Intermediate" required="true"/>
Code:
public class CerGrid extends BasicGrid { public CerGrid() { super("Cer"); this.setUseAllDataSourceFields(false); ListGridField id = new ListGridField("id"); id.setHidden(true); ListGridField code = new ListGridField("code"); code.setType(ListGridFieldType.TEXT); ListGridField organization = new ListGridField("organization"); ListGridField description = new ListGridField("description"); ListGridField longDescription = new ListGridField("longDescription"); ListGridField intermediateCer = new ListGridField("intermediateCer"); this.setFields(id, code, organization, description, longDescription, intermediateCer); } }
Code:
[face] 2013-01-15 13:03:20,130 DEBUG RPCManager - Request #1 (DSRequest) payload: { criteria:{ ratePackageId:1 }, operationConfig:{ dataSource:"Cer", operationType:"fetch", textMatchStyle:"substring" }, exportResults:true, exportAs:"ooxml", exportDelimiter:",", exportTitleSeparatorChar:"", exportFilename:"Cost Estimating Relationship-2013-01-15", exportDisplay:"download", lineBreakStyle:"default", exportFields:[ "code", "organization", "description", "longDescription", "intermediateCer" ], exportHeader:"Raytheon Proprietary", exportFieldTitles:{ code:"CER Code", organization:"Organization", description:"Title", longDescription:"CER Description", intermediateCer:"Intermediate" }, appID:"builtinApplication", operation:"Cer_fetch", oldValues:{ ratePackageId:1 } }
Code:
{ dataSource:"Cer", operationType:"fetch", data:{ ratePackageId:1 }, textMatchStyle:"substring", showPrompt:false, oldValues:{ ratePackageId:1 }, requestId:"Cer$62715", fallbackToEval:false, exportAs:"ooxml", timeout:0, exportFilename:"Cost Estimating Relationship-2013-01-15", exportDatesAsFormattedString:true, downloadResult:true, downloadToNewWindow:false, bypassCache:true }
Comment