FlexReport - Alternate row shading within a group

Posted by: simon.stone on 18 September 2017, 8:43 am EST

  • Posted 18 September 2017, 8:43 am EST

    I am trying to add an alternate row shade within FlexReport. I am aware of the existing implementation (where you initialise a counter in Report.OnOpen and increment it in Detail.OnPrint), however this doesn't work as well within groups. The rows highlights are just alternated, regardless of where they sit within a group.

    So, I would like the first row in a group to have a white background, and from there each alternate row to have a different .BackColor property.

    Any ideas?
  • Marked as Answer

    Replied 19 September 2017, 3:28 am EST


    In order to set alternate backcolor group wise, you just need to reset the counter to 0 in GroupHeader's OnFormat property.

    _styleCtr = 0

    Please refer the attached report where the first record of every group is rendered with white background.


  • Replied 19 September 2017, 8:15 am EST

    Thanks Pragati - should have spotted that myself.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels