#30528 - 11/12/09 04:13 PM
Conditional Pages
|
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
|
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: =(&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
|
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
|
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: =not((¤t.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
|
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
|
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:
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:
Am I getting any closer?
_________________________
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
|
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
|
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
|
|
|
|
#30537 - 11/13/09 02:32 PM
Re: Conditional Pages
|
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
|
|
|
|
|
|