3 Replies Latest reply: May 15, 2014 9:54 AM by Data Kruncher RSS

    Trapping irregular details

    Data Kruncher

      Hi all.

       

      I'm trying to trap some funny invoice numbers on detail lines that look like this:

      [font="courier"]            19662       14-FEB-2003                                

                  21900       16-APR-2003                        1,712.00

                  CAN38163-   24-AUG-2001                               

                  01R19515                                              

                  21901       16-APR-2003                        1,712.00

                  CAN38163-   19-SEP-2000                               

                  01R65349                                              

                  21902       16-APR-2003                        1,712.00

        /font[/quote]Most of the numbers are 5 digit, but the CAN numbers which wrap to the next line in the same columns are my problem. For instance, I want to generate a record for invoice CAN38163-01R65349.

       

      I can trap the line with the first part of the number along with the date and whatever else on the same line as detail traps (I would get CAN38163- as the invoice number), but the second part of the longer numbers doesn't trap properly as a footer or append trap. I've tried trapping Part1 (detail) and Part2 (append/footer) fields to combine using a calculated field for the invoice number, but the Part2 goes to the wrong record, and carries forward until the next occurence of a 2 line invoice number.

       

      This really shouldn't be too difficult to do (or explain     though I seem to be having difficulty with this too).

       

      What am I doing wrong? Should I be using a 2 line detail trap instead of only 1 line?

       

      TIA

       

      Sandy

        • Trapping irregular details
          Nick Osdale-Popa

          I did this one several ways.

          Trap on one line.

          When you trap the Inv. Number, goto advanced and change the End Field On[/i] to one of these options:[b]

          Line #2

          Blank Field values (1)

          End of Left Justification

          /b

           

          HTH

           

          [size="1"][ May 07, 2003, 03:37 PM: Message edited by: Nick Osdale-Popa ][/size]

          • Trapping irregular details
            Grant Perkins

            Hi Sandy,

             

            If you set up your detail template (I trapped using the - es in your date field) and for the invoice number field use Options>End Field On and then one of the options (Minimum action only seemed to work on the sample) you should get both lines of the Invoice in each table record.

             

            BUT

             

            You may find an unwanted space in the middle of the record (5.02 does this for example). I remember some posts re this a few months ago but cannot recall the final resolution from memory. May have been to create a calculated field and strip out the space which I seem to recall ws not a space at all.

             

            Will mod the post when I find the original.

             

            AH! I see Nick posted while I was preparing the response. It was he who identified the origin of the space as well. Nick - can you remember the details?

             

            Found it  [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000099#000000"]here[/url]

             

            Grant

             

             

                Originally posted by Data Kruncher:

            Hi all.

             

            I'm trying to trap some funny invoice numbers on detail lines that look like this:

            [font="courier"]            19662       14-FEB-2003                                

                        21900       16-APR-2003                        1,712.00

                        CAN38163-   24-AUG-2001                               

                        01R19515                                              

                        21901       16-APR-2003                        1,712.00

                        CAN38163-   19-SEP-2000                               

                        01R65349                                              

                        21902       16-APR-2003                        1,712.00

              /font[/quote]Most of the numbers are 5 digit, but the CAN numbers which wrap to the next line in the same columns are my problem. For instance, I want to generate a record for invoice CAN38163-01R65349.

             

            I can trap the line with the first part of the number along with the date and whatever else on the same line as detail traps (I would get CAN38163- as the invoice number), but the second part of the longer numbers doesn't trap properly as a footer or append trap. I've tried trapping Part1 (detail) and Part2 (append/footer) fields to combine using a calculated field for the invoice number, but the Part2 goes to the wrong record, and carries forward until the next occurence of a 2 line invoice number.

             

            This really shouldn't be too difficult to do (or explain             though I seem to be having difficulty with this too).

             

            What am I doing wrong? Should I be using a 2 line detail trap instead of only 1 line?

             

            TIA

             

            Sandy /b[/quote]

             

            [size="1"][ May 18, 2006, 05:53 PM: Message edited by: Todd Niemi ][/size]

            • Trapping irregular details
              Data Kruncher

              Thanks guys!

               

              In the end, the best solution was to use the "End of left justification" option, but I still had a problem. If the last row on a page was a detail line, some of the heading on the next page became part of an invoice number. I stopped this continuation by defining a template to include all of the page heading rows  without[/i] defining any fields in the template.

               

              And, you're quite correct about the extra space (chr(32)) I would get with my version 5.02.

               

              Thanks again!