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

Using Shared Variables in Formulas 1

Status
Not open for further replies.

IrwinHunter

Technical User
May 30, 2001
12
GB
Using CR8

Is it possible to query the results of a formula field if it uses the results of a shared variable in the formula?

I've done my If Then Else formula based around the results of a shared variable. However, when I go into the select expert and look on the list of Report Fields, the formula I've set up and placed on the report does not appear. Other formula fields appear but they do not contain variables of any kind.

Is this possible or am I not thinking correctly and doing something wrong?
 
No, a shared variable occurs whilePrinting and can't be used for selection. Post the formula and a description if you would like us to explore a workaround. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Thanx for your response Ken!

I need to find which records on my subreport match the records on my main report. I did a shared variable in my main report to display the record's unique reference number which I thought would allow a comparison to be made with reference numbers in the sub report.

My formula looked like:

If
{Ref} = Shared NumberVar Ref
Then
"Hit"

I was then going to query the formula field to bring out those that returned a response of "hit" - therefore finding the duplicates! Or so I thought.......

If you could shed any more light on this Ken, I would be most appreciative.

Am I just going about this the wrong way?

Cheers
 
If you create a parameter in the subreport you can select on the parameter and then LINK the parameter from the subreport to a field in the main report.

When you add a subreport there is a LINK tab, that allows you to match a field to a parameter. If the subreport recurs, it will take a value from the current record each time. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Thanx again Ken!

When linking sub reports to a main report it's like an equal join right?

Can you change the join types so that you have a 'not equal to' type relationship?
i.e. if I want to find out which records on my sub-report don't appear on my main report

Cheers
 
The link isn't really a join, but is a parameter used for selecting records. If you open the select expert in the subreport and look at the criteria used you will see what I mean. It will probably have defaulted to Equal To, but you could change it to:
Not Equal To
StartsWith, etc 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