6 Replies Latest reply on Jul 17, 2014 2:44 AM by dnfmptn

    Line item count and page numbers

    dnfmptn

      Hi all, noob here.

       

      I've built a useful inventory database, with each item of inventory as a record.

       

      1) Using sub- and grand-summaries I have a Layout with Quantity, Description, Cost of item fields displayed.

      Thus, if I have 5 widgets and 3 thingies, there are two lines in the layout for these 8 records, plus the leading and trailing summary headers and footers.

      What I need is a count of the lines, in this example, 2. That way I can have a text block in the header with "8 units of 2 kinds".

      But I don't know what to call this. I've tried entering a variety of Symbols, tried to define a Field to count the lines and insert a Merge Field but the results are either zero or total number of records, 8 in this example. What is this called?

       

      2) In the Footer I've inserted the Page Number Symbol but would also like to have a page count, or total number of pages, so it reads "Page 2 of 96" for example. Haven't been able to find what that's called either.

       

      Thanks for any tips, try to keep it simple since I'm just refreshing my database knowledge and not an advanced user.

       

      dave

        • 1. Re: Line item count and page numbers
          erolst

          Just to be clear on this: you have articles A, B, D, E, and H (each with a specific quantity), which are "Widgets", and C, F, and G (again each with its own quantity), which are "Doodads" – let's call these "Categories" (kinds) – and your sub-summary is broken by category. Correct so far?

          • 2. Re: Line item count and page numbers
            Stephen Huston

            Re the page count:

            The total page count number needs to be scripted using either a $$mergeVariable or a global number field to store the captured value:

            1. Enter Preview mode
            2. Got to Record/Page [Last]
            3. Set Field /or/ Set Variable [ by calculation: Get (PageNumber) ]
            4. Enter Browse mode

            and use that number on the layout as merged text for the global field or variable,

            then continue with the reporting script, etc.

            • 3. Re: Line item count and page numbers
              dnfmptn

              Thanks for the tip, Mr. Huston;

              the database is becoming a priority again so I should be trying the steps soon.

              • 4. Re: Line item count and page numbers
                flybynight

                Just a tip, from something I've learned. I often have my printing scripted, so my users don't have to deal with the native print dialog. Therefore, I often have a pair of script steps for Print Setup and Print. If you do this, just make sure that your Print Setup step is before the steps that Stephen gave you, or you might end up with a different total number of pages. For this use, I love $$mergeVariables - no extra fields required.

                If your printing is scripted, and you are OCD like me, you can add a step to set your $$pages variable to "" [null] at the end of your script, so your data viewer doesn't get cluttered with $$variables. Or if it is all scripted, and you have no need to leave the variable around or show the user outside of the script, you could use a $variable that won't stick around. Just make sure you match your Set Variable script step to the same $ or $$ style as the merge variable on your layout.

                 

                HTH,

                -Shawn

                1 of 1 people found this helpful
                • 5. Re: Line item count and page numbers
                  Stephen Huston

                  There is also a Knowledge Base article on the page number issue:

                   

                  http://help.filemaker.com/app/answers/detail/a_id/3629/

                   

                  That's also searchable at the FM knowlege base page by answer ID: 3629.

                  • 6. Re: Line item count and page numbers
                    dnfmptn

                    Thanks Mr. Huston and flybynight;

                    This is way more complicated than it needs to be (and you two are way smarter than I), so I'm just going to leave it at page number. You'd think by version 12 or 13 Filemaker would have figured out that people print the output of the database on occasion and it might be nice to have a built in way like the existing page number. Oh well!