Jump to content

.java file differences


JRossi

Recommended Posts

I am not sure if this is really an iReport question, or a JasperReports Question.

 

I have a simple report which I created in iReport 1.3.3. It compiles, and runs without a problem in iReport.

 

I am trying to compile and run the report from a ColdFusion app by calling JasperCompileManager.compileReport and passing it the path to my jrxml file.

 

However under ColdFusion I am getting the following compile error

 

"inconvertible types found : int required: java.lang.Integer value = (java.lang.Integer)(1);"

 

The thing I noticed is that the java file created by iReport, and the java file created by my code differ slightly and this is what is causing the compile rror in ColdFusion.

 

 

iReport creates the following function for evaluate and similar code for evaluateOld, and evaluateEstimated

 

Code:

public Object evaluate(int id) throws Throwable
{
Object value = null;

switch (id)
{
case 0 :
{
value = (java.lang.Integer)(new Integer(1));/*$JR_EXPR_ID=0$*/
break;
}
....
default :
{
}
}

return value;
}

 

and compiling it with JasperCompileManager.compileReport in code produces the following version of evaluate, with evaluateOld, and evaluateEstimated being similar.

 

Code:
[code]
public Object evaluate(int id) throws Throwable
{
Object value = null;

switch (id)
{
case 0 :
{
value = (java.lang.Integer)(1);
break;
}
....
default :
{
}
}

return value;
}

 

Is there a way to make JasperCompileManager.compileReport generate the same code as when it is compiled in iReport? I looked through all the docs, and tried searching through the forums, but don't see anything that should cause this difference.

 

 

John

Post edited by: JRossi, at: 2007/05/18 03:23

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...