?
Solved

Problems exporting report in Crystal Reports 10

Posted on 2004-09-08
12
Medium Priority
?
873 Views
Last Modified: 2009-01-15
hi,

I am using Crystal Reports 10 (Java Reproting Component).
I made a JSP page to export a rerport to the various available formats.
Only the Word and RTF format are working. All the others (Crystal Reports, Excel, Plain text, etc...) are generating the following exception:

com.crystaldecisions.report.web.viewer.ReportExportControl
Invalid post back event : {0}
 
 
Any ideas?
0
Comment
Question by:tarekz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 12008287
Are the exporting dlls installed?

Can you export to other formats from the Crystal preview screen?

mlmcc
0
 
LVL 1

Author Comment

by:tarekz
ID: 12008909
What is the crystal preview screen? Do you mean the one in the Crystal Reports 10 designer?
Or you are asking about the html page generated by the viewer?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12009224
I am referring to the one in Crystal design mode.

mlmcc
0
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 
LVL 1

Author Comment

by:tarekz
ID: 12009550
Ok, then the answer is yes, i am able to export to all the formats available.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12010335
Is the JSP method being run on the same machine or is this on a client?

mlmcc
0
 
LVL 1

Author Comment

by:tarekz
ID: 12010408
Ok, let me give all the details..

I am running tomcat 4.1.27 on my Machine (it is the application server for my JSP pages)... I am using only the Java Reporting Component... and the reports are all in the .../WEB-INF/classes directory... Probably i should mention that i am able to view them all in the crystal viewer.

Also here is the code of my exportReport.jsp (as i mentioned before, it is working if i choose Word as the format of the export)

<%
  String report = (String) session.getAttribute("report");

  IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
  IReportSource reportSource = (IReportSource)rptSrcFactory.createReportSource(report, request.getLocale());
  Fields fields = (Fields) session.getAttribute("fields");

  String selectedFormat = (String)session.getAttribute("exportFormat");

  ReportExportControl exportControl = new ReportExportControl();
  ExportOptions exportOptions = new ExportOptions();
  if(selectedFormat.equals("0")/*Crystal Report*/){
      exportOptions.setExportFormatType(ReportExportFormat.crystalReports);
  }
  else if(selectedFormat.equals("1")/*Word*/){
      exportOptions.setExportFormatType(ReportExportFormat.MSWord);
  }
  else if(selectedFormat.equals("2")/*Excel*/){
     exportOptions.setExportFormatType(ReportExportFormat.MSExcel);
  }
  else if(selectedFormat.equals("3")/*Rich Text Format*/){
      exportOptions.setExportFormatType(ReportExportFormat.RTF);
  }
  else if(selectedFormat.equals("5")/*PDF*/){
     exportOptions.setExportFormatType(ReportExportFormat.PDF);
  }
  else if(selectedFormat.equals("6")/*Excel without formatting*/){
      exportOptions.setExportFormatType(ReportExportFormat.recordToMSExcel);
  }
  else if(selectedFormat.equals("7")/*Text*/){
      exportOptions.setExportFormatType(ReportExportFormat.text);
  }
  else if(selectedFormat.equals("8")/*CSV*/){
      exportOptions.setExportFormatType(ReportExportFormat.characterSeparatedValues);
  }
  exportControl.setOwnPage(true);
  exportControl.setOwnForm(true);
  exportControl.setReportSource(reportSource);
  exportControl.setExportOptions(exportOptions);
  exportControl.setExportAsAttachment(true);
  exportControl.setParameterFields(fields);

  exportControl.processHttpRequest(request, response, getServletContext(), out);

  exportControl.dispose();
%>
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 400 total points
ID: 12011944
I remember reading another question or Crystal link that indicated some of the web viewers are limited in export capability to keep the size of the viewer small.

My understanding with Word and RTF is that they produce the same result in CR10 so you could use the Word option for RTF.

I'll see if I can find the reference.

mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12012790
0
 
LVL 1

Author Comment

by:tarekz
ID: 12016204
That is true, but they are talking about the export functionality that is within the viewer control itself.
The viewer only supports PDF & RTF. I am using the ReportExportControl which business objects claims it suports all the above mentioned formats (Excel, Word, Crystal Reports, Plain Text, CSV, etc...) except HTML...
Plus the Code i posted is a collection of source code i gathered from the examples they include with their installation.

I dont htink this problem is simple becuase i emailed business objects support and its been 10 days now and they havent replied... :)
I hope you or someone can beat them to the answer!
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12023358
Are you sure the constants you are using to set the export format are correct including capitalization?

mlmcc
0
 
LVL 1

Author Comment

by:tarekz
ID: 12030999
I got word from Crystal Reports That the JRC (Java Reproting Component) only supports RTF and PDF... as we alreay knew, and that even if the ReportExportControl is used, the JRC engine can not handle these other formats.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12031606
Glad I could help

mlmcc
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question