ExcelFormatOptions is it working for someone? VS2005 beta 2 Exporting report to Excel

Hi. I'm using vs2005 beta2 version of CrystalReport in an aspx page.
I'm able to export to http response to both excel and excelRecord format.
But, when I try to use ExcelFormatOptions, these options are not applied

Here's my code

Public Shared Sub ExporterRapport(ByVal ExportFormat As String, ByRef objRapport As CrystalReportSource, ByRef objResponse As System.Web.HttpResponse, ByVal TitreRapport As String, Optional ByVal PieceJointe As Boolean = True)

Dim myExportOptions As New ExportOptions()

If ExportFormat = "PDF" Then
   myExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
ElseIf ExportFormat = "XLS" Then
   
Dim excelFormatOpts As New ExcelFormatOptions()
   
' Set the excel format options.
   
excelFormatOpts.ExcelTabHasColumnHeadings = True
   
excelFormatOpts.ExcelConstantColumnWidth = 250
   
excelFormatOpts.ExcelUseConstantColumnWidth = True
   
excelFormatOpts.UsePageRange = False
   
myExportOptions.ExportFormatType = ExportFormatType.ExcelRecord
   
myExportOptions.FormatOptions = excelFormatOpts

ElseIf ...
End If

objRapport.ReportDocument.ExportToHttpResponse(myExportOptions, objResponse, PieceJointe, TitreRapport)

End Sub

 Thanks, MBus.


Answer this question

ExcelFormatOptions is it working for someone? VS2005 beta 2 Exporting report to Excel

  • oananiev

    Hi Keith,

    what happened with this post Is there any solution to this

    I’m using CR XI Rel 2 and it still doesn’t work to set the column width when exporting to ExcelRecord!

    Thanks,

    Robert



  • Mike Carlisle

    Hi,

    Was there any solution to this post

    Thanks,
    Godwin



  • Marty.M

    Hello Martin,

    Sorry for the long delay on this one. 

    I tried doing this in Crystal Reports for Visual Studio 2003 .NET and I was getting the same results.

    I will see if any solutions exist for that product as it may help in providing a solution for you.

    Keith - Business Objects

  • Lorin

    Hello Martin,

    I tried this out and I am getting the same results (or lack of) that you are.

    Let me run this by the developers to see if this is a known issue.

    Thanks!
    Keith - Business Objects

  • ExcelFormatOptions is it working for someone? VS2005 beta 2 Exporting report to Excel