IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#24701 - 02/02/10 03:55 PM Skip Printing based on variable
TomK Offline
OL Newbie

Registered: 01/25/10
Posts: 17
I have one database where I would like to do something like the following:

In a PSM project have two layouts one of which is a letter and the other is postcard. I have a fundraising database where I want to send postcards to everyone who has given say over $100 a letter and everyone else a postcard. I want to make this as easy as possible for my staff. I envision the staff people attaching a single datafile to the PSM project and first navigating to the "letter layout" and then printing - however, I need the PSM project to SKIP printing any letter where the amount variable is less than $100. After these letters are printed, I want the user to navigate to the "postcard layout" and print, but skip printing any records where the amount variable is greater than $100. I don't see in PSM how to program this request.

Top
#24702 - 02/02/10 03:59 PM Re: Skip Printing based on variable
Anonymous
Unregistered


Tom,

If you go in the "Layouts" window, select the layout you want to put a condition on and then hit ALT+ENTER, this will bring up the properties window. In this, you have the "Action" item. Click on the "Layout will be printed", which brings up the Expression Editor.

You can then use a condition that reads something like:
IF([Amount] > 100, SKIP, PRINT)

Hope this helps,
Eric

Top
#24703 - 02/02/10 04:22 PM Re: Skip Printing based on variable
TomK Offline
OL Newbie

Registered: 01/25/10
Posts: 17
Thank you Eric. I have done ALT+ENTER and this brings up a Properties window. However, I don't see an "Action" item anywhere. I do see a Printing tab but the only options I see are YES, NO and PREVIEW. Tom

Top
#24704 - 02/02/10 04:37 PM Re: Skip Printing based on variable
TomK Offline
OL Newbie

Registered: 01/25/10
Posts: 17
I think I have found what I need under Edit Expression under the Layout menu, but oddly, when I type in the expression "[amt]<100" I get the error code "string expected" - this is baffling - the amount field is a string...

Top
#24705 - 02/02/10 04:43 PM Re: Skip Printing based on variable
TomK Offline
OL Newbie

Registered: 01/25/10
Posts: 17
The syntax I'm using where I get a "string expected" before the "100"IF([Amt] > 100, PRINT, SKIP)

Top
#24706 - 02/02/10 04:58 PM Re: Skip Printing based on variable
TomK Offline
OL Newbie

Registered: 01/25/10
Posts: 17
I've figured out the mistake I was making with the action (I was choosing my PDF instead of the layout!); howevever, I'm still having issues with "string expected" error message on a number field... Thanks!

Top
#24707 - 02/02/10 04:59 PM Re: Skip Printing based on variable
Anonymous
Unregistered


Tom,

That's probably because in your database, AMT is actually a string field. To resolve that, just convert [Amt] to a string, like so:

IF(VAL([Amt]) < 100, PRINT, SKIP)

This should do it.

Eric.

Top
#24708 - 02/02/10 06:35 PM Re: Skip Printing based on variable
TomK Offline
OL Newbie

Registered: 01/25/10
Posts: 17
Thank you! That worked!

Top