在导出Webi到Excel的过程中,出现了java.lang.NoClassFoundException :com.crystaldecisions.celib.trace.h。

问题描述 投票:1回答:1

我必须将Webi报表导出为excel格式并显示给用户。

ReportQuery。

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。

注:h.class在BOXI R3 celib.jar中不存在。

sap business-objects business-objects-sdk webi
1个回答
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投射到你所认为的对象上通常是行不通的. 具体的子类似乎更多的是在库的内部使用,而不是作为实际的外部可用类。

© www.soinside.com 2019 - 2024. All rights reserved.