hi
I tried the above programe and I'm getting two errors before debugging..
One is @
Dim rptDailyCollection As New rptReport()
here I tried with my rpt file
'DailyBalance.rpt' --> report name
here I'm getting 'Daily Balance is not defined'
The second one is @
Dim daDailyCollection As New SqlDataAdapter(sql, con)
here I'm getting 'Overload resolution failed because no accessible 'New' can be called without a narrowing conversion....
Please help me ... I'm using Oracle database...
A small snippet..........try this.........
Add a Report to the project. say rptReport
Add a CrystalReportViewer object to the webform
add a button and in the click event write the following code
- Dim rptDailyCollection As New rptReport()
-
-
Dim dsDailyCollection As New DataSet()
-
-
con = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("dsn"))
-
'Dim sql As String = "Select * from dbo.DailyCollection(" & CDate(lblCollectionDate.Text) & ")"
-
-
Dim sql As String = "Select * from dbo.DailyCollection(@CollectionDate)"
-
-
Dim daDailyCollection As New SqlDataAdapter(sql, con)
-
daDailyCollection.SelectCommand.Parameters.Add(New SqlParameter("@CollectionDate", SqlDbType.SmallDateTime, 4, "CollectionDate"))
-
daDailyCollection.SelectCommand.Parameters("@CollectionDate").Value = CDate(lblCollectionDate.Text)
-
-
daDailyCollection.Fill(dsDailyCollection)
-
rptDailyCollection.SetDataSource(dsDailyCollection)
-
CrystalReportViewer1.ReportSource = rptDailyCollection
-
CrystalReportViewer1.DataBind()