hkrisz79
26th January 2007, 10:39
Hi All!

I have a problem with a customized report.
In detail.3 it's print some fields data witch comes from the main session script ( read.general.table ).
I want to print out some additional information next to every lines in detail.4.

Something like this:

car1
colour
engine
fuel.type
car2
colour
engine
fuel.type



the "list of the cars" and the "details" are stored in diferent tables of course...
I can SELECT the datas, my bigest promlem that the report always printing only one row ( the last one ).
How can I print rows more than one from a report script ( not from the main session script ) ?


Please somebody help!

Thanks in advance!
Regards

en@frrom
26th January 2007, 10:54
In report script you should do the select query in the detail.4, before.layout section, and use layout.again() to print additional rows. You can apply the following logic:

Say your index contains the numeric field 'ccar' (code car). You declare a numeric variable hold.ccar and initialize it. In your query you write:


detail.3:
after.layout:
hold.ccar = 0


detail.4:
before.layout:
select ttmmmxxx.*
from ttmmxxx
where ttmmxxx._index1 > {:hold.ccar}
order by ttmmxxx._index1
as set with 1 rows
selectdo
hold.ccar = ttmmxxx.ccar
layout.again()
selectempty
lattr.print = false
endselect


As long as there are more records, Baan will print the detail.4 layout again (due to the function layout.again()), when the last record is printed, the query result will hit the selectempty clause, and lattr.print (predefined variable indicating whether or not the layout must be printed) will be set to false, and thus the layout will not be printed again.


Kind regards,
Eli Nager

hkrisz79
29th January 2007, 14:14
Thanks for your help!

It's solved the problem, but I had have a problem to understand how report layouts is works. You know, after field, before fields etc...

en@frrom
29th January 2007, 14:28
Pleasure! Glad I could help...