Question
· Jun 25, 2018

ZEN reports - non latin PDF output

How do I get non latin text in PDF mode for ZEN reports?

Currently cyrillic  test is rendered as ####:

Class Test.Zen Extends %ZEN.Report.reportPage
{

Parameter DEFAULTMODE = "pdf";

/// ReportDefinition is a placeholder.
XData ReportDefinition [ XMLNamespace = "http://www.intersystems.com/zen/report/definition" ]
{
<report xmlns="http://www.intersystems.com/zen/report/definition"
    name="MyReport" runonce="true">
  </report>
}

XData ReportDisplay [ XMLNamespace = "http://www.intersystems.com/zen/report/display" ]
{
<report xmlns="http://www.intersystems.com/zen/report/display"
name="MyReport">
<body>
<table ongetData="GetCount">
<table orient="row" ongetData="NamesAndAddresses" style="border:1pt solid black" width="auto" >
<parameter fieldnum="1"/>
<item fieldnum="1" >
<caption value="ДЖШЩ ЪЭЮ"/>
</item>
<item fieldnum="2" >
<caption value="Title" />
</item>
<item fieldnum="3" >
<caption value="Pages" />
</item>
</table>
<parameter value="test" />
</table>
</body>
</report>
}

ClassMethod GetCount(ByRef var As %String, ByRef params)
{
    set count=3
    for i=0:1:count-1 {
        set var(i, 0) = i
    }
}

Method NamesAndAddresses(ByRef var As %String, ByRef params)
{
    if (params(1) = 0) {
       Set var(0,0) = "Alice"
       Set var(0,1) = "Hello"
       Set var(0,2) = 123
    } elseif (params(1) = 1) {
       Set var(0,0) = "Bob"
       Set var(0,1) = "World"
       Set var(0,2) = 456
    } elseif (params(1) = 2) {
       Set var(0,0) = "Charlie"
       Set var(0,1) = "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
       Set var(0,2) = 789
    }
}

}

Is rendered as:

Discussion (2)1
Log in or sign up to continue

IIRC "#" means that the character doesn't exist in the chosen font. The default font may not be very complete. You might want to explicitly set the font you're using to one you know contains Cyrillic characters.

Also, in your Zen Report class you can set the encoding as a parameter. This may not be necessary since it should default to UTF-8:
Parameter ENCODING="ISO-8859-1";