After exporting to Excel the Alignment / Formating is messed up!
Posted on 2004-04-08
I am using Crystal Reports 9 and VB 6 for exporting it to Excel. The export works fine but the final exported xls sheet is not what I expect. all the columns have equal width and the allignment is all messed up. I even used ruler lines in the designer to help allign the columns vertically but still no use. But when I export it directly through crystal reports, its perfect. with columns widths and allignment are all according to what i have given in the report.
I am using the following code to export please suggest.
Dim Appl As New CRAXDRT.Application
Dim Rpt As CRAXDRT.Report
Rpt.ExportOptions.FormatType = crEFTExcel97
Rpt.ExportOptions.ExcelUseConstantColumnWidth = False
Rpt.ExportOptions.DestinationType = crEDTDiskFile
for the statement "Rpt.ExportOptions.ExcelUseConstantColumnWidth = False" even if I give True here it still gives the same output. I even tried Different FormatTypes like Excel80 etc. But no use.