How to get Best out of Baan Reports
Baan reports are very best data transformation agent if the developer knows the Baan report flow .
1. Use of sets -
Many a times Baan developer comes across a question to print a report / process logic based
on certain enum values only (which may not necessarily in from-to range). At this point of time
developer has to say no to such request (At least in Baan IV) in the absence of clear guidelines
on this. These sets can be used extensively in customization where choice list
is less than 32 and multiple selection is desired .
For such a request , if user follows following steps, he/she can accomplish the objective easily.
If users adopt bit.and() function(bit.and function approach) then the procedure could be much shorter than this and need for new dll is eliminated.
1.This step is not required if bit.and function is used.Write following function in 1 dll .
function extern return.enum.booleans(long setval, ref domain tcbool enm())
{
long i
for i = 1 to 32 step 1
enm(i) = setval \ 2
setval = setval / 2
endfor
}
2. The enums for which specific values are desired , need to be copied as a 'set' to another domain with same enum options. Set allows multiple selection.
3. Convert to runtime &Restart BW connection.
4. Forms on which specific enum values are desired , this new field with new set domain has to be included.
5. This step is not necessary for bit.and function approach.
In the program , call the funtion written in dll in before choice section of print.data or
cont.process return.enum.booleans(etol(setfield) , enm)
6. In the main processing select after selectdo , you need to add following condition before other
logic
if enm(etol(enmfield)) then
|....normal program logic
endif
People following bit.and approach can write following code
if bit.and(lpow(2,etol(enmfield)-1),etol(setfield)) then
|....normal program logic
endif
7.Also Declare enm tcbool with 32 dimensions in the same program. Not required for bit.and approach.
8.Include the dll in step 1 above before compiling the program. Not required for bit.and approach.
You have accomplished the desired objective.
Whichever way you do the coding following may be some minor side effects.
It will select all records with all enum values . In some case it may lead delayed performance.
Maximum set options could be 32 only (I have not tested beyond 32 but I feel it will not work) whereas enums could be upto more than 32 upto 127 ( as in case of domains tctror,tcfitr etc)
2.Summary Statistics
Any Kind of summary statistics is possible with Baan reports. Baan reports are versatile. It can give any kind of information from Baan (the only problem is with presentation). It is the after field section of report which gives great MIS to users. Further the same report field can be aggregated using different aggregate functions and different aggregate condition . This is something excellent. User is relieved of calculating the MIS values himself/herself. Baan report program takes care of itself . With Use of after field , lattr.print boolean, print conditions and flag variables (to be sorted in ascending/descending order of highest order) , users can achieve reasonably complex yet flexible and simple MIS very easily.
3. Weighted averages
The user needs to know the variable (e.g. total..1 , total..2 etc) which represents aggregate variables and then finally manipulate the same . When there are frequent changes to the report, this method may be disadvantageous because of changing aggregate variable.
4. Running %age
At times user wishes to see certain % values with respect to values calculated in after report section. In such a case, user should understand Baan report aggregate variable (like total..1 , min..2 etc) which is to be represented as % (Numerator) .The denominator value to be calculated in after report section has to be calculated should be calculated in program script variable declared extern (which is not a report input variable) . This is easy and can be done. Just before rprt_close or brp.close user should export this variable . This variable should be imported in report script and with the numerator & denominator values one can easily find the % values.
FastTrack to ERPJEWELS :
Latest Trend | Hot Links | Jewels of ERPJewels | Jewels of Baan | Jewels of Excel