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
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.
:confused:
Thnx in advance
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
Re: CrystalReportViewer on ASP.NET
Thnx..
yup!! The viewer is inside the same webform..but where exactly I add this code??
lookin forward..
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