Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

hide report viewer when report document downloaded

$
0
0

Dear All,

Pls help to solve my following issue.

In my web application , I am usin a reportviewer.When I click button,Report will generate and will show in a crystalreportviewer.

And If the record count is >400 , Instead of reportviewer , repot will downoad using reportdocument.Now my problem is When the report will download ,I need to hide report viewer.But it is not working.Pls see my code below

Button click
     'Dim crd As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
                crd.Load(Server.MapPath(reportname))
                crd.SetDatabaseLogon("t", "t", "t", "t")

                crd.SetParameterValue(0, val1)
                crd.SetParameterValue(1, val2)
                crd.SetParameterValue(2, val3)
                crd.SetParameterValue(3, val4)
                crd.SetParameterValue(4, val5)
                crd.SetParameterValue(5, val6)
          

                Download(crd)
 Private Sub Download(crd As CrystalDecisions.CrystalReports.Engine.ReportDocument)
        ' Stop buffering the response
        Response.Buffer = False
        ' Clear the response content and headers
        Response.ClearContent()
        Response.ClearHeaders()
        Try

    reportviewer.visible=false
            crd.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, "ReportView")


        Catch ex As Exception
            Console.WriteLine(ex.Message)
            ex = Nothing

        End Try


    End Sub




Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>