iD 7.1 Print image on Jasper Report

258 views
Skip to first unread message

Leszek Bober

unread,
Sep 18, 2020, 9:17:27 AM9/18/20
to iDempiere
Hi All,

How can I  print on Jasper Report a Company logo?
In DB table is this enrty at binarydata column
<?xml version="1.0" encoding="UTF-8"?><image><entry file="%IMAGE_FOLDER%AD_Image/1000008/1000028"/></image>

My iD have Storage provider for Images as /opt/DMS/Images
Field in Jasper reports has java.awt.Image Class Type.


Regards
Leszek Bober

Carlos Antonio Ruiz Gomez

unread,
Sep 18, 2020, 1:18:33 PM9/18/20
to idem...@googlegroups.com
Hi Leszek,

I used something like this some time ago (not sure if it still works):

<imageExpression><![CDATA[org.compiere.model.MImage.get(org.compiere.util.Env.getCtx(), $F{logo_id}.intValue()).getImage()]]></imageExpression>

Regards,

Carlos Ruiz


El 18/09/20 a las 3:17 p. m., Leszek Bober escribió:

Gaurav dilip sontakke

unread,
Sep 18, 2020, 2:10:43 PM9/18/20
to iDempiere
Hi Leszek , 

Here is the example of printing the organization logo field. 

Usually , I create a report with company header with logo and include this in all the reports as a subreport with the parameter  with Default value expression as System.getProperty("java.io.tmpdir") + System.getProperty("file.separator").

I hope this will help.

Regards
Gaurav
CompanyHeader.jrxml

Leszek Bober

unread,
Sep 18, 2020, 2:11:10 PM9/18/20
to iDempiere
Hi Carlos
Tommorow I try it and write feedback

Andres Lopez Andrade

unread,
Sep 20, 2020, 12:39:32 PM9/20/20
to iDempiere
On my Jasper reports I join with AD_OrgInfo and AD_Image tables like this:

SELECT i.DocumentNo, i.Dateinvoiced, i.GrandTotal, img.Binarydata
FROM C_Invoice i
  JOIN AD_OrgInfo oi
    ON oi.AD_Org_ID = i.AD_Org_ID
  JOIN AD_Image img
    ON img.AD_Image_ID = oi.Logo_ID
WHERE i.C_Invoice_ID = $P{RECORD_ID}

The logo field type on jasper should be java.io.InputStream

Attached an example file
zTest.jrxml
Reply all
Reply to author
Forward
0 new messages