locked
Crystal Report not Exporting On website RRS feed

  • Question

  • User1406973109 posted

    Hi Good Day All,

    I have this code for exporting my crystal report to excel, but it doesn't export anything and it just tells me that it was successful, please what can i do. This is my code:

    Protected Sub ImgBtExcel_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImgBtExcel.Click
            Dim objReportOptions As New ExportOptions
            Dim objDiskFileDestinationOptions As New DiskFileDestinationOptions()
            Dim objFormatTypeOptions As New ExcelFormatOptions
            Dim strFileName As String = "C:\Reports\WatchDog" & Now.ToLongDateString & ".xls"
    
            Try
                If strFileName IsNot Nothing Then
    
                    If Not System.IO.Directory.Exists("C:\Reports\") Then
                        System.IO.Directory.CreateDirectory("C:\Reports\")
                    End If
    
                    objDiskFileDestinationOptions.DiskFileName = strFileName
                    objReportOptions.ExportDestinationType = ExportDestinationType.DiskFile
                    objReportOptions.ExportFormatType = ExportFormatType.Excel
                    objFormatTypeOptions.ExcelUseConstantColumnWidth = False
                    objReportOptions.DestinationOptions = objDiskFileDestinationOptions
                    objReportOptions.FormatOptions = objFormatTypeOptions
    
                    objReports.Export(objReportOptions)
                    'MsgBox("Export Successful")
                    Response.Write("Report Exported Successfully, Please check your C:\Reports\ Folder. Thanks")
                End If
            Catch ex As Exception
    
            End Try
        End Sub

    Thanks

    Tim

    Tuesday, April 9, 2013 5:55 AM

All replies

  • User311508580 posted

    hi timotech,

    Have you configure the CR correctly on the server? Is there any error message?

    Friday, April 19, 2013 12:44 AM