Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can only view 1st page on crystal report viewer

Status
Not open for further replies.

MzKitty

Programmer
Oct 28, 2003
254
US
I am using vs2008 and crystal 10.5. I'm writing a web application for my company and am having problems when I bring up a Crystal Report on the viewer web form. The report is 43 pages, but when I click on next page, I still get the 1st page. I can have the report automatically print, but the current (Access based system) allows the user to preview the report and then print it. Here's a copy of my source on my webpage with the crystal report viewer.

Imports CrystalDecisions.Shared
Imports CrystalDecisions
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.CrystalReports
Imports CrystalDecisions.ReportSource

Partial Public Class frmInvStatus
Inherits System.Web.UI.Page
Public crReport As New InvStatus
Dim printer As System.Printing.LocalPrintServer

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
crViewer1.Visible = True
'CrystalReportSource1.ReportDocument.PrintOptions.PaperOrientation = intOrientation2
crReport = New InvStatus
crViewer1.Zoom(100)
crViewer1.ReportSource = crReport
End Sub
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

'CrystalReportSource1.ReportDocument.PrintOptions.PaperOrientation = intOrientation2
crReport = New InvStatus
crViewer1.Zoom(100)
crViewer1.ReportSource = crReport
End Sub

Protected Sub cmdExit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdExit.Click
Response.Redirect("Report.aspx")
End Sub
End Class

There's not much to it, but I can't get the dumb thing to page!

Thanks for any and all help.
Cathy
 
First, why do you have this code in both the page_init and page_load events?:
Code:
   crReport = New InvStatus 
   crViewer1.Zoom(100)
   crViewer1.ReportSource = crReport

Second, that code should be wrapped in a Page.IsPostBack IF:
Code:
   If not page.IsPost Back Then
      ... your code here
   End if
 
You were right. I had my code in the form_load and it should have been in the form_init. I changed it and everything pages like it should! DUH! Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top