How to translate FastReport labels?

This forum designated to discuss the TsiLang Components Suite.
Post Reply
LeighM
Posts: 4
Joined: Fri Aug 25, 2006 11:34 am

How to translate FastReport labels?

Post by LeighM »

Does anyone know how to translate FastReport?

I placed a FastReport (TfrxReport) component on a form; there is a TsiLanLinked on the form. I would like to translate the labels (TfrxMemoView fields) on the report, but can’t figure out how.

I noted that in the Extended Translations the Report is shown but no TfrxMemoView fields under Report. Any suggestions would be appreciated!

Malcolm
Posts: 109
Joined: Tue Jan 21, 2003 5:18 pm
Location: Scotland

Post by Malcolm »

Here is how I do it.

1. I create a var for each string as follows:

VAR
// translatable report strings
...
_total : STRING = ''; (* Total *)
...

2. write a procedure to update the strings when the language changes.

PROCEDURE TReportForm.UpdateStrings;
BEGIN
...
_total := SiLangRTReport.GetTextOrDefault('str_total'); // str_total is the StringID
...
END;

3. Now I can assign my strings to report variables as follows.

FrxReport1.Script.Variables['thetotal'] := _total;

It is a long time since I did this, but I think TsiLang Expert can help. Something to do with Consts section, I think.

But the above only translates the static text such as report captions. If you need to translate the report data you will have to translate it before passing it to the FrxReport.

I hope this points you in the right direction.

LeighM
Posts: 4
Joined: Fri Aug 25, 2006 11:34 am

Post by LeighM »

Thanks Malcolm

isiticov mentioned "just place TsiLang component on report and you will be able to translate it." (see link below). So I was hoping that it can translate static text on report just as it does for TChart component; in that the caption/text on the report can be translated in Extended Translations.

http://www.sicomponents.com/forum/viewt ... fastreport

isiticov
Site Admin
Posts: 2239
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Since 2003 FastReport dramatically changed the structure and design of their report components and they don't provide any more access to their fields as usual VCL. So I would recommend Malcolm's suggestion too.
Best regards,
Igor Sitikov.

Post Reply