learn java
The moose likes Other Java Products and Servers and the fly likes Issues Exporting Crystal Report Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Issues Exporting Crystal Report " Watch "Issues Exporting Crystal Report " New topic

Issues Exporting Crystal Report

Jessica Otte

Joined: Oct 23, 2012
Posts: 1

Can someone give me an overview of how exporting from Crystal works? My main problem is that when I try to export, it seems like crystal tries to run the report, which I don't want to happen. I want to be able to export the report as a crystal report, so that I can eventually import it into another database. I don't need to run the report because the values and database will be different once I import it to the new database. I have a report registered, that when viewed, prompts the user for parameter values. When I try to export this report, I get the following error:

: Missing parameter values.---- Error code:-2147217394 [CRSDK00000000] Error code name:missingParameterValueError
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.controllerExportInternal(PrintOutputController.java:280)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(PrintOutputController.java:152)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(PrintOutputController.java:130)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(PrintOutputController.java:113)

If I were to set the parameter values before exporting, then I don't get the error. Similarly, if the database isn't valid, I get an exception when exporting. The code to export looks something like:

//Search for the report on the server.
IEnterpriseSession lEnterpriseSession = null;

//if the enterprise session is null, create one.
if (lEnterpriseSession == null) {
try {
lEnterpriseSession = CrystalEnterprise.getSessionMgr().getSession(pSession);
catch (SDKException pException1) {
//throw exception...

//Enterprise Session is valid, so search for the crystal object.
IInfoObjects lInfoObjects = searchForCrystalObject(pReportTitle, pReportRegisterFolder, lEnterpriseSession);

IInfoObject lReport = (IInfoObject)lInfoObjects.get(0);

ReportClientDocument rcd = null;
try {
IReportAppFactory reportAppFactory = (IReportAppFactory) lEnterpriseSession.getService("RASReportFactory");
rcd = reportAppFactory.openDocument(lReport, OpenReportOptions._discardSavedData, java.util.Locale.US);

catch (SDKException pException1) {
//throw exception...

try {
if (rcd != null)
return (ByteArrayInputStream)rcd.getPrintOutputController().export(ReportExportFormat.crystalReports);
catch (ReportSDKException pException2) {
//throw exception...

I have read somewhere that "Only RTF and PDF exporting are supported with Crystal Reports Java Reporting Component", however I'm not sure whether that's correct, and whether that's part of my problem. So, my main question is: using java, can I export a report in the crystalReports format without running it first?

Any help is appreciated. Thanks.
Have you tried LearnNowOnline? http://www.learnnowonline.com/
subject: Issues Exporting Crystal Report