Compiere - Jasper: Subreports

For those who ventured too far - just hope they know their way back :)

Moderator: neilg

Compiere - Jasper: Subreports

Postby afalcone » Thu Aug 24, 2006 3:18 am

Hi,

I just integrated Jasper Report with Compiere.

I have a report (DiarioAsientos.jrxml) and a subreport (AsientosDetalle.jrxml).

When I run the process, only the master report compiles.
I see in the jboss' console an error:

15:53:53,343 INFO [STDOUT] net.sf.jasperreports.engine.JRException: Could not load object from location : .\AsientosDetalle.jasper
15:53:53,343 INFO [STDOUT] at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:262)
15:53:53,343 INFO [STDOUT] at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:294)
.......

In the Compiere2\reports dir only was created the DiarioAsientos.jasper and in this dir there are both jrxml (DiarioAsientos and DetalleAsientos).

I'm using the pshen's files: report.jar and reporttools.jar and I used the iReport 1.2.5 to create the jrxml's files.

Any help and suggestion is appreciated..Thank's

Best regards

Alejandro
afalcone
Regular
 
Posts: 120
Joined: Fri Jun 24, 2005 4:09 am
Location: Argentina

Postby trifon » Thu Aug 24, 2006 6:54 am

Hi Alejandro,

for sub-reports i had the same problem. i managed to fix it by publishing compiled sub-report into proper folder(it could be /reports or folder in JBoss server; i preffer JBOSS server as this gives me one central place to keep all reports).

Kind Regards,
Trifon
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia

Postby afalcone » Thu Aug 24, 2006 7:42 pm

Hi Trifon !!

I don't understand that means you with: i managed to fix it by publishing compiled sub-report into proper folder. :oops:

I have copied the AsientosDetalle.jasper (the subreport's compiled) into the report's folder, but the error is the same. The report's folder is under the Compiere2 folder.

Thank's for help me.

Kind regards,

Alejandro
afalcone
Regular
 
Posts: 120
Joined: Fri Jun 24, 2005 4:09 am
Location: Argentina

Postby trifon » Thu Aug 24, 2006 8:22 pm

Hi ALejandro,

>I have copied the AsientosDetalle.jasper (the subreport's compiled) into the report's folder, but the error is the same.

Yes. this is what i mean.
Probably path which you set in master report is not what JasperReports expect. I have seen this in one JasperReports example

if you get version 1.2.4(i believe that this example exists in other versions too) directory jasperreports\1.2.4\demo\samples\subreport contains example sub-report.

Please try it and tell me if example gives you enought information to fix your problem.

Kind regards,
Trifon
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia

Postby afalcone » Fri Aug 25, 2006 7:55 pm

Hi Trifon,

Yes, the problem was the path that I had set in the master report. Now I have set the path, but I have the new message error in JBoss' console:

2006-08-25 08:36:42,046 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 1m:37s:500ms
2006-08-25 08:38:30,156 DEBUG [org.jboss.ejb.StatelessSessionContainer] Useless invocation of remove() for stateless session bean
2006-08-25 08:39:05,406 INFO [STDOUT] java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; local class incompatible: stream classdesc serialVersionUID = 10200, local class serialVersionUID = 608
2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
....... and more...

I was looking in google and I believe that this is by the iReport's version that I'm using to compile the subreport.
Do you think that would be the problem?

I'm using the 1.2.5 and I tried with the 1.2.4 version's iReports too. What version do you use?

Thanks

Alejandro
afalcone
Regular
 
Posts: 120
Joined: Fri Jun 24, 2005 4:09 am
Location: Argentina

Postby trifon » Sat Aug 26, 2006 8:07 am

Hi Alejandro,

you need to use the same JasperReport when you compile report and on compiere when you start report.

I use old version of jasper reports.

Regards,
Trifon
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia

Postby afalcone » Tue Aug 29, 2006 9:35 pm

Hi Trifon,

I'm using the jasperreports-0.6.8 now and I'm not receiving the message error above.
But, now I have the new error :cry:

When I start the report's process then I see the message in the jboss console:


2006-08-29 08:03:19,187 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 1m:34s:922ms
2006-08-29 08:08:50,781 DEBUG [org.jboss.ejb.StatelessSessionContainer] Useless invocation of remove() for stateless session bean
2006-08-29 08:19:40,125 WARN [net.sf.jasperreports.engine.fill.JRBaseFiller] The supplied java.sql.Connection object is null.
2006-08-29 08:19:40,156 WARN [net.sf.jasperreports.engine.fill.JRBaseFiller] The supplied java.sql.Connection object is null.

and the subreport don't display result.

I have defined in the subreport's properties the Connection/Datasource expression as:

Use connection expression
$P{REPORT_CONNECTION}

I test the report and subreport into the iReport and is working fine.

Any idea?

Thanks and kind regards

Alejandro
afalcone
Regular
 
Posts: 120
Joined: Fri Jun 24, 2005 4:09 am
Location: Argentina

Postby afalcone » Tue Aug 29, 2006 9:39 pm

I forgot to tell you that the report display data ok, but not the subreport.

Alejandro
afalcone
Regular
 
Posts: 120
Joined: Fri Jun 24, 2005 4:09 am
Location: Argentina

Postby afalcone » Thu Aug 31, 2006 8:06 pm

I believe that the connection must be established in the jar, but I don't understand why the report work fine (can connect) but not the subreport.
The connection isn't the same one?
Someone had this problem also?

Thank's

Alejandro
afalcone
Regular
 
Posts: 120
Joined: Fri Jun 24, 2005 4:09 am
Location: Argentina


Return to Strictly Technical

Who is online

Users browsing this forum: No registered users and 1 guest