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

which one is efficient and faster 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
The reports i am working on uses five or six tables. The size of all these tables i mean the number of records is very big. Tell me which method is very
efficient and faster.
1. Directly select all tables from crystal reports and code the selection formula in Report --> Edit selection formula --> Record to filter records.
2. Make view which has all the tables involved and add the where conditions so that the records are filtered at server side.
For eg create view like this
select col1, col2, col3, col4........
where table1.prikey = table2.forkey and
table1.key1 = table3.key2 (+)......
Now use this view in stored procedure and depending on the user input, records can be filtered by using the stored procedures parameters. The records returned by stored procedure can be used by crystal reports.
I think the second method will be faster as records are filtered at server. In first method all the records are loaded......then the records are filtered by crystal reports. The difference is in first method records are filtered at crystal reports and in second method records are filtered at server. Help me if i am wrong.

Thanks

Satya.
 
Crystal will generate a SQL statement for the server, and some of the criteria will make it into the WHERE clause, but a view or Stored Procedure will usually be more efficient. To see the SQL that Crystal is sending use "Database - Show SQL" Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
It sends the SQL to the server before the data is being loaded or after loading, the data is filtered by crystal reports ?

Thanks


 
The SQL that you see within CR is sent to the server before CR sees the data, that is how the data is generated. Check the WHERE clause to see what parts of your report criteria are making it to the server. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top