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)

Page 1 of 2 1 2 >
Topic Options
#30528 - 11/12/09 04:13 PM Conditional Pages
Dan_F Offline
OL Newbie

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

We are running into a problem where we want pages within a form to print or not print based on data within the code. The problem is, this line of text is only on the first page of the data.

We ran into a similar problem within a document and with your help, were able to solve it. That was dependent on a talk object WITHIN the page that set a Global Variable, and then the logo was dependent on that variable. We are able to make that object conditional then on the first data page, using: =¤t.datapage = 1

My problem now with these pages is, without being able to have the talk object within a page, I don't know how to make it conditional on the first datapage. Is there PressTalk syntax that accomplishes this?

I'm using

if(@(1,10,16) = 'FSINV01')
&Varfsinv01 := True
elseif()
&Varfsinv01 := False
endif()

where 'FSINV01' is the string we're looking for and &varfsinv01 is the variable. This works for the first datapage, but none after.

Thanks in advance.

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
#30529 - 11/12/09 05:14 PM Re: Conditional Pages
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
Hi Dan,

Instead of creating a globabl variable and writing a PlanetPress Talk object, why don't you just type something like the following in your page's condition:
Code:
=(&Current.Datapage=1) and (@(1,10,16) = 'FSINV01')
Hope that helps.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#30530 - 11/12/09 07:52 PM Re: Conditional Pages
Dan_F Offline
OL Newbie

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

Thanks for the response. Your suggestion works, but only for the first page. Any pages after don't process. I need to process the pages that come after just like the first page, even though the command is only on the first datapage.

I was trying to set the variable based on that first datapage, and then make the pages conditional on that variable.

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
#30531 - 11/13/09 07:01 AM Re: Conditional Pages
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
Dan,

Sorry, I thought that was exactly what you were looking for. So let me see if I get this right:

If FSINV01 is NOT found on the first datapage, you want the document to skip that data page, but still process all other data pages normally; and if FSINV01 IS found on the first data page, you want ALL data pages to be processed?

If that's the case, then:
Code:
=not((&current.datapage=1) and (@(1,10,16)<>'FSINV01'))
should do the trick.

Let us know if that helps,
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#30532 - 11/13/09 08:28 AM Re: Conditional Pages
Dan_F Offline
OL Newbie

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

Closer. I need to process all datapages. The 'tag' for which form pages to process though, is only in the first datapage. So for instance (and I realize this isn't proper syntax, just trying to get a solid example):

If (@(1,10,16)='FSINV01'), then process page 1.
If (@(1,10,16)='FSINV02'), then process page 1 and 3.
If (@(1,10,16)='FSINV03'), then process page 4 and 5.....etc.

So datapage1 will have the tag, but it will likey be a multiple page stream (4 or 5 datapages average). None of the following datapages have the tag in (@(1,10,16).

Does that make sense?
_________________________
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
#30533 - 11/13/09 10:25 AM Re: Conditional Pages
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
OK... I think I get it... I think... :p

So let's try this:
  • Create a Global Variable of type String. Let's call it MyVar, and don't give it a default value
  • In the PressTalk Before section of the Document, add the following code:
    Code:
    if(&MyVar='')
      &MyVar := @(1,10,16)
    endif()
    You now have a global variable that contains whatever was found on the first data page at the specified location. Now, you can set you Page conditions according to that value.
  • For instance, set your Page Condition to something like this (assuming, in this case, the global variable is called MyVar:
    Code:
    =(&Myvar='FSINV01')


Am I getting any closer? smile
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#30534 - 11/13/09 12:24 PM Re: Conditional Pages
Dan_F Offline
OL Newbie

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

I still cannot get the logic to work once I get past the first datapage. Your most recent logic works for the first datapage, but once I get to a second or third page, where the tag isn't there, the page doesn't meet the condition. Once I flip to datapage2, there is nothing in @(1,10,16).

I need to somehow, from datapages 2 and on, use the tag that is sent on datapage1 regardless of the datapage I am currently processing.

Thanks for helping.
_________________________
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
#30535 - 11/13/09 12:47 PM Re: Conditional Pages
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
Then I really don't understand what you're trying to achieve. The code I provided above stores in a global variable the value found in the first data page.

Then, when you move on to the next data pages, the contents of that variable don't change, so you should be able to use its value in any condition in your document. (The condition I wrote in my previous post is only an example, you'd have to write your own, depending on the results you want to achieve)

Could this simply be a case of confusing "data page" with "physical page", or am I really thick in the head? (er... don't answer that last part!)
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#30536 - 11/13/09 01:25 PM Re: Conditional Pages
Raphael Lalonde Lefebvre Offline
OL Expert

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

Perhaps at this point, it would be best for you to call technical support, so we can talk over the phone, and get a better explanation of what you need. This might help us understanding exactly what you want, and we could connect to your machine and implement the fix if we need to.

You can call 1-866-348-5863, ask for technical support, and one of our technicians will be able to assist you. Make sure you mention the call is about this thread.

Regards,
Rapha

Top
#30537 - 11/13/09 02:32 PM Re: Conditional Pages
Dan_F Offline
OL Newbie

Registered: 10/26/09
Posts: 17
Loc: Pennsylvania
I got it!

Thanks for your patience as I learn this stuff. Even though you emphasized document in your post, I had the talk objects on the PAGE. So it wasn't setting the variable correctly. I moved the code to the document, and am able to get the results I was expecting.

Thanks again 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
Page 1 of 2 1 2 >