Jump to content
JasperReports Library 7.0 is now available ×

JaperPrint:ClassCastException like this:


2005 IR Help

Recommended Posts

By: flying - ibmj2ee

JaperPrint:ClassCastException like this:

2004-08-12 23:42

user like this:

JasperPrint jp = (JasperPrint)JRLoader.loadObject(fileName);

throw ClassCastException.

 

but use like this:

JasperReport jr = (JasperReport)JRLoader.loadObject(fileName);

 

it work well;

 

filename="test.jasper";

 

can you give me an explain?or it's bug?

thanks

 

 

 

 

 

By: Richard Barnett - richard_barnett

RE: JaperPrint:ClassCastException like this:

2004-08-13 08:18

JRLoader.loadObject is reading the contents of test.jasper & instantiating a Java object from it. The object is an instance of JasperReport but not an instance of JasperPrint -- hence the ClassCastException.

 

I haven't used JasperPrint objects or their serialised form, but they look like they contain the actual data to be printed in a page-centric XML description -- presumably an intermediate form before PDF generation.

Link to comment
Share on other sites

  • Replies 0
  • 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...