Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help blanking out not used (sum) field based on IIF
Message
From
30/08/1999 00:04:25
 
 
To
29/08/1999 23:47:47
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00259025
Message ID:
00259031
Views:
23
output **** as you ask the field to sum up some non-sumable value!

You can also create a Report Variable at Report Designer Menu

set a variable: eptime

as a SUM of emp.time and it starting value is 0

Sometimes, you may need to use report variable to do some difficult task!

e.g. Give the Sum of All Orditems And a fix amount such as handling charges
Orditems Qty      RowTotal
abc        1         125.5
def        2         568.2
ghi        3         822.9
--------------------------
handle charge        250.0

      Total:        1516.6
You can't direct make a single field to sum up them!

I fix this problem by using 3 report variables, SumOrditems, HandCharge, FinTotal!

In previous method, I tried to use one expression:

Rowtotal + (HandCharge / RECCOUNT) and try as SUM UP to all.

but as round up problem, the last cent value is calculated wrongly!!




One more tips to you, if you want to try out what will show in report:

put the print condition:

Version(2) = 2

this field only show when you run the report within VFP but hide in Run-Time exe
This is Fully help to trace the report calculation right or wrong!!

~_^ Good Luck!


>Thanks,
>
>That worked fine... it's frustrating as a newcomer to VFP that there are so many different ways to do the SAME thing.
>
>
>
>
>>>I have a report that has a field that is a currency sum printed in a GROUP footer. Based on info in another field, sometimes this field is blank and the customer would prefer it to NOT be there instead of $0.00.
>>>
>>>I was able to add a IIF to the expression for the field as follows...
>>>
>>> IIF(codetype="Administrative",emp.time,"")
>>>
>>>emp.time is the amount field. The properties are set for SUM and currency for the format. When this field comes to print - if the codetype="Administrative", I get the appropriate summed amount... if it is not "Administrative", I get ******. I tired changing the "" to null, 0, and also setting the IF BLANK REMOVE LINE to yes. None of these seem to work.
>>>
>>>Suggestions?
>>
>>

>>
>>Why not simply Set the Print Condition
>>
>>DoubleClick to edit the field!
>>Click on Print Condition.
>>
>>Fill in:
>>codetype="Administrative"
>>
>>This will appear If and only If the condition statement is true!
>>
>>^_~
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Reply
Map
View

Click here to load this message in the networking platform