cancel
Showing results for 
Search instead for 
Did you mean: 

Exception from server when downloading an output file of a scheduled Crystal Report

jrg_heinrich
Explorer
0 Kudos

Hello,

I'm using the Java SDK to schedule a Crystal Report and download the binary result file with the following steps:

1) Logon to the server using a com.crystaldecisions.sdk.framework.ISessionMgr

2) Get a handle (com.crystaldecisions.sdk.occa.infostore.IInfoObject) of the report document, using the info store (com.crystaldecisions.sdk.occa.infostore.IInfoStore)

3) Using this handle, get a com.crystaldecisions.sdk.plugin.desktop.common.IReportProcessingInfo by calling getPluginProcessingInterface("CrystalReport")

4) Fill the prompts on this IReportProcessingInfo with user's values.

5) Schedule the report for immediate execution and get the instance ID via property SI_NEW_JOB_ID. Poll for the execution to reach a final state (COMPLETE or FAILURE), using the info store.

6) Upon successful completion, get an IInfoObject handle of the new instance from the info store.

7) By calling getFiles() on the instance handle, get a remote file handle (com.crystaldecisions.sdk.occa.infostore.IRemoteFile) and then a streaming download file (com.crystaldecisions.sdk.occa.infostore.IStreamingDownloadFile).

😎 Open the IStreamingDownloadFile, download it in chunks and finally close it.

9) Logoff from the session

This workflow worked fine in BO XI 3.1, but it fails in step 8 on BO XI 4.1 (SP5, Patch 2). I have replaced the 3.1 JARs with the ones from 4.1, but the error is the same. I get an exception on the call to IStreamingDownloadFile.openFile() with the following error text:

com.crystaldecisions.sdk.exception.SDKServerException: The error message is unknown. This is likely caused by version inconsistencies between components.

Here is the value that caused the problem: 65314 and the additional information: .

cause:com.crystaldecisions.enterprise.ocaframework.idl.OCA.oca_abuse: IDL:img.seagatesoftware.com/OCA/oca_abuse:3.2

detail:The error message is unknown. This is likely caused by version inconsistencies between components.

Here is the value that caused the problem: 65314 and the additional information: .

The server supplied the following details: OCA_Abuse exception 6408 at [.\authrequest.cpp : 128]  65314 {}

...No logon token has been provided for authentication!

Any idea what is going wrong here? At the moment of calling IStreamingDownloadFile.openFile() the session opened in step 1 is still active and valid and I did not find any information on how to provide an authentication token to the openFile() call.

I also tried to download the binary file from the history of a WebI report, but this results in the same exception.

Thanks for any help or hints! Best regards,

Joerg

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Make sure you do not have any references to the 3.1 jars in your application. You should have jars only from the BI 4.1 version you are using.

Also try once with below sample to just download a crystal report and share your observations.

===============================

<%@ page import ="com.crystaldecisions.sdk.framework.*" %>

<%@ page import ="com.crystaldecisions.sdk.occa.infostore.*" %>

<%@ page import ="com.crystaldecisions.sdk.exception.*" %>

<%@ page import ="java.io.FileWriter" %>

<%@ page import ="java.io.IOException" %>

<%@ page import ="com.crystaldecisions.sdk.plugin.desktop.txt.*" %>

<%@ page import ="java.util.*" %>

<%@ page import ="java.io.*" %>

<%

IEnterpriseSession es = null;

try

{

     String user = "<Administrator-userName>";

     String password = "<Administrator-Password>";

     String cmsName = "<CmsName>";

     String cmsAuthType = "<AuthType>";

 

  IEnterpriseSession es = CrystalEnterprise.getSessionMgr().logon( user, password, cmsName, cmsAuthType);

  IInfoStore iStore = (IInfoStore) es.getService("", "InfoStore");

  out.println("Got Logged In To BO" + "<br>");

  IInfoObjects instances = iStore.query("select * from ci_infoobjects where si_id=<Report_ID> and SI_KIND='CrystalReport'");

        for (int i = 0; i < instances.size(); i++) 

  {

   IInfoObject iReport=(IInfoObject)instances.get(i);

   IFiles files = (IFiles)iReport.getFiles();

   IStreamingDownloadFile iStream = ((IRemoteFile)files.get(0)).getStreamingDownloadFile(0);

   iStream.openFile();

   BufferedOutputStream pw = new BufferedOutputStream(new FileOutputStream("C:\\Sample.rpt",false));

   while(iStream.hasNextChunk())

   {

    pw.write(iStream.nextChunk());

   }

   pw.flush();

   pw.close();

   iStream.closeFile();

   out.print("<br>done");

  }

       

}

catch(Exception e)

{

  out.println("Error " + e);

}

finally

{

  es.logoff();

}

 

%>

===============================================

Also, on a second thought, if you want to schedule a crystal report and download it to disk, then why not schedule to destination directly?

Thanks,

Prithvi

jrg_heinrich
Explorer
0 Kudos

Hello Prithvi,

thank you very much for your answer. It did not directly solve my problem, but it led me on the right track. I was using JARs solely from the 4.1 version; no old ones from 3.1 were involved, but it seems that I had far too many JARs in my classpath. I did some code cleanup and removed all references to classes that worked in 3.1 but are defunct now in 4.1, like the rebean stuff, which I needed for WebI. This helped me to drop nearly 30 JARs and now the code is running for Crystal Reports without any further changes. (The code is, by the way, very similar to the example you gave.)

Maybe some side effects were produced by the unused JARs concerning class loader order and they are now gone with the reduction of the classpath.

Now my next task is to get WebI reports running in the same workflow using the Restful Services.

Thanks again and best regards

Joerg

Former Member
0 Kudos

Hi Prithvi,

I'm facing the situation too. We're migrating from XI 3.1 to 4.1. I couldn't find an easy way with very minimal change. Below are steps i did.

Step 1:

Removed all 3.1 Jars and copied all 4.1 jars to classpath. I'm facing errors

'The type com.businessobjects.sdk.plugin.desktop.universe.IUniverseReference cannot be resolved. It is indirectly referenced from required .class files'

Step 2:

Proceeded with 3.1 jars and just tried to run reports on '4.1 Environmnt'. faced version error like
'com.crystaldecisions.sdk.exception.SDKServerException: The error message is unknown. This is likely caused by version inconsistencies between components. Here is the value that caused the problem: 65314 and the additional information: .'

Looks like i need to rework a lot. Any ideas which i can follow to migrate with ease and not a lot of coding changes?

Thanks,

Bharath

Answers (0)