layout expression

Posted by: JT

layout expression - 05/28/09 06:50 AM

I have a problem with a 44 layout document, I want each record to print only the layout with the coresponding number using;

Code:
 IF(RECORD_NR()=LAYOUT_NR(), Print, Skip) 
But no pages are produced, where am I going wrong?
Posted by: JT

Re: layout expression - 05/28/09 08:19 AM

Ok, if I enter it manually (XX being the layout number)-

Code:
 IF(RECORD_NR()=XX , Print, Skip) 
It works, but this is a little tedious having to enter the number for each layout.
Posted by: Raphael Lalonde Lefebvre

Re: layout expression - 05/28/09 09:37 AM

JT,

You're right, the first expression should work, it even evaluates it properly, but when you print or preview, it doesn't work.

I'll report it to the developpers.

Regards,
Rapha
Posted by: Anonymous

Re: layout expression - 05/28/09 09:45 AM

It is not designed that way. The layoutnumber shows the printed layout number, not the layout at designing. This to achieve a pagenumber in a multi-up situation.

Mostly when doing this kind of jobs, the layouts are similar. When that is the case you can setup the job differently by using the variable image expression like pagenr() to pick a certain page.
Posted by: Raphael Lalonde Lefebvre

Re: layout expression - 05/28/09 09:56 AM

Alfons,

I did a test, with two layouts. On the first layout, I have a text box with the static text "LAYOUT 1", and a variable on the next line that returns the value of LAYOUT_NR. I have a second layout with static text "LAYOUT 2", and a second variable that also returns LAYOUT_NR. Layout 1 has the condition "IF(RECORD_NR()=1, Print, Skip)", while layout 2 has "IF(RECORD_NR()=2, Print, Skip)".

When I preview this, I get two pages, as expected. The first page is layout 1, and the second page is layout 2. However, on both pages, LAYOUT_NR returns 1. The static changed, so I know it picked the right layouts, but it seems LAYOUT_NR returned 1 in both cases, and I don't think that's the intended behavior.

Regards,
Rapha
Posted by: Anonymous

Re: layout expression - 05/28/09 10:01 AM

What is the result at printing? When previewing this information is not available, otherwise a complete preflight has to be done prior the preview can be shown.
Posted by: Raphael Lalonde Lefebvre

Re: layout expression - 05/28/09 10:17 AM

I printed the job, and got the exact same thing as the preview. LAYOUT_NR returns 1 on both pages, but I know it picked the layouts properly, because the first page has the static text "LAYOUT 1", and the second page "LAYOUT 2".
Posted by: Sander vd Berg

Re: layout expression - 05/29/09 01:54 AM

The result of LAYOUT_NR in the design view is only a placeholder.

To see the actual result of LAYOUT_NR you will either need to print or open the print preview. The reason for this is that PSM needs to know which layouts are skipped and which layouts are printed before it can evaluate LAYOUT_NR. PSM does not have access to this information in the design view.

LAYOUT_NR does not return a constant index. It returns a counter that is incremented every time a layout is printed. Skipped layouts are not counted, and it resets after every record. Taking Raphael's test as an example:

Record 1:
Layout 1 is printed. The LAYOUT_NR counter is incremented, its value is 1.
Layout 2 is skipped.

Record 2:
The LAYOUT_NR counter resets to 0.
Layout 1 is skipped.
Layout 2 is printed. The LAYOUT_NR counter is incremented, its value is 1.

The result of LAYOUT_NR will be 1 for both records.

Future versions of PSM will no longer allow you to use LAYOUT_NR in the scope of a layout condition. The LAYOUT_NR counter will only be valid after the current layout condition has been evaluated. If the current layout condition makes use of LAYOUT_NR, there's a circular reference.
Posted by: JT

Re: layout expression - 06/03/09 05:50 AM

Quote:
Originally posted by Alfons:
It is not designed that way. The layoutnumber shows the printed layout number, not the layout at designing. This to achieve a pagenumber in a multi-up situation.

Mostly when doing this kind of jobs, the layouts are similar. When that is the case you can setup the job differently by using the variable image expression like pagenr() to pick a certain page.
This works. Thank you.

I was using 'place PDF' when I shoud have used a variable image with a page expression. wink
Posted by: evonne

Re: layout expression - 09/23/09 03:21 AM

Requires a duplex document to be printed on a printer using PrintShop Mail. The requirement is as follows:

1. At the corner of each document a non-variable text in addition to a running number of 7 digits is required. I tried to use the Page_NR() function to get the result. However, it gives me a single digit as the suffix.

2. On the other side of the document, the page should be covered with 1 inch x 1 inch square boxes with each box containing a four digit randomly generated number.

Could you please give your inputs on how this can be achieved?
Posted by: Anonymous

Re: layout expression - 09/23/09 10:44 AM

evonne,

Please open a support call as your request is out of scope of the newsgroup. You can open the call on this page:
http://www.objectiflune.com/OL/en-CA/Services/Support/IssueCreation.aspx

Also, please note that in the future it would be best to open a new topic instead of replying to another one - especially if it's a 3 month old post with no link to your question.

Thank you,
Eric.