Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report Print When a Cursor not open
Message
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01548682
Message ID:
01548686
Views:
48
>>>>Hi,
>>>>
>>>>I would like to be sure that I am understanding one aspect of VFP reports. I have a report where the General tab has teh following:
>>>>
>>>>MyCursor.FieldName
>>>>
>>>>
>>>>I have the following The Print When expression
>>>>
>>>>select("MyCursor") > 0
>>>>
>>>>
>>>>I thought that if the cursor MyCursor is not open VFP will simply not print this field. But I get run-time error. Does it mean that VFP report evaluates the General expression of the report before the When?
>>>
>>>Most likely. Is there a reason to use such an expression? You need to have all your cursors before the report is run.
>>
>>I was hoping to get away with not have to have this cursor. But now I am changing the design and will have the cursor open even if I don't want to print this field. Keep in mind that this "report" is actually a form print-out (one page). And some sections of this form do not need to be printed.
>>Thank you.
>
>The alternative solution may be (needs testing) to use this expression for the field
>IIF(used('MyCursor'), myCursor.myField,'')

I thought about this approach too. But decided that I will create this cursor for any case. And then use another "When" expression to not to print what is not necessary. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform