3 Replies Latest reply: Dec 24, 2016 3:16 AM by Grant Perkins RSS

    Random multiple lines

    Peter Small

      I have a file that has changed from one line to a random 2nd line if the new field is populated. The 2nd line will always begin with B if it exists. How can I change my detail template to catch this line when it exists?  Thanks, Peter

        • Re: Random multiple lines
          Olly Bond

          Hello Peter,

           

          There are lots of ways to handle this - none very easy to explain in a forum post without pictures. You could make a two line sample, with a field on line two where the advanced field properties specify it starts with a B.

           

          You could make a footer template, that is cleared by the detail template. Or you could get tricky with a multi-column region and a filter. Which option is best depends on the input file format (text or PDF) and the version of Monarch you have, And whether you have a blank line in between single line details rows.

           

          Best wishes,

           

          OIly

            • Re: Random multiple lines
              Peter Small

              Thanks for the response and sorry for the delay. Below is a screen shot of what I'm trying to grab. The document is rich text format.

               

              My header:

               

              Data attempting to capture. As you can see the data only wraps if the field is populated

                • Re: Random multiple lines
                  Grant Perkins

                  Hi Peter,

                   

                  Assuming the A lines are your DETAIL records you will only have a single sample line to play with.

                   

                  A couple of suggestions for you.

                   

                  For any fields (column positions) that may "wrap" onto the second line you might make the field a Multi-Line field, extract both lines in one field and then slice and dice the fields into A line values and B line values. The TEXTLine function would probably be in play for that. It would also mean extracting as text and converting to numeric using the Functions available and some Calculated Fields (AKA Formula Fields.)

                   

                  Another option, one that might seem a little counter-intuitive, is to use an Append for the second line. Yes, I know, It can't be done, right?

                   

                  But sometimes it can.

                   

                  Take your detail template.

                   

                  Crate an Append Template and have it use exactly the same trap as your detail template. Draw in the fields where they appear on the second line as usual. For each field go to the Advanced Properties and set a Preceding String something like

                   

                  <space><space>B<space><space>

                   

                  What you are seeking to do is use the B in the second line as a vertically "floating" sort of trap that will work for every valid row and only valid rows, in the report.. It's a simple thing in your sample lines but may not be so easy in the full report.

                   

                  The append fields will be populated only to the records with a B line if everything is working as intended since the APPEND is reset with every DETAIL record discovered.

                   

                  See if those ideas work for you.

                   

                  If not we will need to find something new and different.

                   

                  Grant