Export web Crystal Reports XI to Excel

How to export web Crystal Reports XI to Excel? The export option of Excel doesn't show up on my web Crystal Report. My code is as follows :

String reportName = "1308_001.rpt";
Object reportSource = new Object();
//---------- Create a ReportClientDocument ----------
ReportClientDocument oReportClientDocument = new ReportClientDocument();
//Open report.
oReportClientDocument.open(reportName, 0);
//Get the report source
reportSource = oReportClientDocument.getReportSource();
//create the CrystalReportViewer object
CrystalReportViewer oCrystalReportViewer = new CrystalReportViewer();
//set the reportsource property of the viewer
oCrystalReportViewer.setReportSource(reportSource);
//set viewer attributes
oCrystalReportViewer.setOwnPage(true);
oCrystalReportViewer.setOwnForm(true);
//set the CrystalReportViewer print mode
oCrystalReportViewer.setPrintMode(CrPrintMode.ACTIVEX);
...
craigyangAsked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
Check this link.  It indicates you cannot export from JSP to Excel.

mlmcc
0
 
habibbCommented:
by using following code you can export report to excel for your web solutions.



CrystalDecisions.Shared.ExcelFormatOptions  objExcelOptions = new CrystalDecisions.Shared.ExcelFormatOptions();
                              objExcelOptions.ExcelUseConstantColumnWidth = true;
                                          
                              m_ReportDoc.ExportOptions.FormatOptions = objExcelOptions;    

                              MemoryStream objStream  = (MemoryStream)oReportClientDocument .ExportToStream(CrystalDecisions.Shared.ExportFormatType.ExcelRecord);
                              Response.Clear();
                              Response.ContentType="application/vnd.ms-excel";
                              Response.BinaryWrite(objStream.ToArray());
                              Response.End();
0
 
craigyangAuthor Commented:
Do you have a solution using JSP?
0
 
frodomanCommented:
>>> The export option of Excel doesn't show up on my web Crystal Report

This normally means that the export dll hasn't been installed on the server...

frodoman
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.