我正在使用Jasper Reports (5.0.0)生成PDF和Word文档。
在其中一个文档中,我必须显示来自URL的图像。图像是在生成报告之前动态生成的,但我不能控制它(因此我不能在源位置旋转它)。
可以让Jasper在生成文档时旋转图像吗?
以下是该图像的模板代码:
<band height="706">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<image rotation="Left" scaleImage="RetainShape" hAlign="Center" vAlign="Middle" isUsingCache="false" isLazy="true" evaluationTime="Report">
<reportElement key="" stretchType="RelativeToBandHeight" x="12" y="0" width="530" height="704" uuid="fc32abee-32e1-4b07-94f0-177eae9edcad">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<imageExpression><![CDATA[new java.net.URL($P{MAP_URL})]]></imageExpression>
</image>
</band>如您所见,图像URL作为参数传递给报表,并由Jasper通过java URL进行访问。(如果没有简单的解决方案,我计划编写一个servlet来获取图像,并将其旋转输出,但我宁愿避免这种情况)。
发布于 2016-05-26 22:49:56
不,我很确定你不能..当谈到Jasper Studio时,整个图形环境都是令人心碎的。最好的办法是在你把图片放入JasperStudio之前改变它的大小,因为你只能在图片放进去后重新调整它的大小。
https://stackoverflow.com/questions/25176497
复制相似问题