Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports in Websphere 5.1.1

Status
Not open for further replies.

Abrunhosa

Programmer
Oct 13, 2004
1
AO
Hey,I almost finish my application using Struts. But now i'm trying to display some reports by exporting them into pdf format and i'm keep receiving the same error "The file is damaged and could not be repaired."

here the code that i used to display the report in JSP:
<%@page import="com.crystaldecisions.report.web.viewer.*,
com.crystaldecisions.reports.reportengineinterface.*,
com.crystaldecisions.sdk.occa.report.reportsource.*,
com.crystaldecisions.sdk.occa.report.exportoptions.*,
com.crystaldecisions.sdk.occa.report.data.*"%>
<%//ReportSource
String Report="Reports/Report1.rpt";
IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
IReportSource reportSource = (IReportSource) rptSrcFactory.createReportSource(Report, request.getLocale());
//ExportReport
ReportExportControl exportControl = new ReportExportControl();
ExportOptions exportOptions = new ExportOptions();
exportOptions.setExportFormatType(ReportExportFormat.PDF);
IPDFExportFormatOptions PDFExpOpts = new PDFExportFormatOptions();
PDFExpOpts.setStartPageNumber(1);
PDFExpOpts.setEndPageNumber(1000000);
exportOptions.setFormatOptions(PDFExpOpts);
//ParameterField
//DatabaseLogon
ConnectionInfos connInfos = new ConnectionInfos();
IConnectionInfo connInfo = new ConnectionInfo();
connInfo.setUserName("admin");
connInfo.setPassword("admin");
connInfos.add(connInfo);
//ReportViewer
exportControl.setReportSource(reportSource);
exportControl.setExportOptions(exportOptions);
exportControl.setExportAsAttachment(false);
exportControl.setDatabaseLogonInfos(connInfos);
exportControl.setEnableLogonPrompt(false);
exportControl.processHttpRequest(request,response,getServletConfig().getServletContext(), null);
exportControl.dispose();
%>

please can someone Help me

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top