Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

I need to rename the rows that are shown in a Crosstab

edited December 2006 in General
Greetings. I need to rename the rows that are shown in a Crosstab.
Normally it shows the text "SUM ..." and in the event OnGetCaptionText
achievement to do it, but of way estatica. I show them the codigo.
Thanks beforehand.

procedure CrossTab1OnGetCaptionText(aElement: TppElement; aColumn:
Integer; aRow:Integer; const aDisplayFormat: String; aValue:Variant;var
aText: String );
begin
if (aColumn = 1) and (aRow = 2)then
aText := 'CANTIDAD';
if (aColumn = 1) and (aRow = 3)then
aText := 'PESOS';
if (aColumn = 1) and (aRow = 4)then
aText := 'CANTIDAD';
if (aColumn = 1) and (aRow = 5)then
aText := 'PESOS';
if (aColumn = 1) and (aRow = 6)then
aText := 'CANTIDAD';
if (aColumn = 1) and (aRow = 7)then
aText := 'PESOS';
if (aColumn = 1) and (aRow = 8)then
aText := 'CANTIDAD';
if (aColumn = 1) and (aRow = 9)then
aText := 'PESOS';
end;

pp

--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited December 2006
    Hi PP,

    Take a look at the TppElement topic in the RBuilder help. This gives a good
    explaination of what each item is in a crosstab component. I believe in
    your case you will most likely need to use the OnGetDimensionCaption event
    rather than the one you are currently using.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2006
    Hi,

    I'm sorry, perhaps I do not understand what your crosstab looks like. Take
    a look at demo 127 located in the \RBuilder\Demos\2. CrossTabs\... directory
    ct127.pas for an example of using the crosstab events to alter the text for
    each cell.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2006
    Thanks, Nico
    Utilizing the codigo that show down, the alone correct result showed me
    once!. I have studied the RBuilder help, but not achievement to change
    the text of the rows

    procedure CrossTab1OnGetDimensionCaption(aDimension: TppDimension; Var
    aCaption: String);
    begin
    if aDimension.FieldName = 'CANTIDAD' then
    aCaption := 'CANTIDAD';
    end;
    that I am making bad?


    good
    in
    event
    aValue:Variant;var

    pp

    --- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.