chris_kzn
11th December 2012, 10:26
Hello BaaN gurus,
This is a very simple and more than likely silly question but I would like to know the answer anyway. I know that the command to find a line number is lattr.lineno - however, if I use this command in my script:
footer.10:
printf(lattr.lineno)
or
footer.10:
printf(lattr.lineno())
The compile portion gives an error stating that footer is defined but not used. I am wanting to try and find out what the current line number is of this field.
Should be a 1-2-3 for you gurus.
Thanks in advance.
Han Brinkman
11th December 2012, 11:53
Sounds so simply but ....
You should use a
before.layout:
after your footer.10:
to tell the report that you want to perform these statements before you start to print.
In the layout editor you can define a field in which you print the expression lattr.lineno with e.g. domain tcmcs.long.
Regards,
RedBatz
11th December 2012, 11:57
lattr.lineno is a predifined variable that gives the current line number
you can put it as a report field for testing purposes
usually I use lattr.lineno to check if I should skip to another page or another line
Example 1 - skip to line:
footer.10:
before.layout:
if lattr.lineno<60 then
skip.to(60)
endif
Example 2 - force new page:
after.field.10:
before.layout:
if lattr.lineno >55 then
page()
endif
chris_kzn
11th December 2012, 12:10
Thank you both, Han, you seem to have described it extremely well - thank you.
chris_kzn
11th December 2012, 12:44
Han,
I have a question please: I have delcared the following:
extern domain tcmcs.str10 line.no
footer.10:
before.layout:
line.no = lattr.lineno
printf(line.no)
I get some errors which I have attached. I have tried a few different methods but I cannot seem to get rid of the printf error.
I have even tried the following:
footer.10:
before.layout:
printf(lattr.lineno)
footer.10:
before.layout:
printf(lattr.lineno(line.no))
footer.10:
before.layout:
line.no = lattr.lineno(line.no)
printf(line.no)
Somehow my methodology is not yet programmed into BaaN. So your assistance is greatly appreciated.
RedBatz
11th December 2012, 13:01
lattr.lineno is a long
I'm afraid there is no function printf in Baan IV, so the error unresolved reference to functin printf
You can add this predifined variable in the report editor (lattr.lineno, domain tcmcs.long), like Han sugested. - that is the right way to print it in the report.
chris_kzn
11th December 2012, 13:17
Hello RedBatz,
Thanks for that, how would i get it to print out if BaaN does not allow printf? Do you have an exact example like above to try and assist?
Thanks in advance.
RedBatz
11th December 2012, 13:43
If I understand, your goal is to print in the footer section the current line number.
For that, in ttadv3130s000 - maintain reports, click sections button.
In session ttadv3131s000 - maintain report sections, click the footer section and click the button edit section.
the report editor opens, click menu edit -> form field and add lattr.lineno with domain tcmcs.long.
save and exit , compile the report and run the print session.
Hope this helps.
Regards
chris_kzn
11th December 2012, 14:07
perfect, thank you RedBatz.