LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Charset in html reports

Solved!
Go to solution

Hi all,

 

I'm trying to build a VI that creates reports in html, by using report generation toolkit (LV2011). But text in my reports contains some non-English characters. Normally, I should set charset to ISO-8859-9 by a meta tag in the head section of html code (like <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" />). But since I cannot add html code directly to the head section (or can I?), I tried to use Set Report Font VI. There is a cluster-parameter called font settings, and it has an I16 element named charset. Help file says "charset is the character set to use for report text. The default is -1." but I cannot change charset, since I don't know what are charset codes for the languages.

 

How can I set charset in html reports, if it's possible?

 

Thanks!

0 Kudos
Message 1 of 2
(2,792 Views)
Solution
Accepted by topic author MetalPenguen

I found a solution and wanted to post it in here too. I tried reporting VIs, adding some html code, css code, javascript code and dom manipulation. I ended up with a simpler solution, although it's not "exactly the way". I'm adding charset meta tag as a direct html code, right after creating html report:

 

charset.png

 

Note: Set header and footer VIs should be used with their 'header placement' parameters set to 'Append to Body', in order not to be written before charset meta.

 

Some css code may also be added along with charset meta, if user wants to use css codes instead of Set Report Font VI, like:

 

<style type="text/css">
body{
background-color: #d0e4fe;
font-family: "Verdana";
font-size: 20px;
}
h4{
color: orange;
}
</style>

 

As an html rule, charset meta should be in head section, but since it's not possible to insert code in head section with reporting VIs, I'm inserting it to top of the body section. Nevertheless, it's working in Firefox and IE.

 

Regards...

0 Kudos
Message 2 of 2
(2,777 Views)