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

Can't reference a formula using shared variables

Status
Not open for further replies.

peteriannetta

IS-IT--Management
Mar 11, 2001
41
AU
Hi, firstly, happy festive season and thanks for a great site - an excellent resource!

I'm using CR 8.0 and I have a main report, with a subreport in the report header (so it evaluates first).

I've found that after declaring formulas with shared variables AND then using that formula in another formula, that both the original formula and the referencing formula no longer appear to be accessible. For instance, I can't reference them in a cross-tab or in creating a summary field.

I'm not sure why this is and it is hindering my report big time. Can anyone shed light on why this might be happening?

Thanks,
Pete
 
I think a crosstab is a seperate beast from the data in details, etc. since it uses it's own groupings, etc.

When you say that you can't access them using a summary field, what does this mean? Perhaps you mean a formula which uses a SUM function, or by right clicking a field and selecting Insert->Summary?

Rather than explain what you believe Crystal not capable of doing, please describe what it is you need to do.

This will work:

RH: subreport creates a shared variable.
whileprintingrecords;
shared numbervar MyValue:= {table.field};

Group Footer formula:
whileprintingrecords;
shared variablevar MyValue;
shared variablevar MyValueTotal:=MyValueTotal-MyValue;

Report Footer:
whileprintingrecords;
shared numbervar MyValueTotal;

For what good that does you, you've given no indication of what you need.

-k
 
Thanks for your response.

All I'm trying to do is use the value in a shared variable in a subreport in another formula in the same subreport. And then utlimately, these two formuals will be used in the main report.

By "can't access", when I try to insert either of these formulas in a cross-tab, the formulas don't appear in the field listing at all. However, if I remove the reference to the shared variable formula (or indeed, make the variables "not shared") then the fields suddenly appear.

Cheers,
Pete
 
Either of what formulas?

As my original post intended to state, it may not work within a crosstab. You haven't posted any formulas, nor where this second subreport is, what the output requirements are, etc.

You might create a manual crosstab, but again, there's nothing about requirements, just what doesn't work.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top