Leenaa
6th February 2003, 12:30
hi all !

I m facing a problem ,
in my program i don't want to show those supplier whom balance is less than 25 ,
i hv done this by:

after.suplier field
if balance <25 then
lattr.print = 0
endif

but by doing this it's not showing the correct grand total

What should i do?

zardoz
6th February 2003, 13:06
Just use two differents layouts for after.field, using the output expression for the first one "balance >=25" and for the other one "balance < 25".
Keep the number of lines of the second one equal to 0 (DON'T EDIT IT).
Remove the condition from the report script.
The total sum must be correct now.

morpheus
6th February 2003, 13:43
Leena,
You must be using aggregate function on the field, and the grand total must be adding up all the amounts. lattr.print suppresses the print, but the aggregate function considers all the records. So, instead of putting a control in the report format, try adding the amounts in the script (as per the logic), and print that variable in "after.suno".

Youp2001
6th February 2003, 13:59
Why make things so difficult.

You were on the right way. You can suppress the lines to be printed by adding a condition (balance > 25) on layout level or by adding the condition in your script.

Then you define a layout for your total. Use the same variable as the balance variable in your detail, but make it a total field (aggregate function). Then define the condition in the where. This condition must be similar to your print condition. So if you want to totalize all amounts > 25 then enter in the where expression: balance > 25

That should do it