CppMax Homepage
Forum Home Forum Home > ReportMax > ReportMax
  New Posts New Posts RSS Feed - How to Localize a Report?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to Localize a Report?

 Post Reply Post Reply
Author
Message
Henner View Drop Down
Newbie
Newbie


Joined: 05 Oct 2015
Location: Herford/Germany
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Henner Quote  Post ReplyReply Direct Link To This Post Topic: How to Localize a Report?
    Posted: 06 Oct 2015 at 1:45pm
Hi, my application has a multilingual UI.
By now it is german (de-DE), english (en-GB) and american (en-US).
For that I am working with *resx files wich holds the translated string values for
labels, messages etc.
In the code behind section of the windows forms I use a System.Resources.ResourceManager(RM)
to get the messages into the right language.
The translation for the labels on the form comes from the *.resx files.
This is still the way for the windows form that contains the ReportMaxViewer control.
The control itself seems not to be localizable.
In case of creating one ReportMaxViewer for the users in different languages, I have
to use the ResourceManager to get the translated strings ot from the *resx file an assign
the string to the right label on the report.

Pseudo-Code:
Me.ReportMaxViewer.Labelname.Text=RM.GetString("Labeltext").ToString

Has anyone an idea to solve this?
Thanks in advance

PS
I can imagine, that this is somethiing like the "Setting Image by code" problem which is
solved here.
Henner
Back to Top
emadns View Drop Down
Admin Group
Admin Group


Joined: 06 Feb 2012
Status: Offline
Points: 130
Post Options Post Options   Thanks (0) Thanks(0)   Quote emadns Quote  Post ReplyReply Direct Link To This Post Posted: 06 Oct 2015 at 1:57pm
You can assign any localized text to your labels providing that the label font is a Unicode font or a font that includes the encoding for this language. ReportMax is fully Unicode and can work with any language including the generation of PDF. Fonts like "Arial Unicode MS" is a fully Unicode font. Also you can use a German font with a German text.
Back to Top
Henner View Drop Down
Newbie
Newbie


Joined: 05 Oct 2015
Location: Herford/Germany
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Henner Quote  Post ReplyReply Direct Link To This Post Posted: 06 Oct 2015 at 1:58pm
Yes it is true.
It is pretty the same like the image problem solution (see link above)

Here is the vb.net code snippet:
'-- snip
            Dim myLabel As ReportMaxLabel
            myLabel = CType(Me.ReportMaxViewer1.m_FilePage.FindControl("lblKaufdatum"), ReportMaxLabel)
            myLabel.Text = rm.GetString("Datum").ToString

'-- snap

Be sure to import the System.Globalization class before your public class <formname> begins.
Also be sure to declare and instantiate the ResourceManager Class like this:

Private rm As New System.Resources.ResourceManager("<Namespace>.<ResourceFileWithoutExtension>", System.Reflection.Assembly.GetExecutingAssembly())

Hope that helps
best regards
Henner

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.06
Copyright ©2001-2016 Web Wiz Ltd.