How do I change color on group header.

weiwei
edited 6:07PM in FastReport .NET
if (((Int32)Report.GetVariableValue("RowNumber")) % 2 == 0)
GroupHeader1.FillColor = Color.Gainsboro;

This is what I did in the script, but it does work. Any idea why?

Text5.Text = Report.GetVariableValue("RowNumber").ToString();

This shows in the text the RowNumber is 1,2,3,4......and so on. but

GroupHeader1.FillColor = Color.Gainsboro; doesn't seem to do anything.

Please help.

Comments

  • edited 6:07PM
    Hello,

    I do this in the group header's BeforePrint event handler and it works:
        private void GroupHeader1_BeforePrint(object sender, EventArgs e)
        {
          if (((Int32)Report.GetVariableValue("Row#")) % 2 == 0)
            GroupHeader1.FillColor = Color.Gainsboro;
        }
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.