Results 1 to 5 of 5

Thread: CrystalReportViewer on ASP.NET

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Question CrystalReportViewer on ASP.NET

    Dear Expert,

    I am very with ASP.NET + CR, I have some reports, they made by using CrystalReports, I have created a web form with a CrystalReportViewer inside..how to show a report into the viewer..

    Dim cn As New OdbcConnection
    cn.ConnectionString = mconn
    cn.Open()
    Try
    Dim ds As New DataSet
    Dim da As New OdbcDataAdapter(mReportDataSource, cn)
    da.Fill(ds)

    Dim crd As New ReportDocument
    crd.Load(Server.MapPath("test.rpt"))
    crd.SetDataSource(ds)

    ' The viewer is on the other web form .. how to show the report?

    Catch ex As OdbcException
    Catch ex As Exception
    Finally
    cn.Close()
    End Try


    Thanks & Regards
    Winanjaya

  2. #2
    Junior Member
    Join Date
    Apr 2006
    Posts
    17

    Re: CrystalReportViewer on ASP.NET

    I am also working in the same envoirnment. Can you help me how i attach my report with CrystalReportViewer on asp.net.


    Thnx in advance

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Re: CrystalReportViewer on ASP.NET

    You can use below codes, if the viewer is inside the same webform, the question is how if the viewer ISNOT in the same web form..

    ...

    CrystalReportViewer1.ReportSource = crd
    CrystalReportViewer1.DataBind()


    could any body please help..

    Thanks & Regards
    Winanjaya

  4. #4
    Junior Member
    Join Date
    Apr 2006
    Posts
    17

    Re: CrystalReportViewer on ASP.NET

    Thnx..
    yup!! The viewer is inside the same webform..but where exactly I add this code??

    lookin forward..

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Re: CrystalReportViewer on ASP.NET

    put it on page_init ! on the page which has crystalreportviewer

    Dim cn As New OdbcConnection
    cn.ConnectionString = mconn
    cn.Open()
    Try
    Dim ds As New DataSet
    Dim da As New OdbcDataAdapter(mReportDataSource, cn)
    da.Fill(ds)

    Dim crd As New ReportDocument
    crd.Load(Server.MapPath("test.rpt"))
    crd.SetDataSource(ds)

    CrystalReportViewer1.ReportSource = crd
    CrystalReportViewer1.DataBind()

    Catch ex As OdbcException
    Catch ex As Exception
    Finally
    cn.Close()
    End Try

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width