Home General

Renaming data fields in a Crosstab

edited June 2001 in General
I am translating an application into another language (Spanish). The
application was developed using Delphi 5 & ReportBuilder 5.55, in which I
make generous use of crosstab reports.

I have the following problem:
- The crosstabs use the standard table field names as column headers. Of
course, these field names have been designed in the Data Module using
English (for example, "Transaction_Amount").
- When translating these crosstab reports into Spanish, I would like to
change the field name to "Monto_de_la_Transaccion" (so that the field shows
up properly into the crosstab reports).

How can I do this?

THANKS.

Best regards,
Ray

Comments

  • edited July 2001
    In demo #127 of the crosstab demo app, it shows that you can use the
    OnGetCaptionText event of the crosstab to read the caption text and change
    it before it is rendered.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2001
    Thanks a lot . However, after analyzing the demo program you mention and its
    OnGetCaptionText event, I am not able to descipher how to change the
    variable's caption. Could you please give me an example (in code)? For
    example, how would you make the crosstab's caption "State" read "Estado" (in
    your own demo #127)?

    THANKS!

    Best regards,
    Ray

  • edited July 2001
    This is what I had in mind:

    {---------------------------------------------------------------------------
    ---}
    { TfrmCT127.CrossTabGetCaptionTextEvent }

    procedure TfrmCT127.CrossTabGetCaptionTextEvent(Sender: TObject; aElement:
    TppElement; aColumn, aRow: Integer; const aDisplayFormat: String; aValue:
    Variant; var aText: String);
    begin

    if (aText = 'State') and (aColumn = 1) and (aRow = 0) then
    begin
    aText := 'Estado';
    end

    else
    aText := aText + ' (C)';

    end; {procedure, CrossTabGetCaptionTextEvent}

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2001
    Works like a charm!

    When you pair up a top-notch software product with consistently excellent
    developer support, you can only win and win big: congratulations!

    Best regards,
    Ray

This discussion has been closed.