Jump to content
We've recently updated our Privacy Statement, available here ×

Casting Error when passing a list


dayana

Recommended Posts

 

hi,

i am getting the following error when i am tring to pass a list as a parameter


Exception in thread "main"


java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.math.BigDecimal

 

java  :-  

  ArrayList lst=new ArrayList();
  lst.add(sum1);
  lst.add(sum2);
  lst.add(sum3);
  lst.add(sum4);
  parameters.put( "li", lst );

jrxml :-

<parameter name="li" isForPrompting="false" class="java.util.List"/>

 

 



Post Edited by dayana at 07/10/2009 05:36
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

You did not post the entire stack trace, so we cannot tell from where it is actually raised. You must be doing something with that parameter in the report, and that would be the cause. You use it in some other expressions.

Post the entire JRXML.

 

Thanks,

Teodor

 

Link to comment
Share on other sites

hi,

i have attached my jrxml, my actual problem is that i want to draw a chart from a complex dataset,

which will be passed as a parameter from java. please help me to pass the dataset from javacode to jasper file :(



Post Edited by dayana at 07/13/2009 10:20
Link to comment
Share on other sites

I thought your problem was with a cast exception when you pass a list parameter.

Now you tell me you have a different problem? Why don't you create a new thread for that????

And this JRXML you posted... what should I do with it? Where is this "li" parameter of type java.util.List that you said you have??

If you mess up the forum postings like this... no wonder the reports are not working...

 

Thanks,

Teodor

 



Post Edited by teodord at 07/13/2009 11:18
Link to comment
Share on other sites

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...