Image . png in Jasper report

Asked

Viewed 465 times

0

I’m starting in PHP and to finish my first system I have to make a report, it has some logos and watermarks, I’m using Jasperdesigner to generate XML for the lib Phpjasperxml, but when I have the logos and watermark generated the report only appears when it is .jpeg. The problem of being . jpeg that when it is printed the background does not become transparent as in a . png, did someone have this problem and managed to solve? Suggestions for other tools...

1 answer

1

I went through the same problem, so I solved it this way:

<image hAlign="Right" vAlign="Middle">
    <reportElement style="StyleSeta" x="1236" y="1" width="10" height="16" uuid="5c3ba9a6-9116-47af-b4c8-231df22634e7">
        <property name="com.jaspersoft.studio.unit.x" value="pixel"/>
    </reportElement>
    <imageExpression><![CDATA[$V{caminhoImagem} + "SetaCrescimentoOperacional.png"]]></imageExpression>
</image>

I got added the image element in my report, and in your image Expression I pass the image path within my project, in my case the variable is:

$V{caminhoImagem} = "http://localhost:8080/RelatoriosWEB/

And concateno with the name of the image "SetaCrescimentoOperacional.png"

Then the PNG image on the way: "http://localhost:8080/RelatoriosWEB/"SetaCrescimentoOperacional.png" will be added to your report.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.