2

This is a DevExpress Reporting/XtraReports question. I'm using DevExpress 2011 Vol 1 for Win Forms.

I'm trying to format an XRPivotGrid to get rid of all borders and to change the background color of the cells.

At the moment I'm handling the print events of the control as follows:

private void xrPivotGrid1_PrintHeader(object sender, CustomExportHeaderEventArgs e)
{
    e.Appearance.BackColor = Color.LightBlue;
    e.Brick.Sides = BorderSide.None;
}

private void xrPivotGrid1_PrintFieldValue(object sender, CustomExportFieldValueEventArgs e)
{
    e.Appearance.BackColor = Color.ForestGreen;
    e.Brick.Sides = BorderSide.None;
}

private void xrPivotGrid1_PrintCell(object sender, CustomExportCellEventArgs e)
{
    e.Appearance.BackColor = Color.PaleVioletRed;
    e.Brick.Sides = BorderSide.None;
}

But this isn't enough. As you can see from this image, the header cells with the grey background color don't get reached (ie, these events aren't fired when they're painted for printing).

enter image description here

Anyone know the correct way to do this? Again I want to get rid of the borders and change the BackColor:s of those grey blocks.

Thanks

A. G.
  • 159
  • 11

1 Answers1

2

This is a bug, we have opened a bug report for you at http://www.devexpress.com/Support/Center/p/B187407.aspx if you track this issue you will be notified when a fix is available.

For now you may want to consider this work around:

e.Appearance.BackColor = Color.ForestGreen;
e.Brick.Sides = BorderSide.None;

if(e.Brick is PanelBrick) {
    PanelBrick brick = e.Brick as PanelBrick;
    if(brick.Bricks.Count > 0 && brick.Bricks[0] as IVisualBrick != null) {
        ((IVisualBrick)brick.Bricks[0]).Sides = BorderSide.None;
        ((IVisualBrick)brick.Bricks[0]).BackColor = Color.ForestGreen;
    }
}

In the future if you submit questions like this to the DevExpress support center you will get a much quicker response.

Thanks,

-- Woody