KB-50264: Sorting out messages by language and displaying only the selected one when printing.

Question:

In an application developed in two different languages (English and Portuguese, for example), the alarm messages are saved in both languages. How can I sort these messages out, and then display only the messages in the selected language when printing the report?

Solution:

First you must save both messages individually, via a separator. In this article, we use a high temperature alarm which will be recorded as a record in the database as “Temperatura Alta /// High Temperature”. By using VBScript’s Split function in the Report’s OnFormat event, we can search for this separator, which in this case is ” /// “, and show only the message in the desired language.

Example:

Sub OnFormat
   arrmsg = Split(Report.Sections("Detail").Controls("Field3").Text , " /// ")
   if Application.GetFrame().Screen.Item("OptionButtonPT").Value then
      Report.Sections("Detail").Controls("Field3").Text = arrmsg(1)
   elseif Application.GetFrame().Screen.Item("OptionButtonEN").Value then
      Report.Sections("Detail").Controls("Field3").Text = arrmsg(0)
   end if
End Sub

NOTE: Attached do this article is a sample application using this function.

Attachments:

Sample.zip

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *