• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Issues Exporting Crystal Report

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!