cancel
Showing results for 
Search instead for 
Did you mean: 

Export from Java report viewer issue

Former Member
0 Kudos

Hi all,

I am trying to export a report from Java report viewer and get the following message:

com.businessobjects.crystalreports.viewer.core.rs.b$e cannot be cast to com.crystaldecisions.xml.serialization.IXMLSerializable

This happens whatever format I choose to export to. I guess I imported the wrong package... Any idea?

Also while trying to export a file to my desktop (MS Vista), I get a message says no write access to the selected file. Is this a setting issue? Can report be exported to desktop?

Regards,

Dong

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I haven't seen that exact error message before, however one thing I noticed is that you are not importing the correct ReportClientDocument object. There are two SDK's that use that object; one is called Report Application Server and the other called the Java Reporting Component.

You will want to change this line:

import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument;

to this:

import com.crystaldecisions.reports.sdk.ReportClientDocument

The first line is the RAS report object and the second line is the JRC report object. If you use the thick client viewer you will need to use the JRC because it is currently only fully supported with the JRC SDK.

Former Member
0 Kudos

Hi Merry,

Thank you for the reply. I tried your solution and got a few questions.

First of all, if I want to query IInforStore for a report, Can I use IInforObject to open a report with com.crystaldecisions.reports.sdk.ReportClientDocument?

Secondly, I also tried to open a previously exported report (C:\temp\test.rpt) with the JRC Report Viewer and get the following exception:


Opening document...
Exception in thread "main" java.lang.NoClassDefFoundError: com/crystaldecisions/reports/common/k/b
	at com.businessobjects.reports.sdk.JRCCommunicationAdapter.<clinit>(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at com.crystaldecisions.proxy.remoteagent.z.a(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ReportAppSession.int(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ReportAppSession.initialize(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ClientDocument.for(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.for(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ClientDocument.open(Unknown Source)
	at com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
	at com.pulsemining.crystalreport.main.CRDriver.openReport(CRDriver.java:160)
	at com.pulsemining.crystalreport.main.CRDriver.main(CRDriver.java:56)
Caused by: java.lang.ClassNotFoundException: com.crystaldecisions.reports.common.k.b
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 12 more

I followed the "Java Reporting Component XI Release 2 Deployment Guide" to configure my project in Eclipse but I must missed something... Also I was confused by the CRConfig.xml. The DataDriverCommon section of the xml file looks like this:


<DataDriverCommon>
	<JavaDir>${JAVA_HOME}\bin</JavaDir>
    <Classpath>"C:\Program Files\Business Objects\Common\3.5\java/lib/crlovmanifest.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/CRLOVExternal.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/CRDBJavaServerCommon.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/CRDBJavaServer.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/CRDBJDBCServer.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/CRDBXMLServer.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/CRDBJavaBeansServer.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/external/CRDBXMLExternal.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/external/log4j.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/cecore.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/celib.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/ebus405.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/corbaidl.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/external/freessl201.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/external/asn1.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/external/certj.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/external/jsafe.jar;C:\Program Files\Business Objects\Common\3.5\java/lib/external/sslj.jar;DLC\java\prosp.jar;DLC\java\jdbc.jar;DLC\java\progress.jar;DLC\java;DLC\jre\lib\rt.jar"${CLASSPATH}</Classpath>
	<IORFileLocation>${TEMP}</IORFileLocation>
	<JavaServerTimeout>1800</JavaServerTimeout>
	<JavaServerStartupTimeout>30</JavaServerStartupTimeout>
	<JVMMaxHeap>64000000</JVMMaxHeap>
	<JVMMinHeap>32000000</JVMMinHeap>
	<NumberOfThreads>100</NumberOfThreads>
</DataDriverCommon>

My Thick client will run on a client PC with no Crystal installed. Should I change all "C:\Program Files\Business Objects\Common\3.5\" to where those libraries are stored in my application?

Thank you,

Dong

Former Member
0 Kudos

I didn't realize from your initial posting that you were using the managed RAS SDK, my apologies.

The thick client viewer is currently only supported with the

com.crystaldecisions.reports.sdk.ReportClientDocument

(the JRC) which is likely why you were getting the initial error message.

The second error message is indeed because you are now importing the JRC ReportClientDocument, which does not contain the ReportAppSession class... the one that is generating the NoClassDefFound error.

You will not be able to use the IInfoObject or IInfoStore with the JRC package, only with the initial (managed RAS) ReportClientDocument.

To summarize, Initially you were getting an error when you were trying to use the thick client viewer with the managed RAS

com.crystaldecisions.sdk.occa.report.application.ReportClientDocument

package. Unfortunately this version of the ReportClientDocument, the managed RAS version, is not supported with the thick client viewer at this time.

If you want to continue to have all of the functionality of using the IInfoObjects and the InfoStore, you must continue to use this package but will have to switch to one of our HTML viewers. If you want to use the thick client viewer, you will need to switch to the other ReportClientDocument package (the JRC) however you will lose your ability to use the IInfoStore and IInfoObjects.

Former Member
0 Kudos

Merry,

Thank you very much for the reply. I was so confused but now things start getting clear. I ditched IInfoStore on the client side and switched to pure JRC. I am now trying to open a previously exported RPT file with the example code from "crxi_r2_jrc_desktop_samples\JRCViewReport". However, still getting the same message... Maybe I should take RAS jars out of my project's classpath or something? Any suggestions?


Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/crystaldecisions/reports/common/k/b
	at com.businessobjects.reports.sdk.JRCCommunicationAdapter.<clinit>(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at com.crystaldecisions.proxy.remoteagent.z.a(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ReportAppSession.int(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ReportAppSession.initialize(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ClientDocument.for(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.for(Unknown Source)
	at com.crystaldecisions.sdk.occa.report.application.ClientDocument.open(Unknown Source)
	at com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
	at com.pulsemining.crystalclientscript.main.JRCViewReport.launchApplication(JRCViewReport.java:17)
	at com.pulsemining.crystalclientscript.main.JRCViewReport$1.run(JRCViewReport.java:38)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.crystaldecisions.reports.common.k.b
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 20 more

Former Member
0 Kudos

Hi guys,

FYI, I fixed it. As Merry pointed out. At first, I mixed SDK. Then after I switched to JRC, there were couple of jar files missing from my import list.

Thank you,

Dong

Former Member
0 Kudos

I am using the JFrame example I found from the tutorial to display a report in a Java report viewer. Here are packages imported by the example:


import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;

import com.crystaldecisions.ReportViewer.ReportViewerBean;
import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument;
import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;

public class ReportViewerFrame extends JFrame {