I am writing the following code in crystal report viewer page load event to show the report.but "myReportDocument.Load(Server.MapPath(Reportname.rpt))" this line take too much time to load.What's the pblm.How can I solved this pblm.I use SAP crystal report ,ASP.net.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If IsPostBack Then
CrystalReportViewer1.ReportSource = Session(report)
End If
Dim myReportDocument As New ReportDocument
Dim strCmd As String = ""
Dim ds As New DataSet()
Dim SqlConn = New SqlConnection(ConfigurationManager.ConnectionStrings("cnDB").ConnectionString)
SqlConn.Open()
Dim dCmd As New SqlCommand()
dCmd.Connection = SqlConn
strCmd = "SELECT * FROM Table" & Request.QueryString("strOption1")
Dim da = New SqlDataAdapter(strCmd, SqlConn)
da.Fill(ds, "Table")
myReportDocument.Load(Server.MapPath("Reportname.rpt"))
SqlConn.Close()
myReportDocument.SetDataSource(ds)
CrystalReportViewer1.HasCrystalLogo = False
CrystalReportViewer1.HasToggleGroupTreeButton = False
CrystalReportViewer1.HasToggleParameterPanelButton = False
CrystalReportViewer1.Zoom(100)
CrystalReportViewer1.ReportSource = myReportDocument
CrystalReportViewer1.DataBind()
CrystalReportViewer1.RefreshReport()
Session.Add("report", myReportDocument)
End Sub