Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Iif statement - either have a field in report or empty space
Message
From
05/09/2005 12:58:35
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Iif statement - either have a field in report or empty space
Environment versions
Visual FoxPro:
VFP 8
Miscellaneous
Thread ID:
01046801
Message ID:
01046801
Views:
63
Hi Everyone:

I'm having a problem with a specific bit of code here. I'm hoping someone might be able to help me.

i want to evaluate a condition, and if the condition is true, the report will print a field. if it evaluates to false, it will skip to the next field and print the next field on that line.

the report is generated by a select command into a cursor with the report being created by the cursor.

specifically, the code looks something like this:

select firstfield, iff (fieldname = 1, "___________" as report_label, ""), lastfield, into cursor cursor_name

create report report_name from cursor_name form

I want the field to simply be the underlining, and the label to be report_label. if fieldname <> 1, then i want it to skip that line and print the lastfield on that line.

What i want:

if fieldname = 1:
firstfield
report_name _______________________
lastfield


if fieldname <> 1:
firstfield
lastfield

currently, i am getting "missing comma". i've fooled around with it and have been able to get it so that it doesn't give me that error by putting quotes around the entire exp2, but it still isn't what i'm looking for.

any help is greatly appreciated. thanks.

paul
Next
Reply
Map
View

Click here to load this message in the networking platform