8 Replies Latest reply: May 15, 2014 10:09 AM by Nancy10 _ RSS

    Template problem

    Nancy10 _

      I'm having trouble creating a template that works correctly. Here's a very short example of the report:

       

      -


      Item-#                    Cat/sub-cat Eff-date  Regular-prc Loc    Qty-on-hand   Markdn-qty  Old-price-1   Old-ret-val     Markdn-$

      Description               Class/Subcl Stk-unit    Last-cost          Qty-avail     Variance  New-price-1   New-ret-val     Markdn-%

                                Type /Seasn Vendor-#                                                                               

      -


                                                                                      BFSHEYE                   31PKS/19NOG 01/04/11         .00  101              3     <On-hand>        .77           2.31          .81-

      d    EYE GLASS CASE       31OTH/01NON EACH             .490                  3                      .50           1.50        35.06-

                                01PRO/01PMD B & F001                                                                               

      102             15     <On-hand>        .77          11.55         4.05-

                                                                                  15                      .50           7.50        35.06-

                                                                                      103              0     <On-hand>        .77            .00          .00

                                                                                   0                      .50            .00          .00                                                                               

      104              2     <On-hand>        .77           1.54          .54-

                                                                                   2                      .50           1.00        35.06-

                                                                                      105              0     <On-hand>        .77            .00          .00

                                                                                   0                      .50            .00          .00                                                                               

      106              0     <On-hand>        .77            .00          .00

                                                                                   0                      .50            .00          .00                                                                               

      107              0     <On-hand>        .77            .00          .00

                                                                                   0                      .50            .00          .00                                                                               

      110              0     <On-hand>        .77            .00          .00

                                                                                   0                      .50            .00          .00                                                                               

      114              0     <On-hand>        .77            .00          .00

                                                                                   0                      .50            .00          .00                                                                               

      BKS              0     <On-hand>        .77            .00          .00

                                                                                   0                      .50            .00          .00                                                                               

      OWH              0     <On-hand>        .77            .00          .00

                                                                                   0                      .50            .00          .00                                                                               

      Totals for item:                                  20           20                      15.40         5.40-

                                                                                  20            0                      10.00        35.06-

                                                                                      /code

       

      In an oversimplified table view, I expect to see the following

       

      Item #              Location   Qty-on-hand

      BFSHEYE              101         3

      BFSHEYE              102         3

      BFSHEYE              103         0

       

      et cetera

      /code

       

      Instead, I am seeing this (ignore bad alignment):

       

      Item #              Location   Qty-on-hand

      BFSHEYE              101         3

      d    EYE GLASS      102         3

      d    EYE GLASS      103         0

      /code

       

      The location and qty-on-hand are trapped as the detail template. The item # is trapped as an append template. Obviously this doesn't work.

       

      I've tried trapping the item # as a footer template. That doesn't work either. And I've tried a number of possibilities in the Advanced Field Properties, but nothing has worked yet.

       

      Suggestions welcome!

       

      Nancy

        • Template problem
          Grant Perkins

          Nancy,

           

          Could you add all or part of <On-hand> as a trap item to both the Detail and the Append template?

           

          You would, I think, need it in both to ensure that the Append is still seen as an append - it's trap must not extend beyond the detail trap definition.

           

          I am assuming the <On-hand> (or something along those lines) is a fairly constant content that can be trapped as required.

           

          If that is not the case is there any other combination of potential traps that occur on line 1 but not line 2 for each Item #?

           

           

          Grant

           

          ETA - maybe a NON-BLANK location code would work as well?

            • Template problem
              Nancy10 _

              Grant,

               

              I tried adding Qty on hand to the Append template. Results did not change. I tried adding Location to the Append template. Results didn't change.

               

              Both the qty on hand and the location are printed for every item.

               

              >>ensure that the Append is still seen as an append - it's trap must not extend beyond the detail trap definition.<<

               

              You lost me on that...

               

              Here's the strange thing. The real report consists of thousands of items. The model works correctly for most of them, but not all. I can't find the pattern of why it doesn't work, so I took it down to bare bones and built a simple model from the ground up using a report from one of the items that doesn't work. And that's where this thread started.

               

              Shouldn't this be easy??? I've created lots of models far more complicated than this one.

               

              Nancy

                • Template problem
                  Joe Berry

                  I may be making this too simple, but I trapped a single line as the detail and painted the item number, the location and the quantity on hand.  I marked the item number to copy the value from previous record.  I obtained the desired results.  My solution will work if you are not importing a database.

                    • Template problem
                      Nancy10 _

                      Joe,

                       

                      That's a great start, and it works for the oversimplified example I gave. Unfortunately, the example of the expected results really is too simple.

                       

                      For each record, I also need to include information from the second and third lines of the item information so that the result looks like this:

                       

                      Item #      Description             Category  Class   Type    Location   Qty-on-hand

                      BFSHEYE     d    EYE GLASS CASE     31PKS     31OTH  01PRO       101         3

                      BFSHEYE     d    EYE GLASS CASE     31PKS     31OTH  01PRO       102         3

                      BFSHEYE     d    EYE GLASS CASE     31PKS     31OTH  01PRO       103         0

                       

                      /code

                       

                      If I follow your lead and pick up Line 2 as an append, and Line 3 as an append, it looks good except the first line, location 101, does not pick up the Description, Class, or Type which come from Lines 2 and 3.

                       

                      Ideas?

                       

                      Nancy

                        • Template problem
                          Grant Perkins

                          Nancy.

                           

                          Make the detail a 3 line sample for the template trapping on 3 chars of Location as 'not blank' and the 1 digit always there in the QOH column as 'numeric.

                           

                          Paint the Location and QOH fields.

                           

                          Make the Append template a 3 line sample too. Trap on the same places as for the detail field but add a 'not blank' in the very first character of the line as well (I assume your data does not have any Item codes that start with a blank ..... but having seen such problem in the past I will leave you to check that and come up with an alternative trap (or fixed data!) if required. Also be sure to make the Location ID field a character type not numeric.

                           

                          Paint the append fields for Item number, description, and the Cat/Class/Type fields.

                           

                          Assuming you want all locations that should be it - at least based on the sample. You may need to re-order the field in the table of course to get the layout as you want it.

                           

                          HTH.

                           

                           

                          Grant

                            • Template problem
                              Nancy10 _

                              Grant,

                               

                              You're a genius! It works perfectly. This technique is one I haven't run across before. Now I just have to internalize its logic....and make some notes.

                               

                              Many thanks--

                               

                              Nancy

                                • Template problem
                                  Grant Perkins

                                  Hi Nancy,

                                   

                                  You are too kind with your praise - I'm just glad it works for you.

                                   

                                  If it helps I always think of reports in this format as a right hand side giving 'detail' data (In Monarch terms) and the left side likely to be 'append' data at one or more levels.

                                   

                                  Using the same trap method for the appends as the details (or at least setting out along those lines  - a report may require further template tweaking to get everything working, perhaps even additional unrequired trapping for the detail template in order get the append(s) to work) means that the appends will reset according to detail 'rules'. Add the append's own identifier (populated first character of first line in this case) just ensures that you don't get blanks.

                                   

                                  Since this report has 3-line records for detail and, thankfully, append type information we can make the trap broadly common to both and set the sample size to 3 lines to give control to avoid picking other lines that may present themselves as 'details' in their own right.  Of course this is not always the case and other reports might look similar in overall format yet not respond in the same way because, for example, the number of lines per detail record varies or the number of lines in the 'append' side varies and exceeds 3 (or whatever number of lines the detail record presents.)

                                   

                                  In theory the append template (knowing a 3 line sample can be used) probably only requires the 'first character on first line' trap but including the other trap point used in the detail template should, in most cases, ensure that the the two templates are well coordinated without having to double check every instance of the report for unexpected anomalies.

                                   

                                  Add further notes here:

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                  Grant