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
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