Ticket Q575711
Visible to All Users

grand totals color

created 11 years ago

Hello

I need to draw row grand total all one color and specific column totals and content second color. but if I make it this way:

procedure TfrmOrderReport.DBPivotGridStylesGetContentStyle(
Sender: TcxCustomPivotGrid; ACell: TcxPivotGridDataCellViewInfo;
var AStyle: TcxStyle);
begin
pgfQuantity.Styles.Content:= cxStyle32;//red
pgfQuantity.Styles.Total:= cxStyle32;//red
if ACell.Row.IsGrandTotal then
AStyle := cxStyle208; //yellow
end;

it draw all specific column totals one color and the rest of grand total row second color.
As you can see on picture all that is marked yellow has to be yellow.

thank you

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hello,
The OnGetContentStyle event is intended to change the AStyle parameter only, but not field styles. I suggest that you try the approach demonstrated in the attached project. It should help you accomplish your task.

Delphi
procedure TForm1.cxDBPivotGrid1StylesGetContentStyle( Sender: TcxCustomPivotGrid; ACell: TcxPivotGridDataCellViewInfo; var AStyle: TcxStyle); begin if ACell.Row.IsGrandTotal then AStyle := cxStyle2 //yellow else if ACell.DataField = cxDBPivotGrid1Value1 then AStyle := cxStyle1; //red end;
    Show previous comments (1)
    SV SV
    Stanislav Vrábel 11 years ago

      Hello
      One more question.
      And is there a possibility to print it with the colors displayed in grid?

      DevExpress Support Team 11 years ago

        Yes, you can print this colored grid with our Printing System (see the attached project).

        SV SV
        Stanislav Vrábel 11 years ago

          Oh yes
          After comparison i have found it.
          I had there in Format report Use native Styles marked.
          That ́s why it was always the same.
          Thanks

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.