G
Guest
I am exporting a report to an Excel file. Whatever options I use for the
formatting the results remain the same. I have set the
ExcelTabHasColumnHeadings to true and false without any difference. I have
set the ExcelUseConstantColumnWidth to true and thenset the width to
different values and have seen no changes. The code I am using is shown below.
private void ExportToExcel
(CrystalDecisions.CrystalReports.Engine.ReportDocument Report, string
fileName, bool hasColumnHeaders, double columnWidth)
{
ExcelFormatOptions excelFormatOpts = new ExcelFormatOptions
();
DiskFileDestinationOptions diskOpts = new
DiskFileDestinationOptions();
// Set the excel format options.
excelFormatOpts.ExcelTabHasColumnHeadings = false;
excelFormatOpts.ExcelUseConstantColumnWidth = hasColumnHeaders;
excelFormatOpts.ExcelConstantColumnWidth = columnWidth;
Report.ExportOptions.ExportFormatType = ExportFormatType.Excel;
Report.ExportOptions.FormatOptions = excelFormatOpts;
// Set the disk file options and export.
Report.ExportOptions.ExportDestinationType =
ExportDestinationType.DiskFile;
diskOpts.DiskFileName = fileName;
Report.ExportOptions.DestinationOptions = diskOpts;
Report.Export ();
}
Thanks for any help
formatting the results remain the same. I have set the
ExcelTabHasColumnHeadings to true and false without any difference. I have
set the ExcelUseConstantColumnWidth to true and thenset the width to
different values and have seen no changes. The code I am using is shown below.
private void ExportToExcel
(CrystalDecisions.CrystalReports.Engine.ReportDocument Report, string
fileName, bool hasColumnHeaders, double columnWidth)
{
ExcelFormatOptions excelFormatOpts = new ExcelFormatOptions
();
DiskFileDestinationOptions diskOpts = new
DiskFileDestinationOptions();
// Set the excel format options.
excelFormatOpts.ExcelTabHasColumnHeadings = false;
excelFormatOpts.ExcelUseConstantColumnWidth = hasColumnHeaders;
excelFormatOpts.ExcelConstantColumnWidth = columnWidth;
Report.ExportOptions.ExportFormatType = ExportFormatType.Excel;
Report.ExportOptions.FormatOptions = excelFormatOpts;
// Set the disk file options and export.
Report.ExportOptions.ExportDestinationType =
ExportDestinationType.DiskFile;
diskOpts.DiskFileName = fileName;
Report.ExportOptions.DestinationOptions = diskOpts;
Report.Export ();
}
Thanks for any help