ConcourseSuite Support

Support
Corporate
PUBLIC PROFILE

Back to topics

Discuss Reports and Report Writing

How to compile subreports programmatically?

You need to be logged in to post messages

How to compile subreports programmatically?

9/29/2006 5:14 PM EDT

Hi all,

I created a report which uses subreports. I compiled my subreport in iReport. But I got this class serialVersionUID not match exception. I think iReport is using a newer version of JasperReport then Centric has.

Since centric can programmatically compile reports.xml to reports.jasper. I want to compile my subreports in centric environment too.

Can anybody show me where is the api that programmtically compiles jasper reports?

Thank you.

1. 9/29/2006 5:24 PM EDT

If it is a new report that you want to integrate with Centric CRM, then make sure both the master report and its subreports are in the src/jasper_reports directory in the Centric source that you have downloaded.

When you deploy, Centric will automatically compile the new report and its subreports and deploys the compiled versions into the appropriate Centric webapp. This way you can avoid all version conflicts.

- Ananth

2. 9/29/2006 5:34 PM EDT

Thank you for the quick reply. I will try it now.

Actually I am reading the JasperReportUtils class. It is pretty simple and straitforward to delete .jasper file if the .xml file has a timestamp later then the .jasper file. By doing this, people will be less confused when they change the xml file and still get the old report design. Just a suggestion because I saw a user was confused in the other thread.

3. 9/29/2006 5:41 PM EDT

Hi, Ananth

I delete all jasper files related to my report, restarted my jboss 4.0.4GA server and run the report. It only recompiled the main one. Neither of the two subreports are recompiled.

Is there a flag to tell centric to recompile subreports?

Thanks.

Alex

4. 9/29/2006 5:42 PM EDT

BTW, I named my subreports *_subreport.xml, which seems to be the naming pattern in centric.

5. 10/2/2006 11:17 AM EDT
Default user photo

By Matt Rajkowski

Concursive Corporation
Product Design

airplane-icon-100x100.png

The iReport master and subreports must be compiled with the same library that Centric CRM uses (1.02). I think that iReport has a setting for the compiler version. In the past I have replaced the JR library in iReport with the correct version.

If you have the Centric CRM source code, the build process compiles master and subreports before creating the .war.

If you have the Centric CRM .war only, then only the master report is compiled through the web app, from what I can see (at this time).

6. 10/2/2006 1:20 PM EDT

You are right.

I tried another way to cheat the system: In my master report's subreport expression field, I call org.aspcfs.utils.JasperReportUtils.getReport($P + "subreport.xml") and set the type to JasperReport. But there is another catch: when the report runner runs, it calls the JasperReportUtils modifyFontProperties() method, which cannot correctly identify a subreport is actually not compiled yet. In my opinion, this method should be fixed to identify the correct object type.

I guess there is no way around it without rebuilt the war or change the code. so I just gave up and compiled my subreports manually into jasper file.

6 results found