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
#30498 - 11/06/09 09:39 AM Conditions on Multi Page Text Files
Dan_F Offline
OL Newbie

Registered: 10/26/09
Posts: 17
Loc: Pennsylvania
Good Morning,

We are building our forms from simple .txt files that are passed from our Host System. Within the first line of the text file is a small line of text that indicates what type of form it is. Since we have several different variations of each form we have conditions setup to look at these. For instance, textstreamA may use one logo, but textstreamB may use another.

Our problem is this: The line that the condition is dependent on is only on the first line of the first page of what may be multi-page output. Once it flips to the second page, the line isn't there and therefore, we lose the logo (in this case).

What is the best way to handle multipage conditions?

Thanks for your help.

Dan
_________________________
Daniel Frederick II
Database Developer/Analyst
Four Seasons Produce, Inc
Direct: 717-721-2869
Tel: 800-422-8384, Ext. 2869
Fax: 717-721-2523
Email: danf@fsproduce.com

Top
#30499 - 11/06/09 09:46 AM Re: Conditions on Multi Page Text Files
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Dan_F,

Have a presstalk object assign a value to a global variable on the first datapage. (give that presstalk object the condition:
Code:
"=&current.datapage = 1"
, so that it is run only on the first page) Then, you can put a condition on your picture based on that global variable, so if it's true on the first page, it will be true for the rest of the job.

Regards,
Rapha

Top
#30500 - 11/06/09 11:56 AM Re: Conditions on Multi Page Text Files
Dan_F Offline
OL Newbie

Registered: 10/26/09
Posts: 17
Loc: Pennsylvania
Raphael,

Thanks for the response. I've been reviewing documentation based on your instructions and being new to this, I'm still struggling. Can you provide more detailed steps?

Thanks again.

Dan
_________________________
Daniel Frederick II
Database Developer/Analyst
Four Seasons Produce, Inc
Direct: 717-721-2869
Tel: 800-422-8384, Ext. 2869
Fax: 717-721-2523
Email: danf@fsproduce.com

Top
#30501 - 11/06/09 12:55 PM Re: Conditions on Multi Page Text Files
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Dan,

Here's some more detailed steps by step instructions:

1. Create a global variable. To do so, look in the Document Structure pane to the left, right-click on "Global variables" and select "Global variable". For the variable's type, you can choose "boolean", since it's going to be used as a condition on a logo. For this example, we'll name it "displaylogo".

2. Insert a PressTalk object on your page. Go in it's Basic Attributes, and for the condition, use:
Code:
=&current.datapage = 1
We only want this code to be run on the first page, so that's why we put this condition.

In the actual code, clear what's already there, and use a code like this one:
Code:
if(@(1,1,20) = 'Logo A')
  &displaylogo := True
elseif()
  &displaylogo := False
endif()
Basically, this will look at some place in your data(in this case, on the first line, characters 1 to 20), and look for a specific string. If it finds it, it will set the variable to True, otherwise it will set it to False. You will need to change the "@" command to match the location of your data.

3. On your logo, go into the basic attributes, and put this condition:
Code:
=&displaylogo
This will make it so the logo will be displayed if displaylogo is True.


This should allow you to do what you want. Let us know how it goes!

Regards,
Rapha

Top
#30502 - 11/06/09 03:11 PM Re: Conditions on Multi Page Text Files
Dan_F Offline
OL Newbie

Registered: 10/26/09
Posts: 17
Loc: Pennsylvania
Raphael,

Thanks. That worked. One remaining question: It seems that I need the original condition (and Logo) for the first page, and the the process you described (tied to an additional Logo) for additional pages....is that what you would expect?

Thanks again for your help.
_________________________
Daniel Frederick II
Database Developer/Analyst
Four Seasons Produce, Inc
Direct: 717-721-2869
Tel: 800-422-8384, Ext. 2869
Fax: 717-721-2523
Email: danf@fsproduce.com

Top
#30503 - 11/06/09 03:47 PM Re: Conditions on Multi Page Text Files
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Dan,

Not exactly sure what you mean. There will only be one logo, and it will have the condition. If it needs to show up, it will, otherwise it won't. The PressTalk object will only run on the first page to determine whether the logo will show up or not, but otherwise, everything above applies to all pages.

To be honest, I'm confused as to why you're confused!

Regards,
Rapha

Top
#30504 - 11/06/09 04:01 PM Re: Conditions on Multi Page Text Files
Dan_F Offline
OL Newbie

Registered: 10/26/09
Posts: 17
Loc: Pennsylvania
Well, when I set it up as you described, the logo now shows up on pages 2 and after. The first page has no logo. So I had to create the original condition, where the logo shows up on page 1, and then the process you described results in the other logo showing up on pages 2 and after.

The logo does appear to have the condition, but not for the first page.
_________________________
Daniel Frederick II
Database Developer/Analyst
Four Seasons Produce, Inc
Direct: 717-721-2869
Tel: 800-422-8384, Ext. 2869
Fax: 717-721-2523
Email: danf@fsproduce.com

Top
#30505 - 11/06/09 04:06 PM Re: Conditions on Multi Page Text Files
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Make sure the PressTalk object on the page is the very first object at the top of the list. Otherwise, if the PressTalk is after the logo, it will not work with the first page, since the logo's condition will be processed before the PressTalk object can set it properly.

In PlanetPress, the order of the objects is VERY important. It will process things one by one in the order that they are set to. So if you place the logo and it's condition before the PressTalk object, the logo will already be processed before the PressTalk can set the condition, and it won't work until you get to the next page where the logo will be processed again.

Regards,
Rapha

Top
#30506 - 11/06/09 05:05 PM Re: Conditions on Multi Page Text Files
Dan_F Offline
OL Newbie

Registered: 10/26/09
Posts: 17
Loc: Pennsylvania
Well, That did it! If I wasn't so new at this, I might be a little embarrassed.

Thanks for all your help.

Dan
_________________________
Daniel Frederick II
Database Developer/Analyst
Four Seasons Produce, Inc
Direct: 717-721-2869
Tel: 800-422-8384, Ext. 2869
Fax: 717-721-2523
Email: danf@fsproduce.com

Top