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

how to write the array or for loop

Status
Not open for further replies.

Picture008

IS-IT--Management
Jul 27, 2006
12
IN
Hi All,

I am using Crystal 10 and database is Oracle9.2.
I am having three columns like total1 and total2 the third column is difference between total1 and total2.
so the difference is = zero then it is ok or the difference is not equal to zero then I need to populate the message in the report footer. I am able write the for single column but we have multiple columns in the difference is not equal to zero then how we can write the array or for loop fomula.
 
Sorry, I don't understand your description, try posting example data and the expected output. I won't bother explaining how your post contradicts itself, and stating which architecture must be used (loops, arrays) is probably a bad idea, just request the solution.

-k
 
example
column1_amount column2_amount column3_amount
34792.65 34792.65 0.00
2004.21 1504.21 500.00
for column3_amount is 500.00 so I need to populate the message in report footer
like $500.00 out of balance for that purticular item.
how can i write the formula to get the message.

Thank very much,
 
There aren't any items in your example data. Please show example dat aand the expected output, taking shortcuts means we have to guess. Example data means show relevant fields. Expected output means show what you expect to be displayed.

Are there multiple items?

Does this mean you'll have messages one after the other?

Is the output in the report footer of the coumn3amount the result of the sum of all column1-colum2 for each item, or is it if any of the line items have a difference?

-k
 
item column1_amt comun2_amt column_amt3
ABC 34792.65 34792.65 0.00
XYZ 0.00 0.00 0.00
MNO 2004.21 1504.21 500.00
LKG 1000.21 500.00 500.21
MESSAGE IN REPORT FOOTER WILL BE
*** OUT OF BALANCE MNO $500.00 ***
*** OUT OF BALANCE LKG $500.21 ***
AND THIS DATA IS GROUP BY ITEM
Thank you very much,
 
Try the following formula in the item group footer:

whileprintingrecords;
stringvar Output;
if sum({table.column3},{table.item}) > 0 then
Output:=Output & "*** Out of balance " & {table.item} & " $" &
sum({table.column3},{table.item}) & chr(13)

Then place the following formula in the report footer:

whileprintingrecords;
stringvar Output;
left(Output,len(Output)-1)

-k
 
Hi,
The formula you send me,
It is working fine, but getting only one line that is last line. it is not picking up multiple values.
Thank you very much,
 
Did you turn on the "Can Grow" property on the Common tab of the Format Editor for this formula?

Bob Suruncle
 
As Bob points out, you need to right click the formula, select format field and turn on Can Grow.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top