mojays
12th July 2007, 14:09
Hello,

Following situation:
I have a report with several before-, detail-, after- and footer-sections.
One detail I have to print more than one time:

In the before.layout section I determine the data (or set lattr.print = false, if no more exists) and in the after.layout section I call layout.again().

Problem:
If a page break occurs within the loop, the before.field-sections are not printed...

Some ideas?

Kind regards...

Martin

en@frrom
12th July 2007, 15:24
You seem to contradict yourself. First you say it is concerning a detail-layout, then you mention the problem of before.field-layouts not being printed in case of a page break...

Please clearify...


Regards,
Eli Nager

mark_h
12th July 2007, 15:36
How about posting the code also - someone may see what you are talking about.

mojays
12th July 2007, 15:38
I did not think, that I contradict myself:

The detail is printed several times by layout.again().
After a page break the report continues printing the detail. So far as good.
But it continues immediately!! That seems to be incorrect.
After a page break, first the before.field-sections (and headers) must be printed before continuing with the details...

mojays
12th July 2007, 16:00
How about posting the code also - someone may see what you are talking about.

Well... there is not much code:

detail.10:
before.layout:
domain tcbool more.data.present
|... determine data
lattr.print = more.data.present
after.layout:
layout.again()


Additionally there is a before.tdsls041.pono.10 section with header informations which should be printed before each order line AND additionally on top of each page (>>> NO lattr.break condition!).

All detail.10 layouts are printed well, but the before.tdsls041.pono.10 does not appear on page breaks triggered by the layout.again().

mark_h
12th July 2007, 16:33
Doe the before.tdsls041.pono.10 section have page checked for it? What is the output expression for the layout(before.tdsls041.pono.10)? I have not seen this before and I only have used layout.again once or twice without problems.

mojays
12th July 2007, 17:19
Doe the before.tdsls041.pono.10 section have page checked for it? What is the output expression for the layout(before.tdsls041.pono.10)? I have not seen this before and I only have used layout.again once or twice without problems.

What do you mean with your first statement "Do the before.tdsls041.pono.10 section have page checked for it"?

The output expression of the before.tdsls041.pono.10 is "1" and there is no section for it in report script, which could suppress the layout.

BTW: The layout.again() isn't printed very often, but sometimes detail.10 starts nearby the bottom of the page, so it triggers a page break...

mark_h
12th July 2007, 17:40
What do you mean with your first statement "Do the before.tdsls041.pono.10 section have page checked for it"?

On form 1 of maintain layouts - is page checked? I am not sure this has anything to do with it or not. According to the help when a page break occurs the header and before layouts should print. I thought something you might try is checking this box.


The output expression of the before.tdsls041.pono.10 is "1" and there is no section for it in report script, which could suppress the layout.

The reason I asked this is that the one report I know of that uses layout again uses lattr.break as the print expression. Again something you might try. I am not sure if this will help or not.

mojays
12th July 2007, 18:19
On form 1 of maintain layouts - is page checked? I am not sure this has anything to do with it or not. According to the help when a page break occurs the header and before layouts should print. I thought something you might try is checking this box.


Well... I tried, what you said, but - as I expected - this checkbox FORCES a page break and has nothing to do with the condition, whether the layout section is printed or not.
Checking this box leads to a page break EVERY time the before.tdsls041.pono.10 is printed, and that's not what I want!



The reason I asked this is that the one report I know of that uses layout again uses lattr.break as the print expression. Again something you might try. I am not sure if this will help or not.

As I mentioned: No output expression is set...

mark_h
12th July 2007, 20:20
Kind of what I expected on the first one. On the second I was suggesting to set the output expression on the layout to lattr.break. Just something to try - I am not sure that will help either.

Something else to try - is put the report in debug mode. See which routine prints the before.tdsls041.pono.10 layout. Then in your routine put in something like:

if lattr.break then
r.s.before.tdsls041.pono.10() | Replace this with the actual routine name
endif

Of course this assumes that at the page break lattr.break is set to true in the detail layout.

bigjack
12th July 2007, 21:04
Are you setting the value of predefined report variable lattr.autobefores to false in your script ?

mojays
13th July 2007, 01:36
Are you setting the value of predefined report variable lattr.autobefores to false in your script ?

no... I did not something like that.

mojays
13th July 2007, 01:57
Kind of what I expected on the first one. On the second I was suggesting to set the output expression on the layout to lattr.break. Just something to try - I am not sure that will help either.

Although I did not try it, I'm 150% sure, that this will not succeed, because the output expression is a BOOLEAN CONDITION, which it can not become "more TRUE" than "1", when I set a condition (like "lattr.break").

Something else to try - is put the report in debug mode. See which routine prints the before.tdsls041.pono.10 layout. Then in your routine put in something like:

if lattr.break then
r.s.before.tdsls041.pono.10() | Replace this with the actual routine name
endif

Of course this assumes that at the page break lattr.break is set to true in the detail layout.

This sounds interesting... I will try it...
But instead trust in the lattr.break variable, I will cause "r.s.before.tdsls041.pono.10()" when the last page line is reached (lattr.lineno = spool.pg.length - <bottom margin>)...

I will let you take part of my experiences...

Thanks...

BTW: Are there predefined variables (or functions) to access the top, bottom and footer margin of the report (as set on the 2nd mask of "Maintain Reports")?

mark_h
13th July 2007, 15:04
Although I did not try it, I'm 150% sure, that this will not succeed, because the output expression is a BOOLEAN CONDITION, which it can not become "more TRUE" than "1", when I set a condition (like "lattr.break").

I agree - the hope was that with an output expression of lattr.break, it might force it to re-evaluate the layout for printing. But you might want to try looking at lattr.autobefores - make sure it is true. It says the default is true, but never hurts to check.

This sounds interesting... I will try it...
But instead trust in the lattr.break variable, I will cause "r.s.before.tdsls041.pono.10()" when the last page line is reached (lattr.lineno = spool.pg.length - <bottom margin>)...

The more I read on lattr.break the more I think it will not work in the detail layout either. Lattr.break according to the help is only true when there is a sort field change. So it will not be true during the detail. To me it is looking like you might have to track the lines and issue a page command. Something along those lines.

Does this layout have to be a detail layout? Could it be an after.field layout?

BTW: Are there predefined variables (or functions) to access the top, bottom and footer margin of the report (as set on the 2nd mask of "Maintain Reports")?
I did not see any in my help files, but that does not mean that there is not something I do not know about.