LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NI report with Cyrillic text

Hi all,

I need to produce a pdf report with Russian text.
As you can see in the code, I using the "NIReport_SetTextAttribute"command for transliterate the charset to russian.
if I set the system language to Russian I can type Russian characters in to pdf, there is no error.
But when I change the system language ( exp:to English),there is not any characters in to pdf.
How can I solve this problem?

Download All
0 Kudos
Message 1 of 20
(4,706 Views)

Hi dcicek,

 

So are you saying that it only doesn't work if the system language is in English, in that case nothing comes up in the PDF report? 

Regards,
Basil
Applications Engineering
National Instruments
0 Kudos
Message 2 of 20
(4,661 Views)

No, the same thing happens for the other languages. I choose a different language from to Russian. I write the string using cyrilic characters. But I see meaningless characters when I open the PDF.

When I try the value of  "charset_symbol" to "NIR_TEXT_ATTR_FONT_CHARSET"  ,I see the symbol in PDF for same string.

So I expect to see Russian text when I use the value of "CharsetRussian" to "NIR_TEXT_ATTR_FONT_CHARSET".

 

At the same time I have tried the other value in "NIR_TEXT_ATTR_FONT_CHARSET." When I set the different language from the system language,I can not see the truth character ,which is I set the command.

 

I do not understand this.  if I want to see the correct charcters in pdf, are both of languages(system language and I set using font_charset)  must be the same?

If so, what do you need the value of "NIR_TEXT_ATTR_FONT_CHARSET." of "NI_Report_SetTextAttribute" command.

0 Kudos
Message 3 of 20
(4,647 Views)

These may be relevant: http://digital.ni.com/public.nsf/allkb/E59213F8079A569586256BD400722208 and http://zone.ni.com/reference/en-XX/help/370051Y-01/cvi/libref/cvistandard_language_additions/ . CVI uses your computer's Regional Settings

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 20
(4,633 Views)

Hi Humphreyy,

Thanks for your reply, but this not the right solution for my problem.

I am developing a multi_language application. And I want to the system language must be English.

If I change the system language, computer resets itself every time.

As you can see in picture, I solved the problem of sting language in the panel.

I want to create PDF which language is I chose to using software. And I dont want to change system language.

Is there a way for this problem?

0 Kudos
Message 5 of 20
(4,608 Views)

Hi Dcicek,

 

Here is a list of all the functions for NI Report Generation in LabWindows/CVI 2012. http://zone.ni.com/reference/en-XX/help/370051V-01/toolslib/toolslibreportgenerationcontrol_function...

 

You can see there is a function called Set Text Attribute http://zone.ni.com/reference/en-XX/help/370051V-01/toolslib/functionreference/cvinireport_settextatt... which might be useful. One of the attributes includes Charset which contains a Russian character set: http://zone.ni.com/reference/en-XX/help/370051V-01/toolslib/nir_text_attr_font_charset/. The question is whether you have an efficient way to type Russian text using those character sets without actually changing the system language since you don't want to do that. Let me know what you think.

 

Regards,
Basil
Applications Engineering
National Instruments
0 Kudos
Message 6 of 20
(4,582 Views)

I have already applied this method. You can see the code in my first post. But I see meaningless characters when I open the PDF. I think the function did not work or there is something wrong in the function. 

0 Kudos
Message 7 of 20
(4,566 Views)

There's no one who can help to me? Smiley Sad

0 Kudos
Message 8 of 20
(4,524 Views)

Hello Basil and Humphrey;

 

I will try to explain the problem. Let's go over a CVI example, so you can reproduce it on your own.

In the NI report example (nirsample.cws) shipped with CVI installation, an attribute called NIR_TEXT_ATTR_FONT_CHARSET is used.

 

In one case, it is changed to "NIRConst_CharsetSymbol".

As a result of this symbol charset setting, if you type "qwerty" as a string in your code, it is displayed as 6 different symbols side-by-side in the resultant PDF report file (we print the file to a PDF printer not on paper).

 

This means, the report toolbox gets the character codes representing the letters "q,w,e,r,t,y" and prints corresponding symbols instead whose character codes match those latin letters. To obtain this result, you do not need to change any computer setting (system locale, CVI editor font charset, etc).

 

So we thought, if we type some the same "qwerty" string and then select the Russian charset instead of symbol we would see corresponding characters from the Russian alphabet. But that is not the case.

 

The only way to print Russian into NI report is to change the system locale (Control panel > Regional Options > Default language for non-unicode programs) to Russian. In that case, we can print Russian characters in the code as strings.

(we also set the keyboard input language to Russian, but that is not a must, you can type Russian using combinations like ALT + 0215 once the locale is Russian and still get the same result)

 

After this locale setting, the created PDF displays Russian characters even if the NIR_TEXT_ATTR_FONT_CHARSET attribute is not NIRConst_CharsetRussian.

It look like the font charset attribute is not fully implemented. It works for symbol charset but not for Russian.

 

So the questions are:

- Is this expected behaviour?

- Why symbol charset behaves different then Russian for instance?

- What is your suggested method for printing Russian text in pdf reports?

 

Thank you.

S. Eren BALCI
IMESTEK
0 Kudos
Message 9 of 20
(4,513 Views)

Hi Ebalci,

 

I am trying to reproduce the issue right now, I will let you know if I have any questions. I don't think the behavior described in the first post is expected, but it sounds like at the end of your post you are describing an alternative route where you use ALT+0215 and such combinations to write russian characters. Does that work properly? I will try to figure out what the recommended way to do it is without changing the system language. 

Regards,
Basil
Applications Engineering
National Instruments
0 Kudos
Message 10 of 20
(4,484 Views)