BaanMessenger
22nd April 2007, 21:57
hi there,

i have some problems solving this matter, i hope somebody could help me..

in my report there are some columns, this is output from the query like...

variable1 vaiable2 variable3
10 20 30
30 40 50
40 49 59
tot 80 109 139

now the problem is how can i put the total into variable like this..

tot1 = 80
tot2 = 109
tot3 = 139

so that i could have used it for factor like, tot1 + tot2 / tot3

i know this seems so easy for someone out there, pls help.....i tried some idea but it gives me the first row only like..
tot1 = 10
tot2 = 20
tot3 = 30

tnx a lot...

mr_suleyman
22nd April 2007, 23:58
Hi
I think that you used total function on report field option. AFAIK you would keep each total into a variable.
Firstly open report script,
define variable tot1,tot2,tot3

declaration:
domain tcqiv1 tot1, tot2, tot3

For example if you print each field on detail.1 then you should also add followings into report script.


detail.1:
after.layout:
tot1= tot1 + field1value
tot2= tot2 + field2value
tot2= tot2 + field3value

lastly , compile your report script and don't forget to add those fields on after.report layout to see total values on report.
That's all .

Hitesh Shah
23rd April 2007, 17:16
When u use the total function in Baan report , Baan report declares the same as total..0 , total..1 etc variable . If u wish to use this total..X variable in the same layout , u can do so by using the same in print expression .

If how u want these values in other layout before that totals are printed , u can get by 2 ways .

1. Using print conditions , introducing a higher sort field say sumflag (say a byte variable ) , duplicating rprt_Sends with sumflag = 0 and sumflag = 1 each . I do not recommend this bcos it's slower way of doing it .

2. Another way is to total the same in program in external variable and import the same in report script . Remember these variables should not be used as input variable . Instead it must be declared in report script . This will definitely be a faster way .

BaanMessenger
5th May 2007, 00:29
Thanks to all of your help and sorry for the late reply.

Yes sir, i have used the total function in report script and i got it right what you have told in report script, actually this is a summary of the report, i removed the details on the reports and remained only all the subtotals, by that subtotals to make it for a total again i have used

field.fieldname.1:
before.layout:
tot1= tot1 + field1value,

and it works really fine.....but i still have one problem, in one of that column, there is one column which is not working, it seems it gives me a random total, let say, totals must be like this way;

subsubtot1 = value of variable1, subtot2 = value of variable2, subtot3 = value of variable3,

but it gave me in this format;

subtot1 = value of variable2, subtot2 = value of variable3, subtot3 = value of variable1,

for me it is really weird, i adjusted the sorting mode from asc to desc and pre but still i cannot get in this format;

subtot1 = variable1, subtot2 = variable2, subtot3 = variable3,

Thanks in advance Sir, i hope my post dont confuse you.

en@frrom
7th May 2007, 14:50
Looks like you confused your fields in your code... Can you post us your code?