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

help with variables?

Status
Not open for further replies.

dandman71

MIS
Aug 14, 2002
14
US
I am a convert from RRW to Crystal due to Software changes at my work. When I used to use database linking, I could apply a variable scope, so that if I was scanning a employee database,say by number, I could scan only those databases with that employee number 101-103, not all of the databases 101-199. If I use the selection Rule, it still scans them all. Trying to cut down on computing time, Any help? Thanks
 
I assume by databases you mean a table.

To filter rows returned to Crystal, use the record selection formula (Report->Edit Selection Formula->Record

Place something like:

{Employee.ID} in [101 to 103]

You can also create a parameter, or multiple parameters to allow for entering the rows of interest (Insert->Field Object->Right Click Parameter Fields-New), and then reference the parameter(s) in the record selection formula, allowing for user input:

{Employee.ID} in {?MyIDs}

The parameter type should match the data field type that you're comparing to

Hope this helps.

-k
 
Will this scan the entire database, or just the records that equal that number? Thanks for the quick response. IT is very helpful
 
Hello,
I do not know what version of CR you are using.
I started with 8.5 and it allows you to somewhat
control how your SQL statements are run:

- your can force CR use indexes (if they are available)
(check box on File->Options and Report Options screen);

- can force CR make grouping on the database server
(check boxes on the same File->Options screen);

- by programming your selection formulas adhereing
to some simple rules (please see CR User's guide)
you can make CR push these selections down to the
database server (i.e. include them in the
'where' clause of your report query).

Good luck.

Henry Monster.
 
Dear Dandman71,

Thought I would add somne info to HenryMonster's tips:

The Use Indexes or Server for Speed is actually two options one applies to "files" (Indexes) and the other applies to ODBC/Native connections using SQL (Use Server for Speed). If you do not have this checked, your SQL will not pass to the database!!! No Where clause will be generated.

The Perform Grouping On Server is only valid if you are displaying a Summary Report. A summary report is one where only Groups are displayed and Summary values at the Group Level. The details are suppressed or not retrieved. In only this instance will this option checked allow the SQL to contain a Group By.

He is right, there are some simple rules you can follow that can help to ensure that your SQL get's passed to the db. SV has posted extensively in the Crystal 1 and Crystal 4 forums, do a Keyword Search on Pass SQL and you should get a wealth of information.

Hope that is helpful,

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top