【问题标题】:Exporting Webi to Excel throws java.lang.NoClassFoundException :com.crystaldecisions.celib.trace.h将 Webi 导出到 Excel 会引发 java.lang.NoClassFoundException :com.crystaldecisions.celib.trace.h
【发布时间】:2023-03-09 11:02:01
【问题描述】:
我必须以 excel 格式导出 Webi 报告并显示给用户。目前的环境是 BOXI R3。
报告查询:
Select * from CI_INFOOBJECTS where SI_NAME ='xxxx' and si_kind ='Webi' and SI_PARENTID=xxxx
IInfoObjects webiDocs = infostore.query(reportQuery.toString);
IWebi webiDoc =IWebi webiDocs.get(o);
它在 infostore.query 上引发异常:
java.lang.NoClassFoundException :com.crystaldecisions.celib.trace.h
注意:BOXI R3 celib.jar 中不存在 h.class
【问题讨论】:
标签:
business-objects
business-objects-sdk
webi
【解决方案1】:
要打开 WebI 文档以获取数据,您需要遵循与您所走的路线不同的路线。尝试类似以下的操作:
// get your list of IInfoObjects
IInfoObjects webiDocs = infostore.query(reportQuery.toString);
// get a report engine to open the document
ReportEngines engines = (ReportEngines)enterpriseSession.getService("ReportEngines");
ReportEngine reportEngine = engines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
//Get the actual Doc instance
DocumentInstance docInstance = reportEngine.openDocument(webiDocs.get(0).getID());
// get the Raw data stream
BinaryView bv = (BinaryView)documentInstance.getView(OutputFormatType.CSV);
OutputStream outputStream; // defined else where to meet your needs
bv.getContent(outputStream);
我确实注意到从 IInfoObject 转换为您认为的具体内容通常不起作用。特定的子类似乎更多地用于库内部,而不是实际的外部可用类。