Jump to content

Upgrading JasperPrints objects


2004 IR Help

Recommended Posts

By: Ingo - ingoboegemann

Upgrading JasperPrints objects

2004-10-19 05:22

Our application is storing generated Reports as serialised JasperPrint objects inside the database. This gives me a problem upgrading the JasperReports version used: We are currently using 0.53 in production and I would like to upgrade to 0.61

Has anyone written such a tool or does know how to get around this?

 

 

 

 

By: zephyr - zephyr_zhao

RE: Upgrading JasperPrints objects

2004-10-25 07:14

you have to store the .jrxml instead of compiled classes becuase different version of JasperReport using different ID to compile/load the jasper class

 

 

 

 

By: alanHardwick - alan314

RE: Upgrading JasperPrints objects

2005-08-16 04:35

Hi All,

Does anyone have a solution to this as have the same problem.

i.e.

I have 20,000 invoices serialized as jPrint objects in a database (generated with 0.6.1) and I want to upgrade to

Jasper 1.0.0.

I can-not re-generate them as I cant guarantee it will

keep the original format so I somehow need to load

the jPrint object from the db and change it to 1.0.0 format.

Anyone know if this is possible? I can imagine it will

get messy if I try to mix 0.6.1 and 1.0.0 .jars in my classpath...

 

 

 

 

By: C-Box - c-box

RE: Upgrading JasperPrints objects

2005-08-16 04:52

I would write a helper-app that loads the jrPrint-Object with 0.6.1 jar and saves it as JRPXML (with embedded Images).

 

then change in your helper-app the jasperVersion to 1.0 and load the saved JRPXMLs and converts them back to JasperPrint-Object that you could store back to db again..

 

What we do (as we also store old printouts for later reprint and evidence) is just to store the JRPXML instead of the jrPrint-Objects... so we didn't encounter any problems when changing the versions... okay, I still have 0.6.8 in production but till this one it wasn't any problem to upgrade, so I hope the best when I will upgrade to 1.0

 

hth

C-Box

 

 

 

 

By: alanHardwick - alan314

RE: Upgrading JasperPrints objects

2005-08-16 05:22

Yep great! Thanks C-Box.

Wasnt aware you could save jPrints as .jrpxml, just

tried it and it worked brilliantly, even saves the images

as you suggested,, wow!!

 

 

 

 

By: C-Box - c-box

RE: Upgrading JasperPrints objects

2005-08-16 05:28

:-) fine that it is working!

 

have a nice week yet!

C-Box

 

 

 

 

By: alanHardwick - alan314

RE: Upgrading JasperPrints objects

2005-08-18 04:32

Yep!! Nearly working (i.e. the first bit to produce the .jrpxml files works great!!)..

 

Unfortunately I cant work out how to convert my .jrpxml

files back to jrPrint objects (I know this is probably trivial, sorry!)...

I assume its:-

JasperPrint jPrint = JasperManager.loadPrint("c:\test\test.jrpxml");

 

or something like that but this doesnt work. Have tried various other techniques but no joy so far..

 

Any ideas anyone?

 

I also assume that the name in the <jasperPrint tag has to be the same as the fileName so if anyone knows a simple way to change this then would be helpfull too.

 

Thnx

 

 

 

 

By: Lucian Chirita - lucianc

RE: Upgrading JasperPrints objects

2005-08-18 05:21

Hi

 

Use net.sf.jasperreports.engine.xml.JRPrintXmlLoader.load(..) methods.

 

HTH,

Lucian

 

 

 

 

By: alanHardwick - alan314

RE: Upgrading JasperPrints objects

2005-08-18 05:38

Thanks a lot Lucian,

Its easy when you know how... :)

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