我是Jasper Reports的新手.我在NetBeans中使用iReport 4.5.我需要创建一些文本并插入文本新变量.一切正常,但新线不会创建.请告诉我,如何解决?谢谢!
`<?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="jasper_report_template" pageWidth="595" pageHeight="842" columnWidth="515" leftMargin="40" rightMargin="40" topMargin="50" bottomMargin="50">
<property name="ireport.zoom" value="1.3310000000000004"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="ReportTitle" class="java.lang.String"/>
<parameter name="Author" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="country" class="java.lang.String">
<fieldDescription><![CDATA[country]]></fieldDescription>
</field>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[name]]></fieldDescription>
</field>
<title>
<band height="240" splitType="Stretch">
<textField isBlankWhenNull="true" bookmarkLevel="1">
<reportElement x="0" y="0" width="515" height="27"/>
<textElement textAlignment="Center">
<font size="10" pdfEncoding="Cp1251"/>
</textElement>
<textFieldExpression>
<![CDATA["Some text "+ $P{ReportTitle} +" my name +"<br/>"+ is "]]>
</textFieldExpression>
<anchorNameExpression><![CDATA["Title"]]></anchorNameExpression>
</textField>
</band> …Run Code Online (Sandbox Code Playgroud) 我有一个包含文本(乌克兰符号)的文件。例子:${name} - \xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd1\x96\xd1\x82。我需要替换从${name}到\xd0\xa1\xd0\xb0\xd1\x88\xd0\xb0。但在输出文件中,我收到类似这样的内容:\xc3\x90\xc2\xbf\xc3\x91??\xc3\x90\xc2\xb8\xc3\x90\xc2\xb2\xc3\x90\xc2\xb5\xc3\x91 - \xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd1\x96\xd1\x82而不是\xd0\xa1\xd0\xb0\xd1\x88\xd0\xb0- \xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd1\x96\xd1\x82. 但如果我使用 .txt 而不是 .rtf - 一切都很好。我理解编码中的问题,但无法解决它。
代码示例:
\n\nFile file = new File("original.rtf");\nString content = FileUtils.readFileToString(file);\n\ncontent = content.replace("${name}", "\xd0\xa1\xd0\xb0\xd1\x88\xd0\xb0");\n\nFile fileNew = new File("changed.rtf");\nFileOutputStream fop = new FileOutputStream(fileNew);\n\nbyte[] contentInBytes = content.getBytes("UTF-8");\nfop.write(contentInBytes);\nfop.flush();\nfop.close();\nRun Code Online (Sandbox Code Playgroud)\n 项目pom.xml中有一个liquibase-maven-plugin <3.6.2>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.6.2</version>
<configuration>
<changeLogFile>src/test/resources/liquibase/changelog.xml</changeLogFile>
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
文档说:
记录:
控制执行时 Liquibase 的日志记录级别。该值可以是“调试”、“信息”、“警告”、“严重”或“关闭”。该值不区分大小写。类型:java.lang.String 必需:无 表达式:${liquibase.logging} 默认值:INFO
我不明白如何应用它。