.png image in Jasper report [duplicate]

0

I'm starting in PHP and to finish my first system I have to do a report, it has some logos and watermarks, I'm using JasperDesigner to generate the XML for the PHPJasperXML lib, but when I generate the report the logos and the watermark only appears when it is .jpeg. The problem of being .jpeg that when the background is printed does not look as transparent as a .png, did anyone have this problem and managed to solve it? Tips from other tools ...

    
asked by anonymous 01.07.2016 / 15:22

1 answer

1

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

<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 get added the element image in my report, and in your image expression I pass the image path inside my project, in my case the variable is:

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

And concatenate with image name "SetaCrescimentoOperacional.png"

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

    
22.05.2017 / 20:41