Struts2 and Jasperreport integrated application to solve the problem of non-display in PDF (let me worry about half a day)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.