Skip to Content
0
Former Member
Oct 18, 2011 at 11:07 AM

Save Webi as PDF to local disk

48 Views

Hello,

We have allready scheduled a Webi-Report successfully via SDK.

At the moment we are trying to export instances of the webi-report(format=PDF) to local disk.

Unfortunately we are getting this error:

-


com.crystaldecisions.sdk.exception.SDKException$ServiceNotFound: The service ReportEngines could not be found on the client side

at com.crystaldecisions.sdk.occamgr.internal.DefaultOCCAFactoryResolver.getOCCAFactory(DefaultOCCAFactoryResolver.java:116)

at com.crystaldecisions.sdk.occamgr.internal.OCCAMgr.getOCCAFactory2(OCCAMgr.java:109)

at com.crystaldecisions.sdk.framework.internal.EnterpriseSession.getService_aroundBody22(EnterpriseSession.java:454)

at com.crystaldecisions.sdk.framework.internal.EnterpriseSession.getService(EnterpriseSession.java:1)

at com.crystaldecisions.sdk.framework.internal.EnterpriseSession.getService_aroundBody24(EnterpriseSession.java:478)

at com.crystaldecisions.sdk.framework.internal.EnterpriseSession.getService_aroundBody25$advice(EnterpriseSession.java:42)

at com.crystaldecisions.sdk.framework.internal.EnterpriseSession.getService(EnterpriseSession.java:1)

at CargoClass02.scheduleReport(CargoClass02.java:44)

at CargoClass02.run(CargoClass02.java:32)

at com.crystaldecisions.sdk.plugin.desktop.program.internal.ProgramWrapper.main(ProgramWrapper.java:174)

-


The source-code looks like this:

-


ReportEngines reportEngines = (ReportEngines) oEnterpriseSession.getService("ReportEngines");

reportEngine = reportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);

DocumentInstance oDocument = reportEngine.openDocument(reportID);

BinaryView oBinaryView = (BinaryView) oDocument.getView(OutputFormatType.PDF);

String vFilePath="/bo/BOFlatfiles/"tmpWebi.getTitle()".pdf";

File vFile = new File(vFilePath);

vFile.setWritable(true);

vFile.setReadable(true);

FileOutputStream fstream = new FileOutputStream(vFilePath);

fstream.write(oBinaryView.getContent());

-


Are their any good code-examples for export of Webi-PDF to disk?

Is their any solution for the mentioned error?

Thanks,

Kind regards,

Fritz Korntner