Skip Printing based on variable

Posted by: TomK

Skip Printing based on variable - 02/02/10 03:55 PM

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.
Posted by: Anonymous

Re: Skip Printing based on variable - 02/02/10 03:59 PM

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
Posted by: TomK

Re: Skip Printing based on variable - 02/02/10 04:22 PM

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
Posted by: TomK

Re: Skip Printing based on variable - 02/02/10 04:37 PM

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...
Posted by: TomK

Re: Skip Printing based on variable - 02/02/10 04:43 PM

The syntax I'm using where I get a "string expected" before the "100"IF([Amt] > 100, PRINT, SKIP)
Posted by: TomK

Re: Skip Printing based on variable - 02/02/10 04:58 PM

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!
Posted by: Anonymous

Re: Skip Printing based on variable - 02/02/10 04:59 PM

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.
Posted by: TomK

Re: Skip Printing based on variable - 02/02/10 06:35 PM

Thank you! That worked!