LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NI report with Cyrillic text

It always works if the locale is Russian.

I suggested the ALT key combinations as a method (alternative to changing keyboard language to Russian) to type cyrillic characters.

 

Since the locale is changed to Russian, you can view them correctly both in editor and pdf.

But it does not sound practical to change system locale (which requires system restart) just to change the way character codes are interpreted.

I thought charsets are there especially for that purpose and it works as expected for the Symbol charset.

S. Eren BALCI
IMESTEK
0 Kudos
Message 11 of 20
(1,650 Views)

Yes but when you use the ALT key combinations you don't need to change the system locale, correct?

Regards,
Basil
Applications Engineering
National Instruments
0 Kudos
Message 12 of 20
(1,640 Views)

No, ALT combination is alternative for changing keyboard input language.

Keyboad input language is a simple change and does not require system restart.

 

If the keyboard language is not Russian, it keeps sending original English keycodes when you type.

When you change keyboard to Russian and press 'q' for instance, it does not send the ASCII character value of 'q' anymore, it sends a Russian character's key code.

 

Changing the locale (that's a global setting which requires system restart) changes how the computer interprets the incoming key codes.

When the locale is Russian and you type a Russian character (either by having switching to Russian keyboard or by ALT key combination) you can see the Russian character correctly.

 

 

Our problem was about printing the NI Report by the way as explained in previous posts.

S. Eren BALCI
IMESTEK
0 Kudos
Message 13 of 20
(1,611 Views)

Hi,

 

Can you show us what output you get when you don't change the locale, just change the attribute to the russian character set and change the keyboard input to russian?

 

 

Regards,
Basil
Applications Engineering
National Instruments
0 Kudos
Message 14 of 20
(1,595 Views)

I'm not in a position to test NI-Reports right now, but the behavior should be the same as it is for any control in the CVI user interface, so the examples I'm giving below are for UI controls.

 

If you type "qwerty" into a CVI text message and then change the character set of the control to Symbol, you'll notice that the text changes immediately. However, if you change it to Russian instead, you'll notice that there is no change in the displayed text. This is because there is an important difference between the Symbol character set and most of the other character sets, including Russian. Most character sets are different only for ASCII codes greater than 127. The Symbol character set, however, is different for all codes from 0 to 255, from what I can tell.

 

When you set the value of the control to "qwerty" you're still using regular ASCII codes (i.e. codes <= 127). Those codes are displayed the same way with the Russian and Western character sets. To actually display Russian characters, you must use different codes in your string -- codes greater than 127. If you use the Russian language input, as shown below, the keyboard driver converts to those codes for for you.

 

 

Russian.png

 

 

When that happens, then the Russian character set will show those characters properly (whereas a different character set would not). But you need to get the right codes in there somehow.

 

Below is a screenshot with the exact ASCII codes of two different strings, inside a table control in CVI. In both cases, the character set of the string cells is set to Russian, but in the first case it's simply displaying "qwerty" because that's what the codes correspond to. The second string, as you can see, has different ASCII codes.

 

I entered the second string directly in the control by typing "qwerty" in my English keyboard while my input was set to Russian:

 

Russian2.png

 

Luis

0 Kudos
Message 15 of 20
(1,575 Views)

Hi,

 

I have added a sample code and images to explain the situation.  When you examine the image of sample.png,  you can see the system language is English and the keyboard language is Turkish. Despite this,  I can see both the Turkish and Russian characters in the Panel but I can not see in PDF. For panels, I selected the language in text style which I want to see in the text box and Label. You can see language_select_panel.png.  In addition, I can't change the language of the panel title. But LabWindows's Help saysit can be if you change the panel's title bar style in windows. I want to learn this, is it similar to the panel settings for the PDF? Or is the only way to change the local language? If that's the way to do it without shutting down the computer if it is the only way? Because I am developing an application with multiple language option and I do not want to pc restarts.

Download All
0 Kudos
Message 16 of 20
(1,532 Views)

The problem with the panel title is expected, since it's still using the English character set. You could change the title bar to Classic in the UI Editor, which would then allow you to change the title's character set to Russian. However, that would only help if you loaded this panel as a child panel. When you load it as a top-level panel instead, then the font is controlled by Windows, and I believe that you're right: you would have to change the system locale to Russian, which I believe does require a reboot. I'm not aware of any alternative.

 

Concerning the NI-Reports, I can't verify it, but it does look like a bug in NI-Reports. Does the same problem happen when you print it directly to a printer, as opposed to viewing it in Adobe?

 

Luis

0 Kudos
Message 17 of 20
(1,520 Views)

We tried print it directly but it is the same as Adobe. As far as I understand it is not possible to make this work with pdf. Ok, we closer to the subject from a different viewpoint. Is it possible to do  with word?

0 Kudos
Message 18 of 20
(1,495 Views)

Just a suggestion: based on what I understood from this discussion, you can correctly show russian texts on CVI panels but you are not able to have them printed correctly with NIReport.

I suppose if you print a panel with PrintPanel russian characters will show correctly on paper. If so, you could generate reports by populating controls on a hidden panel customized for printing: white panel background, transparent control background / frame, appropiate "page" proportions and so on. Having a PDF from that can be difficult unless you use some PDF virtual printer (consider, though, that each page will be printed individually so unless you can setup the virtual printer to sum all pages on a single report, you will have several PDF files. In this case, what I have sow in my experience is that the PDF name is the same as the panel name).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 19 of 20
(1,492 Views)

Concerning Word, you could certainly use the Word Report instrument driver (wordreport.fp) to create a Word-based document and print it. I've never tried to use different character sets using this driver, but there's a reasonable chance that it would work.

 

You can take a look at samples\activex\word\wordrpt.cws for an example of using wordreport.fp to print a document.

 

Luis

0 Kudos
Message 20 of 20
(1,479 Views)