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!

Shared Variable Problems

Status
Not open for further replies.

Shin25

Technical User
Jun 14, 2007
102
US
Hi All

I have a basic Crystal report, which has 2 field placed at report detail level. First field is a
month field (number datatype). The second field is a string field.

I have made this formula a shared numbervar as this standalone report will get integrated as a
subreport into a main report. But when I run this report as a standalone my formula does not
bring back correct values even though I find the criteria correct.

My formula

WhilePrintingRecords;

If Previous({stringvalue}) = 'Y'
THEN

Shared NumberVar Monthfig := {month}
Else

Shared NumberVar Monthfig := Previous({month})

When I restrict the {month} field through select expert, to a month the above
formula comes back incorrect whilst when running all the above formula is correct. I dont quite
understand whats going on?

Any ideas?

Many Thanks.
 
If there is only one month, then there is no previous month. Can you explain what this formula is intended to do? And what the subreport is meant to do?

-LB
 
Currently I am running it as a standalone report. Basically if the previous {string} value = 'Y' then the {month} else the previous {month}. But when I am testing for eg. I select expert and pick one {month} 200412 my below formula
just brings back a blank. Where as if I break the below formula down I am getting correct values.

WhilePrintingRecords;

If Previous({stringvalue}) = 'Y'
THEN

Shared NumberVar Monthfig := {month}
Else

Shared NumberVar Monthfig := Previous({month})

I hope I make sense.....please advise....

 
Please try again to explain the point of this.

Yes, you will get a blank because the formula can't execute when you choose one month, as there is then no previous month.

-LB
 
thats brilliant lbass....thats make more sense to me....got alot of different things running, just abit crazy....

Many Thanks...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top