Jump to content

This topic is 3309 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have several databases that have more than one page. If the number of pages grow, I'd like to be able to identify how many pages are in the set and so indicate in the footer.

 

For example:

 

Page 2 of 10

Page 1 of 20

Page 12 of 15 and so on.

 

How can this function be created?

 

Thanks...

Posted (edited)

Hi Brobins,

 

You need to handle it with script when you run your report.  There is a Page number symbol and then to get the last page number add this to your script (pseudo-script:

Enter Preview Mode
Go To Record/Request/Page [ Last ]
Set Variable [ $$page ; Get ( Record/Request/Page ) ]
Go To RecorRequesPage [ First ]

Place page number and <<$$page>> on your layout as.  And welcome to FMForums!!!   :laugh2:


But why do you have several databases.  Do you mean tables or was this an old conversion from version prior to 7?  It almost sounds like you are using form view instead and want to count records.  If so, look at Insert > Record Number.

 

With 13, we now have additional pre-made Insert objects such as Total Record Count, Found Count and so forth. 

 

You can roll your own ... some use calculations but I prefer merge variables fed by conditional format.  If you would like an example, we can provide one but we will need to know whether  for form or report.

 

EDITED:  added last paragraph & corrected merge variable

Edited by LaRetta
Posted

LaRetta,

 

Thanks for the reply...

 

The several databases are for different users. A couple are for a law firm that contains multiple pages for wills and trusts and they need to be separated by files and not tables.

 

The one database I am working on now is simply a list of Time Warner Cable channels that includes fields for the channel listings. The solution has two tables. One of the tables, when printed, produces several pages because there are many records. By calculating the page count and subsequently showing it in the footer (as Page 12 of 20 for example), the user will know how many pages are in the document.

 

This wasn't a left over from 7... And the data is in "List View" format.

 

I greatly appreciate the answer to my question and am anxious to key it in and get it going... Please accept my apology also for posting in the Filemaker Pro 13 Forum... I am still working in 12. Any other issues I post will be to the proper forum until I upgrade to 13...

 

Many thanks,

 

Bill

Posted

In your footer, with 12, add my script to the end of your find and switch to your list. Type this into your footer.

 

## of <<$$page>>

 

In 13, you need to use:

 

{{PageNumber}} of  <<$$page>>

 

corrected

Posted

Bill, Loretta gave you the best way to get the total number of pages but be aware that this doesn't always work. The reason is Preview doesn't always give you an accurate representation of what gets actually printed. This can throw your total number of pages off. Make sure you do a lot testing to see if you are getting the desired results. This problem is more prevalent in long documents or documents that require sliding.

Posted

Rgortdon & Loretta,

 

The script worked out delivering the correct last page number as expected. However, looks like testing of other files will be necessary to ensure the script works when multiple pages are used. Right off, I don't see why the script wouldn't work. But, I'll find out.

 

And, something I had to learn as a novice:

When trying to keying in the script function, the Get (Page) function was not obviously available. Matter of fact, I couldn't find the function until clicking on the "Get Functions" drop down button in the "Specify Calculation" dialog box. I Almost gave up...

 

Additionally, the solution is using two tables that feed different layouts. Since the tables contain a different number of records, the resulting page count is different. To get the correct last page number, it is necessary to run the script for whichever table being used. Don't know if it was necessary, but I created a separate script for each of the two layouts. Now, when viewing either of the layouts, the correct corresponding last page number is delivered to the page count.

 

Also, Loretta... it turned out that the Page number symbol "##" is not the current symbol in FMP 12. It is the same as FMP 13, which is {{Page Number}}.

 

Thank you both very much.This was a fun and informative learning experience. And, of course, my solution now works fine!

Posted

...but be aware that this doesn't always work. The reason is Preview doesn't always give you an accurate representation of what gets actually printed. This can throw your total number of pages off. Make sure you do a lot testing to see if you are getting the desired results. This problem is more prevalent in long documents or documents that require sliding.

 

I have never observed an issue.  From my understanding, printing is based on the default printer so how could it be off?  If you could provide an example of when page numbering fails, I would sure appreciate it.

 

When trying to keying in the script function, the Get (Page) function was not obviously available. Matter of fact, I couldn't find the function until clicking on the "Get Functions" drop down button in the "Specify Calculation" dialog box. 

 

There are several script steps which are multi-purpose - notice they are listed with slashes, such as Go To Record/Request/Page etc.  They function differently depending upon Mode.    And thanks for the correction on page number - I couldn't remember if the symbol changed in 12 or 13.

 

Edited:  changed wording in first paragraph for clarity

Posted

LaRetta,

 

Thanks for the additional feedback. Yeah, I realized the statement "Record/Request/Page" was a multiple function. Only, I initially thought it was possible to simply use the term of interest like either, Record or Request or Page. When tried, it didn't work. So, finally using the proper Get function found in the Functions drop down saved the day.

The only thing left for me now is to decide how to trigger the script. I'm planning on including the page count script you helped me with in a navigation step. For example, I sort the Time Warner Channels either by channel number or by network name. So, using a button to change the layout gives me a place to include the page count script steps. Oh, and of course, when pacing the page number and page count symbols in the document footer, it was necessary to use the "sliding" function. All seems to be working just fine.

Bill

Posted

Oh, and of course, when pacing the page number and page count symbols in the document footer, it was necessary to use the "sliding" function. All seems to be working just fine.

 

I'm glad to hear it's working for you, Bill.  But what makes you think anything in the footer needs to be set to slide?  AFAIK, the footer itself cannot slide.  

Posted

Without using the slide function, the page number symbol, the word "of" and the last page number symbol were on top of each other and looked like a mess. After eliciting the slide command, the symbols all came together allowing the page number, "of" and the page count look ok both in layout view and then preview. If I turn off sliding it looks cockeyed. At least, that's what I think.

Bill

Posted

Without using the slide function, the page number symbol, the word "of" and the last page number symbol were on top of each other and looked like a mess. 

 

Just use a single text object; i.e. in layout mode select the Text tool, write the word “of” on the layout and add the two symbols, so you end up with one text object that reads 

 

{{PageNumber}} of <<$$page>>

 

instead of three separate text objects.

Posted

eos,

 

The sliding works for sure in the footer. I believe combining the "page number", "of" and "page count" as one text object will also work, but I'm wondering what happens when the page count number becomes two digits. I'm thinking the alignment may get out of symmetry so that the numbering in the footer may look like: Page 10of 20. The number 10 might jamb the word "of". I'll give it a try. In the meantime, see the screen shots showing the effect of the sliding. With sliding number of digits will now matter...

 

Thanks, Bill

 

 

post-110672-0-79621900-1395437178_thumb.

post-110672-0-42658600-1395437194_thumb.

post-110672-0-97255500-1395437243_thumb.

Posted

Page 10of 20. The number 10 might jamb the word "of". 

 

When you combine literal text with place holders in a single text object (or e.g. combine references an literal text in a calculation), the literal text strings, including any white space, are preserved as they are (that's why it is called a literal). So if you leave a space to each side of the "of" (resulting in " of ", as in LaRetta's and my examples), no 'jambing' will occur.

 

To be explicit: Copy the following text within quotes (but without the quotes themselves) and paste in on your layout: "Page {{PageNumber}} of <<$$page>>"

 

This gives you a single text object for which no sliding is required and in which the individual components “keep their distance”.

 

PS: You are not really on Mac OS 9 …!  :laugh:

  • Like 1
Posted

I have never observed an issue.  From my understanding, printing is based on the default printer so how could it be off?  If you could provide an example of when page numbering fails, I would sure appreciate it.

 

LaRetta, I agree preview and print should be the same but my experience has been this is not always the case. I print fairly long complex forms that have multiple merge fields, multiple subsummaries, container fields, check box fields, fields with multiple styles and sizes, and outlines sometimes around each page. Everything slides but many of these things can not cross a page break. When finished to keep the customer happy, the document has to look like it was produced in Word. Every version of FileMaker that I have used dating back to Fm 3 has had some quirkiness with print/preview/PDF. I've been able to work around these issue through a lot of trial and error. I don't have a specific example to show right now, but I'll try to find one that I can post.

Posted

Hi!  Thank you so much for responding!  

 

I've never had to deal with really complex reports but a few times in 12 years working in FM full time.  I consider myself very *blessed.  In fact in some of my earlier projects which were complex, we used Crystal Reports.  Thank you for raising my caution flag a bit higher on reporting ... however, I have to believe that if we follow the FM rules and place objects to the px and observe its behaviours, we should feel pretty confident in our results.

 

But it is pulling data through relationships when sub-summarising that it can get really hairy.  :hairy:

 

* or cursed depending upon perspective.  It means I lack some of your experience with them; which is why I asked.  We don't always have to learn from personal exerpience.

Posted

I always work in px. Here is another heads up if you do any printing of multiple page reports with FM Go. Fields that cross page breaks have a tendency to cut a line into two parts across the page break. Using Helvetica 10 seems to resolve this issue.

Posted

eos,

 

OK... I pasted in "Page {{PageNumber}} of <<$$page>>" without the quotes... and, just like you said, worked perfectly. Spacing fine, positioning, fine...

Thank you, lesson learned!

 

brobins

  • 1 year later...
  • Newbies
Posted

I am experiencing problems with the page {{PageNumber}} of <<$$page>>.  Using your script, the report accurately displays the total pages, but the first command only displays page 1 on each of the 50 pages.  I am reasonably convinced that I am entering it correctly but suspicious that the {{PageNumber}} feature is not working correctly?

Posted

Page {{PageNumber}} of <<$$page>>

Off-hand, I suspect you are not in preview mode when you view this?   

What do you mean by "but the first command only displays page 1 on each of the 50 pages."  What 'first command'?

How rude of me!!  Welcome to FMForums, BloozeKat!  :-)

This topic is 3309 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.