error when print jasper report

978 views
Skip to first unread message

Asep Hakim

unread,
Sep 15, 2014, 12:00:53 AM9/15/14
to idem...@googlegroups.com
Dear Alll,

I create jasper report and i run in dempiere and get error like this:
10:17:58.055-----------> Msg.getMsg: NOT found: ProcessError [16]
10:17:58.056===========> ProcessUtil.startJavaProcess: org.adempiere.report.jasper.ReportStarter [16]
java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at net.sf.jasperreports.view.JRViewer.initComponents(JRViewer.java:738)
    at net.sf.jasperreports.view.JRViewer.<init>(JRViewer.java:383)
    at net.sf.jasperreports.view.JRViewer.<init>(JRViewer.java:294)
    at net.sf.jasperreports.view.JRViewer.<init>(JRViewer.java:255)
    at net.sf.jasperreports.view.JRViewer.<init>(JRViewer.java:228)
    at org.compiere.report.JasperReportViewer.<init>(JasperReportViewer.java:48)
    at org.compiere.report.JasperViewer.<init>(JasperViewer.java:38)
    at org.compiere.report.SwingJRViewerProvider.openViewer(SwingJRViewerProvider.java:11)
    at org.adempiere.report.jasper.ReportStarter.startProcess0(ReportStarter.java:694)
    at org.adempiere.report.jasper.ReportStarter.startProcess(ReportStarter.java:343)
    at org.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:172)
    at org.compiere.apps.AbstractProcessCtl.startProcess(AbstractProcessCtl.java:466)
    at org.compiere.apps.AbstractProcessCtl.run(AbstractProcessCtl.java:272)
    at java.lang.Thread.run(Unknown Source)

please give me enlightment and thanks for your advice.



Regards



Asep Hakim

Yuni Fien

unread,
Sep 15, 2014, 12:22:48 PM9/15/14
to idem...@googlegroups.com

Hi Asep,

I will suggest you to try preview your jasper in iReport first. As long as I know NPE error usually happen because you use a wrong datatype in one of your field.

Thomas Bayen

unread,
Sep 15, 2014, 12:37:09 PM9/15/14
to idem...@googlegroups.com
Hi,

If I read your Exception stack careful I think that your report tries to
load an image but it can not. Perhaps your path does not work or such.
Try to use a absolute path or learn how to use the parameter variable
SUBREPORT_DIR.

The exact path value depends on how you deploy your report. I will give
you here some information from my memory (I hope it is right): Most
developers seems to prefer it as an attachment to the proess&report
record. There you need no path for an image, only the filename. If you
want your report in the filesystem you have to create directory
"reports" in your server directory (if you use the zk server, on swing
it is locally). You can find some informations at a page I wrote (sorry
- it is only german) at

http://wiki.idempiere.org/de/JasperReports

Regarding to

http://wiki.idempiere.org/en/Finding_resources_in_JasperReports

there is also a variable RESOURCE_DIR but I never used that myself.

regards,

Thomas Bayen
> --
> You received this message because you are subscribed to the Google
> Groups "iDempiere" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to idempiere+...@googlegroups.com
> <mailto:idempiere+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/idempiere/fc84e720-af60-4115-b092-c24bd6b0f123%40googlegroups.com
> <https://groups.google.com/d/msgid/idempiere/fc84e720-af60-4115-b092-c24bd6b0f123%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

mit freundlichen Grüßen,

Thomas Bayen
--
Jakob Bayen KG, Bleichpfad 20-22, 47799 Krefeld
AG Krefeld HRA 416 Tel +49/2151/65 80 9-0

Asep Hakim

unread,
Sep 15, 2014, 9:47:19 PM9/15/14
to idem...@googlegroups.com
Previously I apologize for not giving a detailed description of me using Swing idempiere client, I created a blank report and work is currently in previews.

The report works perfectly in idempiere server.

Thanks in advance.

Regards

Asep Hakim

Victor Suárez

unread,
Sep 16, 2014, 10:48:03 AM9/16/14
to idem...@googlegroups.com
Hi Asep, the problem is your image.  In iReport, the properties of the image should be: "Expression Class: java.io.InputStream", "Image Expresion: new java.io.ByteArrayInputStream ($F{image})", in the query you have select "binarydata", "Field Class: java.lang.Object".

You have test in iDempiere.

Regards.
Reply all
Reply to author
Forward
0 new messages