crystalreportviewer and paging
Hi everyone,
I am trying to use crystal report in asp.net. reports first page is displayed successfully but when I go to the next page report is not displayed but instead a report viewer control is displayed. If I try to refresh the report then also the report viewer control is displayed. Only the first page works fine. I was wondering if there is any paging control in crystalreportviewer.
This is the code that I am using
Dim oConnection As New SqlClient.SqlConnection("server=(local); database = test; Trusted_connection=yes ")
oConnection.Open()
Dim contentType As String
Dim oCommand As New _
SqlClient.SqlCommand("select * from tmpRptCheckRegister", oConnection)
Dim ds As New DataSet()
Dim oDataAdapter As New SqlClient.SqlDataAdapter(oCommand)
oDataAdapter.Fill(ds, "oClaims")
Dim rpt As New CrystalReport1()
rpt.SetDataSource(ds.Tables("oClaims"))
CrystalReportViewer1.ReportSource = rpt
This code works fine because data is coming in the dataset and first page is displayed sucessfully. I tried to keep this code inside the isnotpostback statment and also outside the if isnotpostback statemnet. It shows the crystalreportviewer if it is inside the If isnotpostback statement and it keeps on showing page 1 after refresh or when I try to go to next page when I keep this code outside the if notpostback statement.
Any help will be greatly appreciated.
|