Some Company Name Posted September 17 Share Posted September 17 I have been using Jaspersoft Studio 7 and created a text expression that should output a UTF-8 character based on a Boolean value. The default encoding will not print the value and there does not appear to be a UTF-8 encoding available in the drop down. My assumption is that it is outputting UTF-8 by default. Character 'B' or 'A' will print. I feel I am missing something simple. I saw in older versions people used WingDings, but that doesn't appear to be available in the Studio. In what direction should I proceed with this? <field name="serviceJasperModel.service" class="java.lang.Boolean"/> <element kind="textField" uuid="ee599154-57af-4dda-b99f-e86ad669d457" mode="Transparent" x="153" y="56" width="100" height="30" pdfEncoding=""> <expression><![CDATA[$F{serviceJasperModel.service} ? "\u2713 B":"\u2717 A"]]></expression> </element> 1 Link to comment Share on other sites More sharing options...
Some Company Name Posted September 17 Author Share Posted September 17 Some more info, the default file encoding for the running JVM has been verified to be UTF-8. 1 Link to comment Share on other sites More sharing options...
Some Company Name Posted September 17 Author Share Posted September 17 In the below code when I preview I can see the check mark. You can see this in the attached ss. <element kind="textField" uuid="c24d9bba-e36f-455e-b649-4d839eb375c5" x="310" y="50" width="100" height="30"> <expression><![CDATA["\u2611"]]></expression> </element> However, when I click run the report, the checkbox is no longer visible. Link to comment Share on other sites More sharing options...
Some Company Name Posted September 17 Author Share Posted September 17 No idea why the preview would display one way and when the report is run it would display another. Link to comment Share on other sites More sharing options...
Solution Some Company Name Posted September 23 Author Solution Share Posted September 23 So the solution for this comes down to a few things. I cannot find the original official link that discusses this support. In JR 7 you must use a font that supports unicode characters 2610 and 2611. DejaVu Sans was specifically created for this and you MUST use THOSE characters. In addition you MUST set the properties below into your report. <property name="net.sf.jasperreports.export.docx.embed.fonts" value="true"/> <property name="net.sf.jasperreports.export.pptx.embed.fonts" value="true"/> <element kind="textField" uuid="19b99216-3094-4d7b-aa86-e3a7cc9dab84" x="0" y="-10" width="30" height="30" fontName="DejaVu Sans" fontSize="22.0"> <expression><![CDATA[$F{serviceJasperModel.service} ? "\u2611":"\u2610"]]></expression> </element> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now