Click here to Skip to main content
15,893,401 members
Articles / Web Development / ASP.NET

How to Export Crystal Reports Without Using the Report Viewer

Rate me:
Please Sign up or sign in to vote.
4.29/5 (4 votes)
14 Jan 2011CPOL1 min read 77.8K   2.4K   15  
This article will show how to eliminate the Crystal Reports report viewer to allow reports to be exported in one step.
Partial Class ReportViewer
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        'No session object 
        If Session("Select") Is Nothing = True Then
            Response.Redirect("Default.aspx")
            Exit Sub
        End If

        Dim sel As New clsSelect
        sel = Session("Select")

        Dim cr As New clsCRExport
        Dim ResponseString As String = ""

        Try
            'Load the report
            ResponseString = cr.CRExportReport(sel)
            'Get the error
            If ResponseString <> "OK" Then
                System.Diagnostics.Debug.Print(ResponseString)
            End If

        Catch ex As Exception
            Response.Redirect("Default.aspx")
        End Try

    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer David Weaver Consulting
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions