Image.png in Jasper report [duplicate]

this question already has answers here : inserting image with JasperReport via parameters (3 responses) Closed for 3 years.

I'm starting in PHP and to finish my first system I have to make a report, the same has some logos and watermarks, I'm using JasperDesigner to generate the XML for lib PHPJasperXML, more when I send generate the report the logos and watermark only appears when the same is .jpeg. The problem of being .jpeg that when printed the background is not transparent as in one .png, someone had this problem and managed solve? Suggestions from other tools...

Author: Julio Cesar da Silva Barros, 2016-07-01

1 answers

I went through the same problem, so I solved it as follows:

<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 have added the element image in my report, and in its 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 the image name "SetaCrescimentoOperacional.png"

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

 1
Author: sergioBertolazzo, 2017-05-22 18:41:27