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!

Regarding Performance

Status
Not open for further replies.

Rissole

MIS
Jul 10, 2002
21
US
Hi ...

Can anyone help me telling what's the better way of using a crystal report from VB.

I simply put the CR control on user form and sets its "Connect", "ReportFileName" & "SelectionCriteria". After performing "Action = 1" the report runs.

The table contains more than 5 million records which CR Control brings to the Report and then it performs the Query, therefore the result is too slow.

Please do let me know whats the better way of doing this.

Thanks in Advance,
Shuja.
 
What version of CR are you using? 8.5 is much faster than earlier versions.
Depending upon the database, turning on Asynchronous query on the report and the db can speed up view of first page.
If you have page X of Y it will slow thing right down as all formatting will need to be done.
Do you need all 5 million records or can you filter using a parameter or selection formula?
Is it a grouped report? If so turn on perform grouping on server.
Are you using the old OCX - don't! Use the RDC - much faster and without the memory leaks.
Andrew Baines
Chase International
 
Report Design Component. It was introduced in CR7 after a limited version was available for CR6.
It allows you to integrate a report designer within the VB design environment.
It's easier to use than the earlier Automation Server interface and more stable than the OCX. Andrew Baines
Chase International
 
Your selection criteria probably isn't getting passed through to the database, which is why you get back too many rows.

There are numerous threads about creating a selection criteria, your best bet is to open the report and code the selection criteria in there until you understand how to pass the SQL through.

I suggest the following tips:

Wrap each part of your selection criteria in parens

Fully qualify both sides of the argument, as in:

(example uses parameters in Crystal syntax)

(
If {?MyDate Parm} < currentdate then
{MyTable.MyDateField} = {MyDate Parm}
else
If {?MyDate Parm} >= currentdate then
true
)

Also make sure that you match data types (for instance don't pass just a date for a datetime field).

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top