Link to home
Start Free TrialLog in
Avatar of gueraf
guerafFlag for United States of America

asked on

how to clear shared number variable after printing

I have crystal reports 10, I have a problem,  I using shared numbervar to print each subreport for OH+PO-Orders and net position. The problem is that when you have a blank record for PO or OH it picks up the previous quantity. how can I make it not pick up a previous quantity if is blank to put a zero .

NEED to be this way                                        
example 1

OH YARDS
BLANK (NO RECORDS)

PO YARDS
BLANK (NO RECORDS

TOTAL ORDERS
250

NET POSIOTION
-250

example 2
OH YARDS
100

PO YARDS
BLANK (NO RECORDS

TOTAL ORDERS
250

NET POSIOTION
-150

example 3
OH YARDS
BLANK (NO RECORDS)

PO YARDS
250

TOTAL ORDERS
250

NET POSIOTION
0
 
example 4
OH YARDS
100

PO YARDS
200

TOTAL ORDERS
250

NET POSIOTION
50

sincerely,
rg



Avatar of Mike McCracken
Mike McCracken

WHere are you declaring and setting the shared variable?

What formulas are usig it?

mlmcc
Avatar of gueraf

ASKER

for OH subnet report is shared numbervar faboh:= {@R1SAttl}*-1- Sum ({@CM}, {zzxssumh.COLOR_CODE})
and for po subnet report is shared numbervar fabwip:=Sum ({zzcordrd.wip_total}, {zzcordrd.color_code}) and for main report i created the following for OH NET,
{@faboh}-Sum ({@GTTLyds}, {zzbbommd.bd_color}) and for PO NET, {@fabwip}-Sum ({@GTTLyds}, {zzbbommd.bd_color}) , The problem is when you have no records for OH or PO is picks up the previous quantity and add it to the existing record ..

sincerley,
rg
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial