dbTalk Databases Forums  

getting page count

comp.databases.filemaker comp.databases.filemaker


Discuss getting page count in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
lawpoop@gmail.com
 
Posts: n/a

Default getting page count - 06-19-2007 , 02:45 PM






Hello all -

I'm using Filemaker developer version 7.03.

What's the current method to get the number of pages in a particular
layout and record set? If I use 'get(CurrentPageNumber)', it's always
0.

I have a script that is supposed to go to a different layout if there
is an odd number of pages.

Thanks!


Reply With Quote
  #2  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: getting page count - 06-19-2007 , 03:44 PM






Enter Preview Mode
Go to Record/Request/Page [Last]
Set Variable [$LastPage, get(CurrentPageNumber) ]

lawpoop (AT) gmail (DOT) com wrote:
Quote:
Hello all -

I'm using Filemaker developer version 7.03.

What's the current method to get the number of pages in a particular
layout and record set? If I use 'get(CurrentPageNumber)', it's always
0.

I have a script that is supposed to go to a different layout if there
is an odd number of pages.

Thanks!

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc. Los Angeles

FileMaker 8 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: getting page count - 06-19-2007 , 03:51 PM



In article <1182282336.308003.244270 (AT) p77g2000hsh (DOT) googlegroups.com>,
lawpoop (AT) gmail (DOT) com wrote:

Quote:
Hello all -

I'm using Filemaker developer version 7.03.

What's the current method to get the number of pages in a particular
layout and record set? If I use 'get(CurrentPageNumber)', it's always
0.

I have a script that is supposed to go to a different layout if there
is an odd number of pages.

Thanks!
The Get(CurrentPageNumber) function is the correct one to use, but
there is a hint in the fact that you get only a 0.

The number of pages "in a particular layout or record set" doesn't
really mean anything when in Browse mode. However, if you are in
Preview mode the Get(CurrentPageNumber) function will tell you which
page of the report you are looking at - which means to obtain the total
number of pages you have to be in Preview mode and looking at the very
last page. You can do this in a simple script like:

Go To Layout [ReportLayout]
Enter Preview Mode
Go To Record / Request / Page [Last]
Set Field [g_NumPages, Get(CurrentPageNumber)]
If (Mod(g_NumPages, 2) = 0)
Go To Layout [EvenPagesLayout]
Else
Go To Layout [OddPagesLayout]
End If


It's best to have g_NumPages be a Global field.

You obviously have to be on the correct Layout since different Layouts
will contain differing numbers of pages when printed.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: getting page count - 06-19-2007 , 03:52 PM



Oops -- no variables in FM7. Still, just grab the
get(CurrentPageNumber) into a script or global field.

Howard Schlossberg wrote:
Quote:
Enter Preview Mode
Go to Record/Request/Page [Last]
Set Variable [$LastPage, get(CurrentPageNumber) ]

lawpoop (AT) gmail (DOT) com wrote:
Hello all -

I'm using Filemaker developer version 7.03.

What's the current method to get the number of pages in a particular
layout and record set? If I use 'get(CurrentPageNumber)', it's always
0.

I have a script that is supposed to go to a different layout if there
is an odd number of pages.

Thanks!


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc. Los Angeles

FileMaker 8 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.