11 Replies Latest reply on Sep 16, 2016 6:25 AM by taylorsharpe

    Images Not Always Appearing in Print

    Razor

      I have an issue with a label that has a QR code on it. My problem is when I print a batch of labels I sometimes get labels without the QR code on them. It appears the print command executes before the record completely loads in to the layout. From a little experimenting it appears I can fix this by adding a pause statement before the print, but this doesn’t seem right to me.

       

      To me it seems more like a band-aid than a fix. Maybe this is an accepted practice but I don't like it because what may work today might not be long enough under some other condition 6 months down the road.

       

      Here is how this works. After the user enters revision, quantity, and the number of labels to be printed in the parent layout, they click the print button. My script then runs like this;

      • Set variables from the first record to capture the part master ID, part revision, and quantity.
      • Set a counter variable
      • Start loop
        • Generate the QR code from the record’s UUID. This is done with a Perform Script on Server command with the option set to wait for completion. There is a reason why this runs from the server which for simplicity's sake I will not get in to here.
        • Commit the record
        • Go to label layout
        • Pause (currently .1 seconds)
        • Print label
        • Go to original layout
        • Check to see if counter value has been hit, if not increase by one
        • New record request
        • Populate part master ID, part revision, and quantity fields
        • Commit records
        • Refresh window
      • End Loop

       

      If I remove the pause I get all sorts of different results. Sometimes my first label won’t have the QR code, sometimes its the 3rd and 4th, but the 5th will print fine. There’s no apparent pattern.

      When I go to check, all my records in the table have the QR code in them. So that part of my script is working great.

       

      Is there some type of command to check and see whether the record is fully loaded in to the layout before printing?

       

      Is there a better way of doing this?

        • 1. Re: Images Not Always Appearing in Print
          beverly

          I don't know if it helps, but you can Pause for 0 seconds and the script works, the pause is faster than a second and I use it when I need the machine to catch up with itself (like after an import or hefty calculating or printing).

           

          Pause in not a Server Compatible step, but you can error trap for that if you really need it otherwise.

          2 of 2 people found this helpful
          • 2. Re: Images Not Always Appearing in Print
            taylorsharpe

            Pause in not a Server Compatible step, but you can error trap for that if you really need it otherwise.

            Actually, good news in 15.  Pause finally works on FileMaker server, which there were some real useful places for it.  But it doesn't work in 14 or before on FileMaker server. 

            1 of 1 people found this helpful
            • 3. Re: Images Not Always Appearing in Print
              Razor

              A zero length pause worked! Who would have thought? I tested it and went 10 for 10.

               

              I then commented out the pause and got 3 of 10. Labels 2, 5, ands 8 were the only ones that were correct.

               

              In Access I use to use a command DoEvents whenever things just didn't work out like you expected them to. Similar situations.

               

              Thanks for the help. Apparently I didn't mark this as a question but the help is appreciated!

              • 4. Re: Images Not Always Appearing in Print
                beverly

                FMS15 with FM15?

                beverly

                • 5. Re: Images Not Always Appearing in Print
                  beverly

                  here's what I found

                   

                  FileMaker Pro 15 Help

                  Pause/Resume Script (fms14)

                  Pause/Resume Script 

                  (fms13)

                  Pause/Resume Script

                  (fms12)

                  Pause/Resume Script

                  NOT SUPPORTED fms11

                   

                  I have too many clients slowly moving from 11 to 15! (but they are moving!!)

                  • 6. Re: Images Not Always Appearing in Print
                    taylorsharpe

                    beverly wrote:

                     

                    ...

                     

                    I have too many clients slowly moving from 11 to 15! (but they are moving!!)

                     

                    Its an on going developer battle that gets more fierce now that FM is doing annual upgrades.  However, we made a company policy that we don't work on versions more than 2 back.  We will help them migrate to the current version only if they are more than 2 back.  It also gets to be a matter of practicality keeping up with all the version differences. 

                     

                    Good luck encouraging them to move!

                    1 of 1 people found this helpful
                    • 7. Re: Images Not Always Appearing in Print
                      beverly

                      you forget where I live.

                      beverly

                      • 8. Re: Images Not Always Appearing in Print
                        taylorsharpe

                        beverly wrote:

                         

                        you forget where I live.

                        beverly

                         

                        I'm afraid I forgot and had to look you up in Linked in...  not far from London!  <grin>  But bet you have some wonderful forests out there compared to Texas. 

                        • 9. Re: Images Not Always Appearing in Print
                          beverly

                          forests, waterfalls, hills and hollers

                          harder to make those US dollars

                          we've got i'net

                          we've got flushies

                          about the rest I do not bother

                          • 10. Re: Images Not Always Appearing in Print
                            alangodfrey

                            "However, we made a company policy that we don't work on versions more than 2 back.  We will help them migrate to the current version only if they are more than 2 back."

                             

                            Then you feel my pain, Taylor.  You must be a Wordsmith of Shakespearean ability to find a way to phrase it that doesn't sound to the customer suspiciously like 'Bait-and-switch', or even worse, "Our policy is that unless you pay us $000 every couple of years - on top of any licencing/development charges - we have only two things to say: and the second is 'off' "

                             

                            Loop

                            "Er... hold on a minute... you'll not be paying us anything every two years - it'll be to another company altogether.  I know you don't understand why you have to pay them money whenever you don't even deal with them.  Anyways, even if we didn't have the policy of only supporting a couple of versions ('years') back, well, they won't either, so between the two of us we're going to squeeze and squeeze until you..."

                             

                            Exit Loop If [FM offer support, or at least 'As as', for the typical lifetime of a solution.  Which in these parts is far more than 2 years.]

                             

                            It's me, I know it: never was able to sell coals to Newcastle, snow to... anybody.  I start saying the words and the customer finishes off the sentence as above.  They are incredibly happy with FM11 and all of the features that it/we offer.  They have precisely zero interest in iBeacons.  And are positively angry that the same-cost new-version Pro Clients only support 5 users peer-to-peer.  They are, to a man or woman, deeply cynical.  Oh, to be silver-tongued.

                            • 11. Re: Images Not Always Appearing in Print
                              taylorsharpe

                              Alan...  one thing working in favor of convincing customers to upgrade is that it is more than just features they are upgrading, it is also security.  Security is a moving target, of which FileMaker is no cause.  But not keeping up with it certainly increases your vulnerability.  Another thing that has made it easier is that I've slowly gotten most of my clients onto Annual licensing and we don't even have to have this discussion.  I just pick the weekend to do the upgrade and it happens.  Most of us run into a few clients who are used to getting a version and using it for 10 years and expecting the world not to change around them and they act surprised when they cannot install a 10 year old FMP on a new computer (no, Windows XP is not supported anymore <grin>).  At some point you just have to be a regular consultant, offer solid advice, and they either take it or they don't and you move on.