How to set the Default Export FormatType in crystal reports?
-
Hi, I am working with crystal reports XI. When exporting the crystal reports, by default "Crystal Reports (RPT)" is selected in the FileFormat dropdownlist. Is it possible to set this option as "Microsoft Excel 97-2000 data only (XLS)"? Please if any one knows about it reply me.. I need the answer urgently..
Thankfully, jm
-
Hi, I am working with crystal reports XI. When exporting the crystal reports, by default "Crystal Reports (RPT)" is selected in the FileFormat dropdownlist. Is it possible to set this option as "Microsoft Excel 97-2000 data only (XLS)"? Please if any one knows about it reply me.. I need the answer urgently..
Thankfully, jm
Have you tried this code??
' Declare variables and get the export options. Dim exportOpts As New ExportOptions() Dim diskOpts As New DiskFileDestinationOptions() Dim excelFormatOpts As New ExcelFormatOptions() exportOpts = Report.ExportOptions ' Set the excel format options. excelFormatOpts.ExcelTabHasColumnHeadings = true exportOpts.ExportFormatType = ExportFormatType.Excel exportOpts.FormatOptions = excelFormatOpts ' Set the export format. exportOpts.ExportFormatType = ExportFormatType.Excel exportOpts.ExportDestinationType = ExportDestinationType.DiskFile ' Set the disk file options. diskOpts.DiskFileName = fileName exportOpts.DestinationOptions = diskOpts Report.Export()
ref: http://msdn2.microsoft.com/en-us/library/aa288404(VS.71).aspxThanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
Have you tried this code??
' Declare variables and get the export options. Dim exportOpts As New ExportOptions() Dim diskOpts As New DiskFileDestinationOptions() Dim excelFormatOpts As New ExcelFormatOptions() exportOpts = Report.ExportOptions ' Set the excel format options. excelFormatOpts.ExcelTabHasColumnHeadings = true exportOpts.ExportFormatType = ExportFormatType.Excel exportOpts.FormatOptions = excelFormatOpts ' Set the export format. exportOpts.ExportFormatType = ExportFormatType.Excel exportOpts.ExportDestinationType = ExportDestinationType.DiskFile ' Set the disk file options. diskOpts.DiskFileName = fileName exportOpts.DestinationOptions = diskOpts Report.Export()
ref: http://msdn2.microsoft.com/en-us/library/aa288404(VS.71).aspxThanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
Hi Sync, Yes I tried the code, but I could not get you what "Report" means in the code. Is this the ReportDocument Name or something else? :( Also the diskOpts.DiskFileName = fileName (filename??) what value can I give to it? Is it the name of the xls file which is to be store the exported report? It must be set at runtime isnt it? I am not sure about it.. Can you clarify my doubts, please?
Thankfully, jm