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

Multilanguage Reports

edited December 2003 in General
We have many reports designed with german terms. Now we also need to have
the same reports in english and later also in french or different languages.

Of cause we can copy the reports and changeing the labels into the new
language. But in this case we open a big problem box. If we change later one
report (perhaps new calculations or groupings etc.) we have t make it so
often as much different languages we have!

Does exist there a better way?

In ealier time we used QuickReport (but we want them to be removed). With QR
I wrote a simple routine, which read the labels from a database so that
there was no problem to translate all of the reports into multi languages.
Is that also be possible inside of RB? We are designing the reports mostly
using the EU-Reporting Tool.

Our Environment is Delphi 5 with RB 7.3 and Oracle Database 8.1.7 or 9.2 and
BDE 5.11

Thanks for any recommendations.

Regards

Nicolas

Comments

  • edited December 2003
    Hi Nicolas,

    There is no built-in routine to change the translation of each label in
    ReportBuilder, however you should be able to create a fairly simple routine
    that loops through all components on your report and changes the translation
    of each label to a different language. This will require you to use a
    Report Object Loop. You could write a method (or group of methods) that
    finds each label and translates it automatically perhaps by accessing a
    translation library you create. An example of an object loop is below in
    the following article.

    ----------------------------------------------
    Tech Tip: Loop Thru All Objects in a Report
    ---------------------------------------------

    A ReportBuilder report is composed of a set
    of components. The basic structure is

    Reports.Bands[].Objects[]

    The bands and objects within the report can
    be accessed directly by object name or
    via the Bands and Objects array properties.

    Below is an example of using the Bands and
    Objects array properties to change the font for
    all objects on a report.


    uses
    ppClass;


    procedure AssignFontToReport(aFont: TFont; aReport: TppCustomReport);
    var
    liBand: Integer;
    liObject: Integer;
    lObject: TppComponent;

    begin

    for liBand := 0 to aReport.BandCount-1 do

    for liObject := 0 to aReport.Bands[liBand].ObjectCount-1 do
    begin
    lObject := aReport.Bands[liBand].Objects[liObject];

    if lObject.HasFont then
    lObject.Font := aFont;

    end;

    end;


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2004
    Thank for your response. So it seems to be similar to QR. And it will helps

    Regards
    Nicolas
This discussion has been closed.