...
如果导出清单表的Excel格式传递的type参数值是EXCEL2007,导出的文件中只有清单报表的第一页数据,需要把typee参数值改为LIST_EXCEL导出就可以解决。
2、如何判断报表是分组报表还是清单报表
...
2、如何判断电子表格的报表类型
在全模块的License环境,总共有分组报表、清单报表、Excel融合分析三种电子表格报表子类型
电子表格定义中有reportType属性,其对应关系如下表:
报表类型 | reportType值 |
---|---|
分组报表 | 0 |
清单报表 | 1 |
Excel融合分析 | 2 |
目前java api文档没有接口获取电子表格的报表类型,可以参考如下方法获取reportType的值从而获取报表类型:
代码块 | ||||||
---|---|---|---|---|---|---|
| ||||||
/** * 获取电子表格类型 */ public static int getSSReportType(){ ClientConnector connector = new ClientConnector("http://192.168.1.10:17300/smartbi"); boolean open = connector.open("admin", "admin"); String resId = "I4028818a015f906290629888015f9505e9ea4c2a"; //电子表格资源id if (open) { InvokeResult remoteInvoke = connector.remoteInvoke("SpreadsheetReportModule", "openQueryInPage", new Object[] {resId,null}); JSONObject originalResult = remoteInvoke.getOriginalResult(); JSONArray jsonArray = originalResult.getJSONArray("result"); JSONObject jsonObject = (JSONObject)jsonArray.get(0); JSONObject jsonObjectSet = jsonObject.getJSONObject("settings"); int reportType = jsonObjectSet.getInt("reportType"); if (reportType == 0) { System.out.println("分组报表"); } else if (reportType == 1) { System.out.println("清单报表"); } else if (reportType == 2) { System.out.println("Excel融合分析"); } return reportType; }else{ System.out.println("登录失败,无法获取报表类型"); return -1; } } |
...