craigyang
asked on
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 (reportNam e, 0);
//Get the report source
reportSource = oReportClientDocument.getR eportSourc e();
//create the CrystalReportViewer object
CrystalReportViewer oCrystalReportViewer = new CrystalReportViewer();
//set the reportsource property of the viewer
oCrystalReportViewer.setRe portSource (reportSou rce);
//set viewer attributes
oCrystalReportViewer.setOw nPage(true );
oCrystalReportViewer.setOw nForm(true );
//set the CrystalReportViewer print mode
oCrystalReportViewer.setPr intMode(Cr PrintMode. ACTIVEX);
...
String reportName = "1308_001.rpt";
Object reportSource = new Object();
//---------- Create a ReportClientDocument ----------
ReportClientDocument oReportClientDocument = new ReportClientDocument();
//Open report.
oReportClientDocument.open
//Get the report source
reportSource = oReportClientDocument.getR
//create the CrystalReportViewer object
CrystalReportViewer oCrystalReportViewer = new CrystalReportViewer();
//set the reportsource property of the viewer
oCrystalReportViewer.setRe
//set viewer attributes
oCrystalReportViewer.setOw
oCrystalReportViewer.setOw
//set the CrystalReportViewer print mode
oCrystalReportViewer.setPr
...
ASKER
Do you have a solution using JSP?
>>> 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
This normally means that the export dll hasn't been installed on the server...
frodoman
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
CrystalDecisions.Shared.Ex
objExcelOptions.ExcelUseCo
m_ReportDoc.ExportOptions.
MemoryStream objStream = (MemoryStream)oReportClien
Response.Clear();
Response.ContentType="appl
Response.BinaryWrite(objSt
Response.End();