PROBLEM: The Basic CubeGrid example with added export to excel example produces an excel download file that's empty. "Sheet0" has all it's cells empty.
Be sure your post includes:
1. SmartgwtEE-5.0d: SNAPSHOT_v10.0d_2014-04-27/Enterprise Deployment 2014-04-27
2. Firefox and tomcat server
The example is from the sample in smartgwtee-5.0d:
Here is a snippet of the logs regarding the excel download:
Be sure your post includes:
1. SmartgwtEE-5.0d: SNAPSHOT_v10.0d_2014-04-27/Enterprise Deployment 2014-04-27
2. Firefox and tomcat server
The example is from the sample in smartgwtee-5.0d:
Code:
final CubeGrid cubeGrid = new CubeGrid();
//in order to enable charting, the Drawing module must be present
if(SC.hasDrawing()) {
cubeGrid.setEnableCharting(true);
}
cubeGrid.setData(ProductRevenueData.getData());
cubeGrid.setWidth100();
cubeGrid.setHeight100();
cubeGrid.setHideEmptyFacetValues(true);
cubeGrid.setShowCellContextMenus(true);
final NumberFormat numberFormat = NumberFormat.getFormat("0,000");
cubeGrid.setCellFormatter(new CellFormatter() {
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
if (value == null) return null;
try {
return numberFormat.format(((Number) value).longValue());
} catch (Exception e) {
return value.toString();
}
}
});
cubeGrid.setColumnFacets("quarter", "month", "metric");
cubeGrid.setRowFacets("region", "product");
Button exportButton = new Button("Export");
exportButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
DSRequest dsRequestProperties = new DSRequest();
dsRequestProperties.setExportAs(ExportFormat.XLS);
dsRequestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
cubeGrid.exportClientData(dsRequestProperties);
}
});
VLayout layout = new VLayout();
layout.setWidth100();
layout.setHeight100();
layout.addMember(exportButton);
layout.addMember(cubeGrid);
layout.draw();
Code:
=== 2014-04-30 16:57:05,178 [ec-6] DEBUG RPCManager - Processing 1 requests.
=== 2014-04-30 16:57:05,179 [ec-6] DEBUG RPCManager - Request #1 (RPCRequest) data: {
appID:"isc_builtin",
className:"builtin",
methodName:"downloadClientExport",
arguments:[
[
{
region:"Western U.S.\r\n\r\n",
product:"Pens\r\nChairs\r\nMonitors",
"Q1, 2002 - January - Revenue":"10,000\r\n50,000\r\n120,000",
"Q1, 2002 - January - Profit":"2,000\r\n5,000\r\n44,000",
"Q1, 2002 - February - Revenue":"12,000\r\n42,000\r\n160,000",
"Q1, 2002 - February - Profit":"4,000\r\n\r\n68,000",
"Q1, 2002 - March - Revenue":"18,000\r\n25,000\r\n220,000",
"Q1, 2002 - March - Profit":"9,000\r\n2,000\r\n112,000"
},
{
region:"Midwest U.S.\r\n\r\n",
product:"Pens\r\nChairs\r\nMonitors",
"Q1, 2002 - January - Revenue":"8,000\r\n22,000\r\n20,000",
"Q1, 2002 - January - Profit":"2,000\r\n\r\n5,000",
"Q1, 2002 - February - Revenue":"10,000\r\n12,000\r\n75,000",
"Q1, 2002 - February - Profit":"3,000\r\n1,000\r\n32,000",
"Q1, 2002 - March - Revenue":"7,000\r\n6,000\r\n135,000",
"Q1, 2002 - March - Profit":"2,000\r\n1,000\r\n66,000"
},
{
region:"Eastern U.S.\r\n\r\n",
product:"Pens\r\nChairs\r\nMonitors",
"Q1, 2002 - January - Revenue":"22,000\r\n40,000\r\n105,000",
"Q1, 2002 - January - Profit":"4,000\r\n\r\n25,000",
"Q1, 2002 - February - Revenue":"31,000\r\n35,000\r\n164,000",
"Q1, 2002 - February - Profit":"8,000\r\n4,000\r\n88,000",
"Q1, 2002 - March - Revenue":"44,000\r\n15,000\r\n190,000",
"Q1, 2002 - March - Profit":"20,000\r\n2,000\r\n115,000"
}
],
"xls",
"export",
"download",
{
exportAs:"xls",
exportFilename:"export",
exportRawValues:false,
exportCurrencySymbol:"$",
exportFields:[
],
exportOtherFields:{
}
}
],
is_ISC_RPC_DMI:true
}
=== 2014-04-30 16:57:05,179 [ec-6] INFO IDACall - Performing 1 operation(s)
=== 2014-04-30 16:57:05,182 [ec-6] DEBUG RPCDMI - appConfig: isc.Application.create({
rpcBindings:[
{
ID:"builtin",
className:"com.isomorphic.rpc.BuiltinRPC",
visibleMethods:[
{
name:"downloadWSDL"
},
{
name:"downloadClientContent"
},
{
name:"downloadClientExport"
},
{
name:"xmlToJS"
},
{
name:"uploadProgressCheck"
},
{
name:"saveFile"
},
{
name:"appendToFile"
},
{
name:"loadFile"
},
{
name:"deleteFile"
},
{
name:"loadSharedXML"
},
{
name:"saveSharedXML"
},
{
name:"getAvailableScriptEngines"
},
{
name:"devConsoleEvalServerScript"
},
{
name:"evalJava"
},
{
name:"getLogNames"
},
{
name:"getLogEntries"
},
{
name:"clearLogEntries"
},
{
name:"getLogThresholds"
},
{
name:"setLogThreshold"
},
{
name:"setTemporaryLogThreshold"
},
{
name:"revertTemporaryLogThresholds"
},
{
name:"getPdfObject"
},
{
name:"exportImage"
},
{
name:"areServerTimingsTracked"
},
{
name:"trackServerTimings"
}
]
},
{
ID:"builtin_tools",
className:"com.isomorphic.tools.BuiltinRPC",
visibleMethods:[
{
name:"getDataSourceFromTable"
},
{
name:"getDataSourceJSONFromTable"
},
{
name:"getDataSourceFromHibernateMapping"
},
{
name:"getDataSourceJSONFromHibernateMapping"
},
{
name:"getTables"
},
{
name:"getFieldsFromTable"
},
{
name:"getBeanFields"
},
{
name:"getHibernateBeans"
},
{
name:"getDatabaseProductNameAndVersion"
},
{
name:"getDatabaseTableTypes"
},
{
name:"setAttributes"
},
{
name:"clearAttributes"
},
{
name:"getAttributes"
},
{
name:"getAttribute"
},
{
name:"getDataSourceConfigFromJavaClass"
},
{
args:"cName",
language:"groovy",
name:"getJavaSource",
script:"\n if (!com.isomorphic.auth.DevModeAuthFilter.devModeAuthorized(request)) throw new Exception(\"Not Authorized\"); \n //import org.apache.bcel.Repository;\n\n try {\n return org.apache.bcel.Repository.lookupClass(cName).toString();\n } catch (Throwable e) {\n return \"Unable to reverse engineer class \"+cName+\": \"+e.getMessage();\n }\n "
},
{
name:"loadDataSource"
},
{
name:"dsFromXML"
},
{
name:"dsConfigFromXML"
},
{
name:"getDefinedDataSources"
}
]
},
{
ID:"builtin_adminconsole",
className:"com.isomorphic.tools.AdminConsole",
visibleMethods:[
{
name:"getDefinedDatabases"
},
{
name:"testDB"
},
{
name:"saveDBConfig"
},
{
name:"setDefaultDB"
},
{
name:"importDataSources"
},
{
name:"discoverJNDIDatabases"
}
]
}
]
})
=== 2014-04-30 16:57:05,184 [ec-6] INFO BuiltinRPC - Export data passed to server:
[
{
region:"Western U.S.\r\n\r\n",
product:"Pens\r\nChairs\r\nMonitors",
"Q1, 2002 - January - Revenue":"10,000\r\n50,000\r\n120,000",
"Q1, 2002 - January - Profit":"2,000\r\n5,000\r\n44,000",
"Q1, 2002 - February - Revenue":"12,000\r\n42,000\r\n160,000",
"Q1, 2002 - February - Profit":"4,000\r\n\r\n68,000",
"Q1, 2002 - March - Revenue":"18,000\r\n25,000\r\n220,000",
"Q1, 2002 - March - Profit":"9,000\r\n2,000\r\n112,000"
},
{
region:"Midwest U.S.\r\n\r\n",
product:"Pens\r\nChairs\r\nMonitors",
"Q1, 2002 - January - Revenue":"8,000\r\n22,000\r\n20,000",
"Q1, 2002 - January - Profit":"2,000\r\n\r\n5,000",
"Q1, 2002 - February - Revenue":"10,000\r\n12,000\r\n75,000",
"Q1, 2002 - February - Profit":"3,000\r\n1,000\r\n32,000",
"Q1, 2002 - March - Revenue":"7,000\r\n6,000\r\n135,000",
"Q1, 2002 - March - Profit":"2,000\r\n1,000\r\n66,000"
},
{
region:"Eastern U.S.\r\n\r\n",
product:"Pens\r\nChairs\r\nMonitors",
"Q1, 2002 - January - Revenue":"22,000\r\n40,000\r\n105,000",
"Q1, 2002 - January - Profit":"4,000\r\n\r\n25,000",
"Q1, 2002 - February - Revenue":"31,000\r\n35,000\r\n164,000",
"Q1, 2002 - February - Profit":"8,000\r\n4,000\r\n88,000",
"Q1, 2002 - March - Revenue":"44,000\r\n15,000\r\n190,000",
"Q1, 2002 - March - Profit":"20,000\r\n2,000\r\n115,000"
}
]
=== 2014-04-30 16:57:05,184 [ec-6] INFO ProxyHttpServletResponse - content-disposition set to: attachment; fileName=export.xls - unwrapping response output stream (CompressionFilter)
=== 2014-04-30 16:57:05,185 [ec-6] INFO BuiltinRPC - Generating and streaming xls file...
=== 2014-04-30 16:57:05,187 [ec-6] DEBUG RPCDMI - rpc returned data
Comment