Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to conditionally print a line?
Message
From
13/08/1999 13:18:26
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00251912
Message ID:
00253517
Views:
14
>Thankyou Cindy, that should save a lot of time.
>
>>Richard,
>>
>>Read the great article about the frx structure on Markus Egger's website ( http://www.eps-software.com/isapi/eps.dll?KnowledgeBase~DisplayKBDocument~9 )
>>
>>USE MyReport.frx
>>
>>You can do a REPLACE SupExpr WITH lMyPrintWhenStatement FOR ....
>>
>>If you're not sure what to use for the FOR above you can open the Expr and SupExpr and scroll through the report table with the down-arrow key, then paste lMyPrintWhenStatement into the SupExpr.
>>
>>Definitely faster than doing all of the controls individually through the report designer!
>>
>>Another thing which you may do at some future point is to copy your report format to a temp file, modify it by a program, and print from that - say month-end reports need to be in green ink or something.... REPLACE all of the color fields....
>>
>>The implications of treating the frx like any other data table offer a lot of possibilities!
>>
>>
>>
>>>I have a detail line in a report that I would like to print only a given set of conditions are true. I found that I can set the 'Remove line when blank' and 'Print When' conditions of each individual field. However when I have a large number of fields this method is very cumbersome.
>>>
>>>Does anyone know of a better (easier) way?

Hi Richard:

PMFJI: Cindy's thoughts are great -- GenRepoX stuff on Marcus's site may help as well, but I can't help but wonder if it might be more straightforward to just put the data into a cursor that only has the detail records you want. Then, no other monkeying around is needed. If a straight SQL select isn't adequate, you could make the result an updateable cursor and then spin it to delete the records you don't want, and then report from the updateable cursor...

That is my preferred approach, and usually makes for easier FRX maintenance without all that hidden code you might forget about in the future when trying to figure out why your latest change doesn't give you the results you expected... In the R&R report writer world that idea is called a 'composite record', and has just what you want in it for all sources. No multiple tables linked -- just generate and populate a field for every item on the report in each record and only include those records to be reported. Food for thought.

HTH

Rob
Previous
Reply
Map
View

Click here to load this message in the networking platform