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

whats the fastest way to get data.. 1

Status
Not open for further replies.

asimasm

Programmer
Nov 27, 2000
62
0
0
AU
I have designed several reports using crystal reports. But i want to know what is the fastest way of getting the report data to get displayed. Bcz when there are lets say a million records in the Database and u have to print some of them then Crystal reports takes ages to get it displayed. I use selection formula method for filtering the records. I am also using SQL Server Database and my application is designed in Visual Basic.


 
This is probably not the fastest way, but perhaps you can use some of it:

1) Don't use ODBC if you can avoid it. It's really slooow.
2) Use SP/RCP and do most (if possible all) calculations on server; only return data you have use of (the server is usually more powerful and less data is transmitted reducing bottle-necks).
3) Use SQL statements that are not logged (i.e. Select, Select Into, Bulk Copy).
4) Use multi-threading in your application if possible - let larger operations work in the back-ground with low priority so users can continue work.
5) If you use multi-threading, do not use long loops without calls to 'sleep' or 'wait' command as this will block user interaction.

If you have 1 million posts, there is no fast way to select into Crystal Report - my experience is that CR is a slow turtle only effective for smaller report presentations.
 
A few additional tips:

1. Don't use "Page M of N" or any other function that requires late-time computation.

2. If you're running through a million records on the back end and you want output to show up quickly, you'd best do as little grouping as possible (even with grouping on the server side).

3. In general, if you've got that big a data source on the back side, the only way you'll get something to show up quickly on the front side is by removing all grouping and sorting from the report so it's a straight data pull. Otherwise, the time requirements for sorting and/or grouping will be demonstrably noticeable to the viewer.

4. Outside of those notes, I heartily concur with the previous poster. Stored procedures on the back side are the way to go; they make most efficient use of the server capabilities and minimize the amount of work required at the client side before Crystal can show the first page.

Richard A. Polunsky
Houston, Texas


 
One of the enhancements added in CR8.5 is "Report Streaming" - that is the page server (the server component that executes on-demand reports) will start to return data to the viewer as soon as it is ready. Ie. basic DB fields can be returned as they are read in pass 1, while Page N of M or % or total calculations are returned during/after pass 2. If a page needs data that is not available, holder frames will be displayed with "Data not ready" or some such message.

I think this only works in the ActiveX viewer. I'm not sure about Java and pretty sure it's not supported in DHTML.

To see this behaviour, run the World Sales Report (one of the supplied sample reports) in on-demand mode in the ActiveX smart-viewer. Note the pie chart is not initially displayed, but drawn in later - but you'll have to be quick to see it ;-)

Cheers, Alan Eldridge
Melbourne, Australia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top