Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Performance Issue using Parameters Post Reply Post New Topic
Author Message
newbie
Newbie
Newbie


Joined: 10 Jul 2007
Online Status: Offline
Posts: 29
Quote newbie Replybullet Topic: Performance Issue using Parameters
    Posted: 02 Aug 2007 at 8:39am

Hello,

I designed a report which is having 4 parameters.  I used the Database tables to make the report(not used Command object).  When I execute the report without parameters it took 7 mins(same in TOAD).  Thats fine. 
The problem is, the report takes same time(7 mins) with the parameters too.  The TOAD return results with parameter values just like that.
 
It seems like the report may be pulling back all records and then applying Parameter values and filters etc.
 
How to obtain the performance of this report when parameters are used.  I appreciate your help.
 
Thanks
VK
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 02 Aug 2007 at 9:46pm
It depends on how you create the record selection formula. It must be very simplistice for CR to convert it into the SQL WHERE clause. I  don't know what TOAD is. Could that be forcing it to return all the records?
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
newbie
Newbie
Newbie


Joined: 10 Jul 2007
Online Status: Offline
Posts: 29
Quote newbie Replybullet Posted: 03 Aug 2007 at 1:19pm
Thanks for your reply. 
 
Here is the solution after doing many Trials.
 
***Remember this works only for data type "STRINGS".  I'm working on Number data type values.
 
Set the values Inside a Parameter field.
 Value field :- select the Database column (Don't press insert)
 Default Value :- All
 Custom Values :- True
 Multiple Values:-  False
 
In Record Selection Formula
(If Instr({?My_Parameter},'*') > 0 then
{Table.ColumnName} Like Uppercase({?My_Parameter})
else if (uppercase({?My_Parameter}) = "ALL" ) then
TRUE
else
{Table.ColumnName} IN Split({?My_Parameter},',')
)
This works for all possibilities of Parameter values with Single value, Multiple values separated by comma, wild card match(SCOTT*), All records.
 
Now you can view the parameter values as a part of SQL Query.
 
I would like to share this with all of you.  Big%20smile
 
VK
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.