Brainbeats
June 26th, 2006, 01:12 AM
Dear Gurus
i have a problem with crystal reports.iam using asp.net and datasets to dynamically display the reports.if i use server.mapath for displaying the report i can access the toolbar controls(i.e refresh,zoom etc)but when iam accessing the data through dataset iam unable to access these toolbar controls.i have attached the coding .
Can anyone please give me a solution for this problem
Dim qry As String = "SELECT * from RFC_Header where RFCHead_Submission_Date between '" & txtFdate.Text & "' and '" & txtTDate.Text & "'"
Dim da As New SqlDataAdapter(qry, sqlcon)
If txtFdate.Text <> "" And txtTDate.Text <> "" Then
sqlcon.Open()
Dim ds As New DataSet
da.Fill(ds, "Rfc_Header")
Dim cr As New rptReqAnalysis
cr.SetDataSource(ds)
CrystalReportViewer1.ReportSource = cr
cr.DataDefinition.FormulaFields(0).Text = "'" & txtFdate.Text & "'"
cr.DataDefinition.FormulaFields(1).Text = "'" & txtTDate.Text & "'"
sqlcon.Close()
Else
CrystalReportViewer1.ReportSource = Server.MapPath("rptReqAnalysis.rpt")
End If
i have a problem with crystal reports.iam using asp.net and datasets to dynamically display the reports.if i use server.mapath for displaying the report i can access the toolbar controls(i.e refresh,zoom etc)but when iam accessing the data through dataset iam unable to access these toolbar controls.i have attached the coding .
Can anyone please give me a solution for this problem
Dim qry As String = "SELECT * from RFC_Header where RFCHead_Submission_Date between '" & txtFdate.Text & "' and '" & txtTDate.Text & "'"
Dim da As New SqlDataAdapter(qry, sqlcon)
If txtFdate.Text <> "" And txtTDate.Text <> "" Then
sqlcon.Open()
Dim ds As New DataSet
da.Fill(ds, "Rfc_Header")
Dim cr As New rptReqAnalysis
cr.SetDataSource(ds)
CrystalReportViewer1.ReportSource = cr
cr.DataDefinition.FormulaFields(0).Text = "'" & txtFdate.Text & "'"
cr.DataDefinition.FormulaFields(1).Text = "'" & txtTDate.Text & "'"
sqlcon.Close()
Else
CrystalReportViewer1.ReportSource = Server.MapPath("rptReqAnalysis.rpt")
End If