2 Replies Latest reply: May 15, 2014 9:57 AM by ijf _ RSS

    Detail trap help with field not always present

    ijf _

      Hello,

      I am new to Monarch and am using Monarch Pro v9 on Windows XP.

       

      I have been struggling with this trap for a few days and thought I would post. I have a field that varies between 2 and 3 lines. It is my detail template. The problem I am having is that if it is 2 lines there is no blank line before the next template. I would like to capture the NOTE field on its own when it is present. I have a manual work-around just for the very short term which is to go in and add a blank line when there are only 2 lines... If this is a potential solution, I am not sure how to automate that process, so I would be interested in either a trapping solution or a file prep solution. I am able to trap other fields that are actually multi-line, but this one either exists or it does not so I am not sure how to trap a start and end on it.

       

      I would appreciate any ideas.

      Thank you,

      Ivy

       

      Sometimes it is 2 lines like this (followed by the next appended template line):

      [font="courier"]0                 * MEAS. MONITORING DATE:   05/31/07  COMP24                                 MG/L                   3.85          *    

                         

      •                                    02/30                                                                       *    

      0  WXYZ  FINAL    12345                 0 YYYYYYYYYYYY GRAB                   ******   ****** SU        6.0      DELMON   9.0              /font[/quote]And sometimes it is 3 lines like this (followed by the next appended template line):

      [font="courier"]0                 * MEAS. MONITORING DATE:   05/31/07  GRAB                                   SU                               7.6 *    

                         

      •                                    02/30                                                                       *    

                         

      • NOTE: SOME MORE INFORMATION IS HERE                                                                            *    

      0  wxyz  FINAL    12345                 0 YYYYYYYYYYYY GRAB                   ******   ****** SU        6.0      DELMON   9.0              /font[/quote]

        • Detail trap help with field not always present
          Grant Perkins

          Hi ijf and welcome to the forum.

           

          A typically nasty little challenge you have there.

           

          If the information on the occasional third line ALWAYS preceded by the text "NOTE:" in the same position whenever the third line exists?

           

          Does the note information ever extend to a fourth line?

           

          If YES to the first question and NO to the second, try this.

           

          Make you DETAIL template sample just the two lines that always exist. Map your fields - you probably already have them in place.

           

          Create and APPEND template with a single line sample - does not matter muuch which line you use. Give it the same trap as your detail template.

           

          'Paint' a field to start just after the "NOTE:" position on the line and make it as wide as you need it.

           

          Right click on that field, go to the Advnaced Properties tab. IN the first section you will see an option for 'Start field on ... preceding string on the current line...' in the box provided enter "note:" (without the quote marks of course). If the note is only ever one line that should be all you need to do. If it can be longer you may need to investigate the 'End field on...' options as well.

           

          OK the template and check what it gives you across a whole report.

           

          In the table you should see the 'Note' field (or whatever you called it) filled only where there is a note to report.

           

          If that does not give you a solution let us know so we can endeavour to work out why.

           

          HTH.

           

           

          Grant

          • Detail trap help with field not always present
            ijf _

            Grant,

            Thank you for such a quick and detailed response. That worked great, and I am thrilled!

             

            That solution would have never occured to me, but now it makes sense and will help me in the future.

            Thank you,

            Ivy