Skip to Content
Former Member
Apr 08, 2010 at 04:46 PM

exporting dataset from crystal to excel


Hi, We are trying to resolev an issue which failed to do when exporting dataset from crystal to excel. This used to work. The report was build on .NET Framework 1.1/Visual Studio 2003. Any help would be appreciated. thank you

Here is the code that use to export dataset from crystal to excel. Also, You can uninstall and reinstall crystal report on test server(

RelationshipDetailsReport rptComp;

rptComp = (RelationshipDetailsReport) Session["CompReport"];

// string strExportFile = DataManager.Outgoing_FileDirectory + "/CompRelAcct.xls"; //Server.MapPath(".")

string fileName = getFileName("CompRelAcct.xls");

string strExportFile = excelFileFirectory + fileName;

rptComp.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;

rptComp.ExportOptions.ExportFormatType = ExportFormatType.Excel;

ExcelFormatOptions ObjExcelOption = new ExcelFormatOptions();

ObjExcelOption.ExcelUseConstantColumnWidth = false;

rptComp.ExportOptions.FormatOptions = ObjExcelOption;

DiskFileDestinationOptions objDiskOpt = new DiskFileDestinationOptions();

objDiskOpt.DiskFileName = strExportFile;

rptComp.ExportOptions.DestinationOptions = objDiskOpt;



string excelFile = "./ExcelArchive/" + fileName;