How To #3 – highlight (bold/underline) fields in Baan reports programmatically ? #baanhowto
How to highlight fields in Baan reports programmatically?
Lot of times, there is a requirement to conditionally underline / bold / bold&underline a specific report field. This can be achieved very easily in BaaN using the function cf$()
string cf$( long attribute_code )
This pre-defined function is used to send a control code to the current window or printer. All characters after the command are printed or displayed in the font associated with the control code. To reset the font to normal, call
Some of the commonly used codes are
|9||bold & underlined||bold & underlined|
Lets take an example which will make the usage more clear
eg. Make the project bold & underlined if the project is not active.
In the code snippet below, note that domain “tccprj” not used, instead “tcmcs.str8” is used.Assuming the environment is BaaN IV, the domain length for project is 6, unlike 9 in LN.The domain used for the variable is of length 8. This is to accomodate 2 more characters for making the project appear bold & underlined in the report and to avoid truncation of characters.
domain tcmcs.str8 r.cprj |* Assuming the field will be printed in detail layout detail.1: before.layout: if not PROJECT.ACTIVE then r.cprj = cf$(9) & PROJECT & cf$(0) else r.cprj = PROJECT endif