7 Replies Latest reply on Aug 13, 2013 11:13 AM by BillisSaved

    Printing multi-sided student training cards?

    BillisSaved

      Hello everyone,

       

      Thank you in advance for any assistance or advice you may be willing to provide regarding the challenge I am currently faced with.

       

      I work for a training company and I'm in the process of developing a database which, among other things, must be capable of producing a printed pvc card which contains general student and company information on the front and on the back displays all of the student's completed training. I've utilized a portal on the back of the card to display the training list. So far, so good...until a student completes enough training courses to exceed the space on the back of the card. What I would like is to have the database automatically produce a second card when this condition is reached, using the same information on the front while continuing the remaining training list on the back.

       

      I hope my description makes sense. Thanks again for taking the time to review my question. Have a great day!

       

      God bless,

      Bill

        • 1. Re: Printing multi-sided student training cards?
          mikebeargie

          Bill,

           

          one method of doing this is creating additional layouts for "card page 2", "card page 3" etc... then printing those additional pages based on the count of the related records.

           

          So each layout's portal would have a starting row consistent with the page. IE your first page is rows 1-15, page 2 would start at row 16, page 3 at row 31, etc...

           

          Your script would look something like this:

           

          set variable $rows = count (rowstable::field) <--this happens on the student record to count the rows.

          print page 1 orders

          if ( $rows > 15 )

             print page 2 stuff

          end if

          if ( $rows > 30 )

             print page 3 stuff

          end if

          if ( etc...)

             etc... for all pages

          end if

           

          The above method still limits you to a finite number of rows for each student, but gives you the control to place the portal from each "page" (layout) in a specific location on your cards.

          1 of 1 people found this helpful
          • 2. Re: Printing multi-sided student training cards?
            BillisSaved

            Hey Mike,

             

            Thanks for responding so quickly! I like your idea.

             

            One of the things I should've mentioned is that some items in the training list consume multiple lines in order to display all relevant information, while others require only a single line. I was hoping to be able to take advantage of the "Sliding Up" option to better utilize the card realestate, but I don't think that feature is available for fields contained in a protal, and I am unaware of another way to display multiple related records automatically...Do you have any ideas that may work?

             

            Thanks again for your assistance! Have a great day.

             

            God bless,

            Bill

            • 3. Re: Printing multi-sided student training cards?
              erolst

              For printing, don't use a portal. Instead, go to the related records the portal represents, and print them from, say, a multi-purpose layout in list view, where you can set the header and other textual data dynamically (using variables, utilizing header vs. title header etc.), and of course use the sliding option.

               

              The only drawback with this approach might be (depending on your requirements) that list views are purely vertical, so you can't really put things "at the side".

              • 4. Re: Printing multi-sided student training cards?
                BillisSaved

                Hey erolst,

                 

                Thanks for replying to my question! I think I get the gist of the procedure you described, however, I do have a question. If I use the List View, how will I control the page breaks when the training information, printed on the back of the card, exceeds the alotted space? Thanks again for your help!

                 

                God bless,

                Bill

                • 5. Re: Printing multi-sided student training cards?
                  mikebeargie

                  Bill, you are correct in your discovery. "Sliding up" refers to the portal object itself, not the rows inside of it. There is no way to dynamically size each row inside of a portal, they will always be uniform height.

                   

                  HOWEVER, if you follow the directions that erolst left for you, and use a list-view layout of the related records instead, you CAN dynamically size each line in the list view with slide up.

                   

                  The tricky part with that method, as you mentioned above, is constraining each page to the right height.

                   

                  Scripted, that looks something like this (a LOT more difficult):

                   

                  set variable $rows = count (rowstable::field) <--this happens on the student record to count the rows.

                  set variable $student = student table::id key <--a unique serial for the student table

                  -----

                  print front of card one

                  go to layout (training list)

                  perform find (training list::student ID = $student)

                  go to record ( by calc, record #20)

                  omit multiple ( $rows - 20 )

                  print back of card one

                  -----

                  go to layout (students)

                  print front of card 2

                  go to layout (training list)

                  perform find (training list::student ID = $student)

                  omit multiple (20) <--omit the first 20 you already printed, this increases with each card

                  go to record ( by calc, record #20)

                  omit multiple ( $rows - 40 ) <-- this number grows with each card

                  print back of card 2

                  -----

                  repeat above block for additional cards.

                   

                  now, an advanced developer could make a context free version of this for you, and loop the printing as well so it's not all laid out like this, but procedurally, this is what you need to do if you want the student info on the front of the cards, and the related info on the backs.

                  • 6. Re: Printing multi-sided student training cards?
                    erolst

                    Bill -

                     

                    there are printing preferences that you can set for each layout part (open the Part Definition dialog); try fiddling around with them and see if you can prevent the page from breaking in inconvenient places.

                     

                    If not, let us know, there is a pagination routine, based on the number of lines per record, that might help you.

                    1 of 1 people found this helpful
                    • 7. Re: Printing multi-sided student training cards?
                      BillisSaved

                      Hey Mike,

                       

                      Thanks for the help! I apologize for taking so long to get back you regarding your suggested procedure.

                       

                      Before I get to the solution I decided to implement, let me take a moment to restate my original need. Basically, I needed to print dual-sided student training cards. The front of the card would be the same for every student, with the expection of their Student Number, Name, and Employer. The back of the card needed to contain all of the training they have received. The two problems I was attempting to overcome were:

                       

                      1. Since the information for each course, which would be listed on the back of the card, was of differing length, I needed to facilitate the automatic resizing of the field(s) to accommodate the necessary text using the least amount of space possible.
                      2. When the space required to list all of courses for a given student exceeded the space on the back of a single card, I needed the additional card(s) to be generated automatically.

                       

                      With the help of this forum, and other resources, I decided to setup the front of the card as a Sub-Summary (Leading) part. The body contained the pertinent course information. I place a field named "GroupNumber" in the table containing the student training history and sorted the records by this field. This is the code I used to get the multiple card results I needed:

                       

                      CodeSample.jpg

                       

                      Everything seems to be working as expected. Thanks so much to you, and everyone else, for all the assistance! You guys Rock!

                       

                      God Bless,

                      Bill