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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding A Report

Status
Not open for further replies.

jmnewbie

Programmer
Dec 17, 2003
5
US
I'm using Crystal Reports with .Net. In my Page_Load event, my code goes to the database gets the data for the report in the form of a dataset, sets the reporSource and then binds

Dim cr As payCoverageCry = New payCoverageCry()
cr.SetDataSource(ds)
CryRptPayCoverage.ReportSource = cr
CryRptPayCoverage.DataBind()

The report comes out fine. Each time I select a new page in the report, my Page_Load event fires off and the call to the DB is done ect.. I tried using a If not page.IsPostback with the thinking that the report has all it's data, therefore I need only get the data once. When I did that and I navigated to the second page, it just showed the CrystalReport VIewer object on the web page. So I'm thinking I'm not placing my code to bind the report in the right place. Or is this how it's suppose to work?
 
I've only played with .NET, but Crystal does have caching to allow for quicker loading of reports.

One workaround I've exploited in the past is to place the totalpagecount on the first page, forcing Crystal to execute the entire report prior to displaying the first page.

It does add an extra pass to the report.

-k
 
It seems as though for every subsequent page of the report I navigate to, I have to go back to the datbase and rebind the report. Is that right? That sucks!

 
So what I'm doing now is just caching my dataset. If the cache object exists, then I don't back go to the database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top