• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issues Exporting Crystal Report

 
Jessica Otte
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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:



com.crystaldecisions.sdk.occa.report.lib.ReportSDKParameterFieldException
: 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic