nyul100 Posted August 14, 2011 Share Posted August 14, 2011 Hi there,I try to preview report including one static text with rtf markup in iReport 4.1.1.In rtf document there is cyrillic and non cyrillic characters.The cyrillic part of rtf is: \'d0\'e5\'e7\'e5\'f0\'e2The non cyrillic part is: AbcdWhen I try to preview the report in IReport the cyrillic characters not displayed correctly.Previously I added the font "Times New Roman Cyr" in IReport.I attached the jrxml, "Times New Roman Cyr" font and the preview result as picture. Does anyone help me what do I wrong?Thanks Code:<?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="rtfTeszt" pageWidth="500" pageHeight="300" columnWidth="460" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <detail> <band height="260"> <staticText> <reportElement x="0" y="0" width="460" height="260"/> <textElement markup="rtf"> <font pdfEncoding="Cp1251"/> </textElement> <text><![CDATA[{\rtf1\ansi\ansicpg1251\deff0{\fonttbl{\f0 Times New Roman Cyr}}\f0\b\fs52\'d0\'e5\'e7\'e5\'f0\'e2 Abcd}]]></text> </staticText> </band> </detail></jasperReport> Link to comment Share on other sites More sharing options...
ursus Posted January 23, 2015 Share Posted January 23, 2015 +1.Does anyone help me?Thanks<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.0.1.final using JasperReports Library version 6.0.0 --><!-- 2015-01-23T19:57:16 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="3848614b-2aae-414e-82f1-686281bbf93c"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> <field name="note" class="java.lang.String"/> <columnHeader> <band height="80"> <staticText> <reportElement mode="Transparent" x="0" y="30" width="556" height="41" forecolor="#000000" backcolor="#FFFFFF" uuid="43902e22-7f01-41c9-90f8-6f738a47d118"/> <box padding="0" topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0"> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="rtf"> <font fontName="Microsoft Sans Serif" size="12" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1251" isPdfEmbedded="true"/> <paragraph lineSpacing="Single" lineSpacingSize="1.0" firstLineIndent="0" leftIndent="0" rightIndent="0" spacingBefore="0" spacingAfter="0" tabStopWidth="40"/> </textElement> <text><![CDATA[{rtf1ansiansicpg1251deff0deflang1049{fonttbl{f0fnilfcharset204{*fname Times New Roman;}Times New Roman CYR;}{f1fnil Times New Roman;}} viewkind4uc1pardf0fs28'c2'fb'ef'ee'eb'ed'e5'ed'ee f1 par } ]]></text> </staticText> </band> </columnHeader></jasperReport>[/code]Result:/sites/default/files/images/45.png 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