How to export crystal report to excel in asp.net 1.0
-
How to export crystal report to excel in asp.net 1.0? Is there any built in functionality to export it in excel. Thanks in advance,
Try this On Export Button Click Event: // Declare variables and get the export options. ExportOptions exportOpts = new ExportOptions(); ExcelFormatOptions excelFormatOpts = new ExcelFormatOptions (); DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions(); exportOpts = orpt.ExportOptions; // Set the excel format options. excelFormatOpts.ExcelUseConstantColumnWidth = true; exportOpts.ExportFormatType = ExportFormatType.Excel; exportOpts.FormatOptions = excelFormatOpts; // Set the disk file options and export. exportOpts.ExportDestinationType = ExportDestinationType.DiskFile; diskOpts.DiskFileName = fname; exportOpts.DestinationOptions = diskOpts; orpt.Export (); Hope this helps u...