4 Replies Latest reply on Jan 29, 2010 4:31 PM by Steve Wright

    insert a variable into a printout header

    DavidSteward

      Title

      insert a variable into a printout header

      Post

      Using Filemaker Pro 10

       

      Using OSX 10.6.2

       

      I have a database for a local club with 400+ members.

       

      I store membership info and which of 40+ groups people belong to.

       

      When I search for the membership of a group I can easily get a list on names etc.. However I want to put the name of the group into the header of the printout. How can I insert the group name which is not stored in the file into the header? I could have 40+ layouts with the header names typed in but this would seem cumbersome and tedious. I want the transfer the name of the field I am searching into the printout header. I store the 40+ groups as separate fields with "yes" indicating membership.

       

      Any help and suggestions would be most welcome.

       

      David Steward


        • 1. Re: insert a variable into a printout header
          philmodjunk
            

          "When I search for the membership of a group I can easily get a list on names etc.. However I want to put the name of the group into the header of the printout. How can I insert the group name which is not stored in the file into the header?"

          How do you find all members of a group if the group name is not stored in the file? Where do you store the group name?

           

          Any field in your database system from the layout's table or a related table can be placed in the header. What you see when you print will depend on the structure of your databse and the data stored in your fields.

          • 2. Re: insert a variable into a printout header
            DavidSteward
              

            The group name is the fieldname, I store "yes" to indicate membership.

            e. g. name "David Steward" history null walking "yes"

            Means David Steward is not a member of history but is a walker.

             

            I want to print out membership lists of the groups without having to have a layout for each group. i.e. a single layout with the name of the group in the header, either History or Walking and then the list of members.

             

            David 

            • 3. Re: insert a variable into a printout header
              philmodjunk
                

              The simplest approach is to use a single text field to store the group name for a given record. If a person can be a member of more than one such group, you should create a table of related records so you can use a portal to assign people to groups.

               

              A report  based on this related table that lists all members of a given group--with the group name in the header--becomes a simple thing to set up.

              • 4. Re: insert a variable into a printout header
                Steve Wright
                  

                If you really really need to use a variable on a layout, you can by using a webviewer

                 

                In the webviewer url, put : "data:text/html," & $$var

                 

                Although you would probably want some formatting to get rid of borders etc, so something like below will remove all scroll bars and borders as long as you disable interaction with the webviewer

                 

                "data:text/html, <html>

                <style type='text/css'>
                <!--body
                { background-color:#fff ;margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;}
                -->
                </style>

                <body style='text-align:center;  border:0; padding:0; scrolling:auto'>
                <font size='4' style='color:#000'>" &

                 

                $$Var

                 

                & "</font>
                </body>
                </html>"