Jump to content
Changes to the Jaspersoft community edition download ×

Using JRFillContext

2004 IR Help

Recommended Posts

By: BSE boy - bseboy

Using JRFillContext

2005-09-07 08:50

I would like to be able to use the new ignorePagination flag, so I can format PDF output into pages, but format HTML/XLS output by flow.


I assumed I needed to create a filler, and then set it's fillContext properties to do this, but I can't find a way to do it.


Has anyone got any ideas of how I might acheive this ?


Thanks in advance.





By: Teodor Danciu - teodord

RE: Using JRFillContext

2005-09-07 09:12




The recommended approach is to fill the report template

twice: once with pagination for PDF and then with

pagination ignored for HTML/XLS.


Trying to paginate a document that was generated without pagination would be too hard and does not worth the effort in my opinion.


A different approach would be to use export time

parameters for exporting to HTML and XLS and suppress

pagination like shown in the "nopagebreak" sample



I hope this helps.







By: BSE boy - bseboy

RE: Using JRFillContext

2005-09-07 09:35

Thanks for the reply Teodor.


I'm using JR for our corporate reporting at the moment. Some of the reports are page based (analysis and summary stuff) and some is 'list' based (exception reports, sales reports).


All my list reports currently run as paginated reports (I'm been using v0.66 in our live environment).


To do this I've written a reporting server that currently uses the JasperFillManager.fillReport(...) function, to fill each report.


Even with page headers/footers set to size 0 and no margins, I still get a gap at the bottom/top of each 'page' for my list reports.


I'd like to be able to fill some reports in a non-paginated way (based on a parameter against each report). I'm assuming this will prevent my 'gaps' appearing. If it wont (please tell me!) then I don't need to go any further with this query.


Anyway, this is the sort of code I had in mind ...


JasperReport theReport = (JasperReport)JRLoader.loadObject(reportStream);

JRBaseFiller filler = JRFiller.createFiller(theReport);


printRep = filler.fill(reportParams,conn);


But there's no way to set fillContext that I can see.


Is this approach possible/sensible ?







By: Lucian Chirita - lucianc

RE: Using JRFillContext

2005-09-07 23:45



You don't need to care about the fillContext object if you want to use the ignorePagination mode. To switch this mode on, just set the JRParameter.IS_IGNORE_PAGINATION parameter at fill time:


reportParams.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);




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