1 Reply Latest reply on Feb 23, 2010 9:12 AM by philmodjunk

    Fill out a page with blank records



      Fill out a page with blank records


      At my church for Sunday school I print out a list of children with their names, age, birthdays and other information to use as sign in sheets; there are 10 records per page. For example:



      Doe, Jane     | 4 | 1/17/2006| |                       |      123 456 7890   |     Address On File 

      Doe, John     | 5 |  4/20/2005| |                       |      NEED PHONE #|     Address On File   



      As the list does not sometimes fill out the page I am trying to find a way to fill the rest of the page with blank records so visitors can manually fill in the data.  This is kinda hard to illustrate here so I hope you get the gist of what I am trying to do.



        • 1. Re: Fill out a page with blank records

          I see an X in your post that indicates you may have tried to post an image that isn't displaying correctly.


          In any case, here's simple method to pad your last page with blank records:


          Store the number of records you can print on one page in a global field (Storing it this way, makes it easy to make adjustments in the future if you change printers or modify your layout.) We'll call this field "gPageSize". (To define a global field, click the storage tab under field options in Manage | Database | Fields and select the global storage check box. )


          Define a new field so that you can sort your names alphabetically but place the blank records at the end of the list:

          cSortField  : If ( IsEmpty ( NameField ) ; "ZZZZ" ; NameField ) /* clear the do not evaluate if all referenced fields are blank check box */


          Write and run this script

          #Remove any blank records created previously

          Enter Find Mode []

          Set Field [YourTable::NameField ; "=" ]

          Set Error capture [on]

          Perform Find []

          If [ get ( foundcount ) > 0 /* blank records found */ ]

             Delete All Records [no dialog]

          End If

          Show All Records

          Set Variable [$Blanks ; Value: gPageSize - Mod ( get ( FoundCount ) ; gPageSize ) ]

          Set Variable [$Blanks ; Value: If ($Blanks < 3 ; $Blanks + gPageSize ; $Blanks ) /* Add a full page of blank rows if needed */ ]


            New Record/Request

            Set Variable [$Blanks ; Value: $Blanks - 1 ]

            Exit Loop If [ $Blanks = 0 ]

          End Loop


          The above script works for a single class roster. If you have multiple classes, you'll need to insert code to do a find for a given class in place of Show All Records.