6 Replies Latest reply on Dec 23, 2008 8:20 AM by Orlando

    Getting my input printed on paper

    AndreasvanHaren

      Title

      Getting my input printed on paper

      Post

      Now I finished my database, how do I get the information that I put into my database, out on paper? And can I design the way it will come out? I don't want to print the layout page itself, but the info that I did put into the fields.

        • 1. Re: Getting my input printed on paper
          Orlando
            

          Hi Andre,

           

          You will need to setup print layouts, and you can design this however you want the data to look, and then setup a print script that will take the user to the layout, preview it for them and then print.

           

          Something basic would be like:

           

            # 

            Go to layout [ "PrintDetailsLayout" ]

            Enter Preview Mode [ Pause ] 

            Print []

            Go to layout [ Original Layout ] 

            #

           

          If you wanted to isolate the current record you can add the following three steps:

           

            Show All Records 

            Omit Record 

            Show Omitted Only 

           

          I hope this helps.

           

             

          • 2. Re: Getting my input printed on paper
            AndreasvanHaren
               Thanks, this works great. I put a button on the page of the layout that points to another layoutpage that I speccialy designed for the printout. Is it also possibel to put this command instead in the menu bar?
            • 3. Re: Getting my input printed on paper
              Orlando
                

              Hi Andre

               

              You can do this using the Custom Menus as discussed in your other post today. in the Edit Menu Set dialog you can either edit an existing menu or create a new one and Add commands.

               

              You can either add an additional command under the File menu, next to the main print option, or create a new menu altogether for this.

               

              So if you were going to create a new Menu Item, in the 'Edit Menu Set' dialogue click on 'Create...' another dialog will popup, select 'Start with an empty menu' and click 'OK' and you will be in the  'Edit Custom Menu' dialog, here you specify a name, setup when the menu appears and what is under the menu.

               

              If you are going to add to the File menu instead, simply highlight 'File Copy' and click 'Edit...' in the 'Edit Menu Set' dialogue.

               

              Now on the left there is a box called 'Menu Items:' and under it there are 'Add:' options. Click 'Command...' and in the new dialogue select 'No command assigned' and click 'OK'

               

              Now it will be titled 'Untitled' and to the right of the box will be the options for that command. 

               

              Give it a title 'Print Report' and next to the option for 'Action:' select 'Script' and click 'Specify...' and select the print script you created and click 'OK' and 'OK' again to close the 'Edit Custom Menu' dialog.

               

              Now you are back in the 'Edit Menu Set' dialog with the 'Available Custom Menus' on the left and 'Menus in "Menu Set"' on the right.

               

              Your new Custom Menu should be at the bottom of the list on the left, simply double click on it and it will pop over to the list on the right and will be part of you Custom Menu. Then just 'OK' out of everything and you should be able to print your details screen from the menu bar instead of a button.

               

              I hope this makes sense as I find it quite easy to get lost within all the dialogues in creating menu sets.

               

              Do post if anything is unclear. 

              • 4. Re: Getting my input printed on paper
                AndreasvanHaren
                  

                Still having some printing problems...

                 

                The layout is fine now, but when I push my made print button, it is showing all the records instead of only the record that I'm working in . I would like to be able to browse through all my records but at the same time, only print the ne that I'min at that moment of browsing. I made the scripts for the printer button according to the example you gave me and it works, but it shows all the records in te print preview. Is it possible to see only the record I'm working in inthe print preview bu still be able to browse through all the records?

                 

                André

                • 5. Re: Getting my input printed on paper
                  raybaudi
                    

                  Orlando said:

                  If you wanted to isolate the current record you can add the following three steps:

                   

                    Show All Records 

                    Omit Record 

                    Show Omitted Only 

                  • 6. Re: Getting my input printed on paper
                    Orlando
                      

                    Hi Andre

                     

                    Daniele is right but this will loose your found set when you have finished printing, which by the sounds of it you are trying to avoid.

                     

                    There is a trick I have learned that allows you to isolate a current record for printing or perform any other task, but return you to the found set when you have finished, but requires some trickery with Table Occurrences and Go to Related Record if you want to give it a try.

                     

                    Lets say you are dealing with your Contact Records in this instance. Lets say you currently have a Table Occurrence in your Relationship Graph called CONTACTS, based on you CONTACT Table, and this is the one you are doing data entry, viewing and printing records from, and has all your relationships etc.

                     

                    Now what we will be doing is moving your found set to a new Table Occurrence in your Relationship Graph that is also based on the CONTACTS Table that is isolated from any other tables and is simply used for storage of your found set while we preview and print our current record, and then we retrieve them from storage when we are done and leave the use exactly where they were when the pressed the button, or selected the print option from the menu.

                     

                    Here goes:

                     

                    Step 1) In you Relationship Graph create a new Table Occurrence called "CONTACTS STORE", not linked to anything else.

                     

                    Step 2) Now close Define database and go into layout mode and create a new layout called "DEV_CONTACT STORE" based on your new Table Occurrence "CONTACTS STORE", there does not need to be fields or anything on the layout, it will never been seen by the user.

                     

                    Step 3) In you print script you will use the Go to Related Record step to move your found set into the STOTRE table, go back to our print layout, isolate the required record and print. Then we do the same in reverse, go to our STORAGE layout, use the Go to Related Record to move our found set back into the main CONTACT layout. and it will look like this:

                     

                      # 

                      Go to Related Record [ From table: “CONTACTS”; Using layout: “DEV_CONTACT STORE” (CONTACTS STORE) ; Show only related records ; Match found set ] 

                      Go to Layout [ “PrintDetailsLayout” (CONTACTS) ] 

                      # Isolate the current Record

                      Show All Records 

                      Omit Record 

                      Show Omitted Only 

                      # Preview and Print

                      Enter Preview Mode [ Pause ] 

                      Print []

                      # Retrieve the original found to the main table

                      Go to Layout [ “DEV_CONTACT STORE” (CONTACTS STORE) ] 

                      Go to Related Record [ From table: “CONTACTS STORE”; Using layout: “CONTACTS” (CONTACTS) ; Show only related records ; Match found set ] 

                      #

                     

                    One thing to note here is the Go to Related Record needs to be setup so the "Get related record from:" is the Table Occurrence you are actively in with the script, and the "Show records using layout:" is where you want the found set to go to, and that layout must be a different Table Occurrence based on the same Table. Also make sure you have set the "Result options:" to "Show only related records" and "Match all records in current found set".

                     

                    This may take some time to see what is going on, and a little confusing with the different Table Occurrences etc, so build it in steps and follow it through as it goes and it should become clear, and as always do ask if it needs any extra explanation.