2 Replies Latest reply: May 15, 2014 10:11 AM by Grant Perkins RSS

    Creating a Template for a multi line detail section but not using line 1

    wenkailu _

      Hi everyone,


      I am new to the forum and I would like to know if anyone here has ever had the experience of creating a Detail template using trap line > 1 within a sample of multiple detail lines.


      The challenge I am facing is as follows:


      In the report (a .TXT file) the fields I need to extract from a record span all 3 lines of the record, so it is necessary for me to include all 3 lines in the sample text when I set my trap. (Some records have more than 3 lines and some fewer than 3, but the ones I need to trap all have exactly 3 lines.) However, the common features I am looking for are only contained in line 3, so I have to use this (i.e. the last) line in the sample text as the trap line.  This approach creates two problems:


         1. An error message ('Trap line > 1 cannot be used on this file") pops up every time I open the model.

         2. Only the first 525 trapped records are displayed in the table view.


      Any suggestions as to how I can fix these problems would be greatly appreciated.


      Wen-Kai Lu

        • Creating a Template for a multi line detail section but not using line 1
          Olly Bond

          Hello Wen-Kai and welcome,


          I see from your profile that you're using Monarch v9, and there shouldn't be any problem using multi-line traps on text reports with this. You will need to watch out for page breaks when working with multi-line data - you should define a page header if you can and check the line count for default page breaks in Input Options.


          Are you using the floating trap feature? This might cause an issue with the trapping on line>1 but I don't have v9 here to replicate. There will be a solution - there always is with Monarch - perhaps you could trap all the records, including the ones with more than three lines, as a memo field, and then filter out records where len(textline(;4)>0.


          You might then need to use some calculated fields to parse the contents of the memo field into the constituent parts you need. Can you post a sample here between CODE tags?


          Best wishes,




          PS @moderators - please could we move this thread out of the sticky?

            • Creating a Template for a multi line detail section but not using line 1
              Grant Perkins

              Now on own thread.


              Let me know if the title needs changing.


              It occurs to me that this might be a single record line database output that is being wrapped for screen display and that, as such, the 'normal' report modelling rules don't really apply.


              It might therefore be a good candidate for using the Monarch Utility tools to prepare the file prior to attempting modelling and extraction. Or, if the field sizes are fixed and white space is not being compressed, it should be possible to use the data model with field sizes and positions to specify where fields begin and end.


              Not having seen the report I'm guessing a little of course!