This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Java & Crystal Reports Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java & Crystal Reports" Watch "Java & Crystal Reports" New topic
Author

Java & Crystal Reports

Victoria Kholodenko
Greenhorn

Joined: Jan 07, 2005
Posts: 1
I posted this question on Crystal Reports forum, but didn't get any answer.
Hope, that someone with knowledge on how to deal with Crystal + Java can reply me here. This is the problem I am dealing with:

I am trying to export Crystal Report to Excel format in my JSP...
It works for PDF, RTF, MSWord formats, but when I'm trying to do the same for Excel - I am getting "Invalid post back event : {0}" message coming from com.crystaldecisions.report.web.viewer.ReportExportControl
Can not understand what I am doing wrong... Please, help! Thanks!
This is my JSP code:

<%@ page
import="com.crystaldecisions.reports.reportengineinterface.*,
com.crystaldecisions.report.web.viewer.*,
com.crystaldecisions.sdk.occa.report.exportoptions.*,
com.crystaldecisions.sdk.occa.report.data.*,
com.crystaldecisions.sdk.occa.report.reportsource.*" %>

<%
ReportExportControl exportControl = new ReportExportControl();

IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
exportControl.setReportSource(rptSrcFactory.createReportSource(
"ReportForTst.rpt", request.getLocale()));

ExportOptions exportOptions = new ExportOptions();
exportOptions.setExportFormatType(ReportExportFormat.MSExcel);

ExcelExportFormatOptions xlexpopts = new ExcelExportFormatOptions();
xlexpopts.setStartPageNumber(1);
xlexpopts.setEndPageNumber(1);
exportOptions.setFormatOptions(xlexpopts);

exportControl.setExportOptions(exportOptions);
exportControl.setExportAsAttachment(true);
exportControl.processHttpRequest(request, response, application, null);

exportControl.dispose();
%>
sandeep nayak
Greenhorn

Joined: Feb 28, 2005
Posts: 1
I am facing the same problem




If any solution please inform


Thanks in advance

Regards
Sandeep Nayak
parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
Hello there,
Used to use inet crystal clear for pumping out reports long time ago.

In the current project
We are using Crystal dev edition XI and no JSP's
So far all the documentation and examples are related to how things can be done in JSP+Crystal

Would sincerely appreciate if you could provide any pointer on how things can be moved forward with out the enterprise edition and a server but just a standalone app producing reports

Best regards,
Parthi


Even crazy and silly looking problems are sometimes real.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Well I am using JasperReports and not facing any problems.
[ July 07, 2005: Message edited by: Chetan Parekh ]

My blood is tested +ve for Java.
parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
Good for you, unfortunately i'm stuck with crystal..and your pointer does not help in me progressing further .. more of rubbing salt in the wound

Thanks for your help anyways

Cheers,
Parthi
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
If you do not want to use Crystal reports in a J2EE environment the above example seems to be easy enough to convert.

I once used Crystal Reports in a Java/AWT application and do not remember having troubles with lacking documentation.

Seems to me that you can just use some code like in the example above (or any other JSP example) and
replace the call with something that writes to a FileOutputStream or something. The Crystal reports installation must come with an API description (Javadoc) or something like that.
parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
Thanks for teaching me that,

Like I said I�m stuck with crystal for this.

Tried doing all that the api documentation that they have give is a crap oh well guess I have to learn how to suck egg all over again
 
Consider Paul's rocket mass heater.
 
subject: Java & Crystal Reports
 
Similar Threads
jsp crystal reports xls
Please Help - This is Most Urgent
Exporting Crystal reports to Excel
Tomcat is logging IllegalStateException whenever it invokes processHttpRequest()
error:exportername is empty