Trying to show a Crystal Report at WebForm1.aspx

  • Thread starter Thread starter Big George
  • Start date Start date
B

Big George

Trying to show a Crystal Report at WebForm1.aspx:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
showReport()

End If
End Sub

Private Sub showReport()
' Filling DataTable
'...
crReportDocument.SetDataSource(MyDataTable)
CrystalReportViewer1.ReportSource = crReportDocument

End Sub

Crystal Report shows on the web page very well. But if you click on
link page number 2, trying to get the next page, WebForm1.aspx will be
reloaded again, as page.ispostback. Then I can't see any more pages but
page1 of my Crystal Report. How could I show a Crystal Report, please?
 
Using Session is the only way ?
Like:

'oRpt is a ReportClass
If Not Page.IsPostBack Then

Me.oRpt = context.Items("oRpt")
Session("oRpt") = Me.oRpt

showReport()

Else
CrystalReportViewer1.ReportSource = Session("oRpt")
End If

End Sub

And performance?
 
Back
Top