In ASP.NET 1.1 when we add a crystal report to the web application, it will create a class file for that report. so when we deploy the web application this class file is included in the dll. so whenever we need to make changes to the crystal report we have to deploy the whole application.This is not the case with asp.net 2.0 website model. In asp.net 2.0 website model the crystal report is treated as an external file. The reason is to be able to deploy the changes to the crystal report with out deploying the whole site.
Following is the code used to display the crystal report in asp.net 2.0 website.
Dim myReport as CrystalDecisions.CrystalReports.Engine.ReportDocument
myReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument()
myReport.Load(Server.Mappath("testreport.rpt"))
CrystalReportViewer1.ReportSource = myReportDocument
'get the data from database.
Dim dt as datatable = GetData()
myReport.SetDataSource(dt)
myReport.ReportSource = myReport
CrystalReportViewer1.DataBind()
CrystalReportViewer1.DisplayToolbar = false
11/10/2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment