When I export the Jasperreport report in Struts2 in PDF today, I get a strange problem: getting some values in action and putting them in a map, but when you take a value from $f{name}, some values can be displayed, some values cannot be displayed, and some values can only show parts. At first I thought it was the action stored in the map of the key and Jsper is inconsistent, check the half-day found that there is no problem. This problem I was depressed for a while, never found the problem, because do not know where the problem, in Baidu search for a half-day also did not find a solution, accidentally saw a piece of article solved my problem, the following collation of the solution to this problem, As a matter of fact, it is OK to modify the 1 attribute values in the ireport design tool's properties panel. I can't believe this problem has bothered me for a long time.
In ireport Design view, select the expression , and then in the Properties panel, drag the scrollbar to the end to find the "PDF Encoding" property, select or enter Unigb-ucs2-h (Chinese Simplified). Such as:
Note: It is best to set the properties in the 2 red box. The XML object is similar to the following:
<textelement><font size= "pdffontname=" Stsong-light "pdfencoding=" Unigb-ucs2-h "/></textElement" >
After the above modification, and then compile, and then export the problem should be resolved ....
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Struts2 and Jasperreport integrated application to solve the problem of non-display in PDF (let me worry about half a day)