Jump to content
Changes to the Jaspersoft community edition download ×

Loading .jasper-Reportfiles from Database


2005 IR Help

Recommended Posts

By: Tom Schindl - tomsontom

Loading .jasper-Reportfiles from Database

2004-09-10 05:59

Hi,

I'd like to store reports into a database and load them from there, for reports who don't have subreports that's no problem but when dealing with subreports I have no clue how to resolve this. Is this possible maybe by writing my own JRLoader or something like that?

 

Tom

 

 

 

 

By: C-Box - c-box

RE: Loading .jasper-Reportfiles from Database

2004-09-12 22:51

Just parse the MasterReport for SubReports (and then recursively the SubReport for nested SubReports again).... and load all found SubReports from your DataBase and pass them via parametermap to your MasterReport... that should work.

 

hth

C-Box

 

 

 

 

By: Tom Schindl - tomsontom

RE: Loading .jasper-Reportfiles from Database

2004-09-13 09:13

Hi,

 

thanks for the answer. I don't know Jasper-Reports very well maybe you could be a little bit more explicit.

 

Do you mean something like this?

-----------------------8<-----------------------

JRPdfExporter exporter = new JRPdfExporter();

exporter.setParameter(...);

-----------------------8<-----------------------

 

or can you point me to an example, tutorial?

 

Tom

 

 

 

 

By: C-Box - c-box

RE: Loading .jasper-Reportfiles from Database

2004-09-13 22:46

Uhhhh.....a sample is difficult, because I use very special dataobjects/container that transfer/hold my data and reports ... if I would post it here... you'd get more confused than it could help you.

 

you should take a look at the JasperReport Object and how it's build up.... it contains some fix bands and some bands you can create by your own (through groups). each band contains elements (textfields, static texts, lines, rectangles, and also SUBREPORTS)

So you can go through a JasperReportObject and parse all bands... and then each band for elements... and if you found an element of type JRBaseSubreport then you can load it from your database (by name, or SubReportExpression... that depends on your structure)

 

So I posted a similiar answer some days ago....

 

take a look here....

http://sourceforge.net/forum/message.php?msg_id=2747393

 

Perhaps it helps you going on.

 

hth

C-Box

 

 

 

 

By: Tom Schindl - tomsontom

RE: Loading .jasper-Reportfiles from Database

2004-09-14 00:22

thanks already got it, the subreports example shows how to use it.

thx for pointing me to the right direction

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