2 Replies Latest reply on Mar 11, 2013 8:53 PM by RonaldLow

    How to draw a line after multiple field control breaks

    RonaldLow

      Title

      How to draw a line after multiple field control breaks

      Post

            

           I have frequently made long list type reports easier to read by drawing a line when a particular field changes.  Say you have a  a list of transactions sorted by date.  You add a subsummary containing only a horizontal line that triggers on a change in date.  When the report is run, the transactions are visually grouped by date:
            
           3/09/2013  xxxxxxx
           3/09/2013  xxxxxxx
           ---------------------------------
           3/11/2013  xxxxxxx
           3/11/2013  xxxxxxx
           ---------------------------------
            
           Now I would like to do something more complex:  I would like to draw two different lengths of line, each line breaking on a different field.  The major break is on date, with a minor break on product ID.  The report would look like this:
            
           3/09/2013  123  xxxxxxx
           3/09/2013  123  xxxxxxx
                                -----------------
           3/09/2013  130  xxxxxxx
           3/09/2013  130  xxxxxxx
           ---------------------------------
           3/11/2013  123  xxxxxxx
           3/11/2013  123  xxxxxxx
                                -----------------
           3/11/2013  127  xxxxxxx
           3/11/2013  127  xxxxxxx
           ---------------------------------
            
           My problem is that when the major field breaks, I also get a break on the minor field, which draws a double line:
            
           3/09/2013  127  xxxxxxx
                                -----------------
           ---------------------------------
           3/11/2013  123  xxxxxxx
            
           I created a stored calculated work field as a proxy for the product ID that changes when there is a change in the product ID, but not if there is also a change in the date. So the change in the minor field is suppressed if there is also a change in the major field.  Unfortunately, this did not work.  A break in the major field implies a break in the minor field, so I still get a double line.
            
           Is there any way around this?

        • 1. Re: How to draw a line after multiple field control breaks
          philmodjunk

               Your calculation field may be all that you need here.

               You have two issues: the length of the line--which can be controlled by a calculation or conditional format and the amount of space taken up by each sub summary part.

               Simply using a calculation or conditional format to control the length of the line will still leave you with extra space between your listed records when date and product ID change so you really need a single sub summary part here that will appear if the date or the product ID changes.

               If your horzontal line is a text object you can use conditional formatting to change the font size to 120+ to make that text object invisible so you can layer two such objects on top of each other and use conditional formatting to control which is visible.

               If your horizontal line is a graphic, you can place graphics in two global container fields and use a calculation field with "container" specified as the result type to control which is visible in each sub summary layout part instance.

          • 2. Re: How to draw a line after multiple field control breaks
            RonaldLow

                 Thanks for the ideas.  I hadn't considered using container fields nor am I familiar with them.  Let me do a little exploring and I'll report back.  You are right that this would work best with a single subsummary part.  I could unconditionally draw the short line at control breaks and then just turn on or off an additional segment if there was a break on date.