Trying to show a Crystal Report at WebForm1.aspx

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?
 
B

Big Charles

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top