Tag: jasper报告

Jasper Reports的JVM不支持字体

我试图用DynamicJasper生成报告,但我得到以下错误: net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Arial' is not available to the JVM. msttcorefonts被安装,但我猜JVM没有使用任何字体。 我使用Ubuntu 10.04。 我怎样才能解决这个问题?

来自itext的jasper-reports中的依赖性错误

从昨天我有问题编译与maven因为itext jar。 我的项目依赖于jasperreports-2.0.1,依赖于itext-1.02b或更高版本。 <dependency> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId> <version>[1.02b,)</version> <scope>compile</scope> </dependency> 这是maven中的日志错误: Failed to collect dependencies for [jasperreports:jasperreports:jar:2.0.1 (compile)]: Failed to read artifact descriptor for com.lowagie:itext:jar:4.2.2: Could not transfer artifact com.itextpdf:itextpdf:pom:4.2.2 from/to jaspersoft (http://www.jasperforge.org/maven2): Access denied to http://www.jasperforge.org/maven2/com/itextpdf/itextpdf/4.2.2/itextpdf-4.2.2.pom. Error code 403, Forbidden -> [Help 1] 我在这里看到来自Amedee Van Gasse的一个评论,它提到了一个没有jar的4.2.2版本。 为什么1.02b版本附加到4.2.2? 编辑:贾斯珀报告使用一个开放的版本范围: [1.02b) 这个范围说要带图书馆最新版本。 随着iText的更新添加新版本Pom没有jar和编辑maven-central的Maven-metadata到无jar版本崩溃编译到所有jar取决于最新的com.lowagie库。 更新本地maven-metadata-central.xml(以及其他元数据,如果你的公司拥有自己的nexus.public)从… m2 \ repository […]

在JasperReport中将字节数组显示为图像

我有一个图像保存为一个byte[] ,我想在JasperReport中显示它的图像。 我试图从Java方法获取数据: public InputStream getImage(){ return new ByteArrayInputStream(getImageByteArray()); } 和 public Image getImage() throws IOException{ return ImageIO.read(new ByteArrayInputStream(getImageByteArray())); } 和 public String getImage(){ return new String((new org.apache.commons.codec.binary.Base64()).encode(getImageByteArray())); } 但他们似乎都没有工作。 jrxml看起来像这样: <image hAlign="Center" vAlign="Middle" isUsingCache="true" isLazy="true"> <reportElement positionType="Float" x="0" y="0" width="164" height="32" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="c63c84a8-41c7-4ca3-8451-751d43fa8a9e"/> <imageExpression><![CDATA[$P{paramObject}.getImage()]]></imageExpression> </image> 我尝试的一些东西得到exception,一些打印JasperReport,但图像应该是空白区域。 我知道图像数据在那里,因为我可以在JSF页面中显示它。 图像数据是SVG数据。