Jump to content

Text wrap around objects?


edeards

Recommended Posts

Hi all,

Firstly - I'm new to Jasper, iText, iReport and PDF innards in general. However, I'm implementing a pretty complex document creation system and have numerous challenges ahead of me. Secondly - I've stupidly posted this question on the iReport forums first - now I realise it's completely the incorrect place for it. Now, the question..

One thing I need to be able to do is have text "flow" around objects. Nothing tricky - square objects only. For example, the crummy ascii art below depicts text in a text box ( the ~), going around the subreport (depicted by the |||).

~~~~~~~~~|||||||||||||||||||||||||

~~~~~~~~~|||||||||||||||||||||||||

~~~~~~~~~~~~~~~~~~~~

I don't believe that JasperReports has this capability out of the box - am I correct in this belief? If I am correct - is anybody aware of anybody trying to implement this in the past? Alternatively, are there any suggested ways to tackle this problem? Is it likely to be difficult to implement an extension to the Jasper compiler to handle the idea of text flow?

The potential ways I see to do this would be:

  • One text box with a subreport (or whatever) on top of it, somehow the text flow is achieved by detecting the overlap and being clever.
  • Two text boxes, one on the left of the subreport, one below the subreport. Some custom attributes linking the two text boxes together, then somehow deal with the situation when the text hits the bottom of the first text box - rather than stretch the box, split the content string and put the second half into the second text box.

I've no idea the relative pain in implementing either of these. Any help/guidance/jeering appreciated.

Cheers,

Ed

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hmm perhaps I either haven't explained my problem clearly or I'm unaware of some way in which css integrates with JasperReports.

I'm constructing PDF fragments using JasperReports which I'm then merging together using iText. I had intended to merge together the PDF fragments using another JasperReport template, however I could see no way to have the image control handle PDF content.

I know someone is going to say "Why are you making pdf fragments?" - I'm actually constructing a Document, not a Report, the content of this document is not always of the same form or structure. Hence I need to build content fragments and nail it all together. It's working pretty well for the moment except for situations whereI need text wrapping around objects.

Is there some mechanism by which I can use CSS to lay out text despite my targetting PDF output? :-o

Link to comment
Share on other sites

  • 2 years later...

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