Group By Five Rendering Issue

4 posts, 0 answers
  1. Steve
    Steve avatar
    19 posts
    Member since:
    Nov 2010

    Posted 17 Jan 2011 Link to this post

    I'm the first in our development group to try Telerik Reporting and like it a lot.  I've almost completed my first web project and have always found answers in the forums or your other resoruces but this one I cannot figure out.

    I have a simple stepped report (best to keep it simple!) with multiple detail records:

    Line 1
    Line 2
    Line 3
    Line 4
    Line 5
    Line 6
    Line 7
    ...

    My boss asked if I would break up the long listing (way longer than the 7 detail records above) into "vertical groups of 5" for better readability so it would look like:

    Line 1
    Line 2
    Line 3
    Line 4
    Line 5

    Line 6
    Line 7
    ...

    Basically, I would just add a blank line after every fifth row. 

    So, I added one line at the top of the report class:

        Dim RowCount as Integer = 1

    ...and I added this code into the detail.itemdatabound event:

        RowCount = RowCount + 1
        If RowCount Mod 5 = 0 Then
           Me.detail.Height = New Telerik.Reporting.Drawing.Unit(0.4, Telerik.Reporting.Drawing.UnitType.Inch)
          Else
           Me.detail.Height = New Telerik.Reporting.Drawing.Unit(0.2, Telerik.Reporting.Drawing.UnitType.Inch)
        End If

    I was delighted to see it work great in the Report Designer (both Preview and HTML Preview).  I was further delighted to see it work great in my web application "on the screen", however, when you print or export the report the blank lines are lost!

    Please help!

    I'm using the Q3-2010 Telerik Reporting with Visual Studio 2010.

    Thanks,
    Steve
  2. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 19 Jan 2011 Link to this post

    Hello Steve,

    Instead of the event approach, our suggestion is to use Conditional Formatting with Style Edges Padding Bottom set to 0.2 in and the following filter:
     Expression  Operator Value 
     = RowNumber("MasterReport2") Mod 5  =  =0
     = RowNumber("MasterReport2")  <>  =1

    About your approach - using the report item's definition counterpart is considered a hack with unexpected results. The sender of the event is always the processing counterpart of the data item. However for the current situation it's not applicable.

    Check out the following help articles:

    Greetings,
    Peter
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  3. DevCraft banner
  4. Steve
    Steve avatar
    19 posts
    Member since:
    Nov 2010

    Posted 19 Jan 2011 Link to this post

    Your alternative worked great, thanks!
  5. Doug
    Doug avatar
    26 posts
    Member since:
    Feb 2011

    Posted 06 Oct 2012 Link to this post

    I attemped this with Q2 2012 and could not get it to work.:

    MasterReport2 refers to what? I thought maybe that is the name of the detail section so I tried

    = RowNumber("detail") Mod 3  =  0
    = RowNumber("detail")  <> 1

    as the condtional formatting in the detail section.

    What am I doing wrong?

    This is a WinForm vb.net application


    UPDATE:  I got it to work.  I removed the value "detail" from the function and it worked fine:

    = RowNumber() Mod 3 = 0
    = RowNumber() <> 1

    Doug

Back to Top