[#4647] - Add "rotate" to the attributes of a Sub-Report

Feature request
Project: Severity:
Component: Reproducibility:
Assigned to:

Rotation should be an attribute of a Sub-reports (and IMHO images, too), otherwise it is quite impossible to produce parts of a Report in another orientation.

peterf's picture
Joined: Sep 3 2006 - 8:00pm
Last seen: 16 hours 46 min ago




This sounds interesting as a feature.

But can you give more details about how you plan to use this?
How should a rotate subreport behave when it reaches the right side of the page?



Hello Teodor,

I described the usage in the additional information: The header information of a production order should be printed on the first few centimeters of a DIN A5 sheet in landscape orientation printed for each node in the production order. The node information shall be printed together with a matrix (to enter data manually during the work process) in portrait orientation (that is below the header in landscape orientation or right of the header in portrait orientation).
What else do you need to know?

For the behavior: The "simple" behavior would be to leave it to the (sub-)report developer to ensure, that the subreport shouldn't exceed the page/column limits of the report.

The sophisticated behavior would allow some options, e.g.:
1 no stretching or squeezing (works like the simple behavior)
2 stretch/squeeze to page/column width
3 stretch to page/column width (but no squeezing)
4 squeeze to page/column width (but no stretching)

(1-4 could be represented as two options "stretch" and "squeeze", which could be switched on or off, or even the choices "off", "keep proportions" or "only horizontal".)

- Spread over pages/columns: There could be a "spread over pages/columns" option offering "top to bottom", "bottom to top", "left to right", "right to left" (according to the subreport:
"top to bottom" means, that the top part (might be the "first page", see below) of the subreport is printed on the first page/column of the report, followed by the next parts down to the bottom ("last page")of the subreport. "bottom to top" starts with the bottom part ("last page") and puts the other parts on subsequent page/column or the report.
"left to right" mean "top to bottom", if the subreport is turned 90° counter-clockwise, and "bottom to top", if it's turned 90° clockwise.
"right to left" works just the other way around.

- If stretching or squeezing is allowed, the "top part" of a sub-report always equals the first page. Otherwise it could just be the first fitting part of the first page, and so on.

That's how it could work... :-))

What do you think?


Ups, forgot an option: Clip the subreport on the top or bottom side


To add another use case:

I have several invoice layouts that have reusable components, such as a shipping label, as jasper subreports. Some of these invoices need the shipping label to be rotated 90 degrees to fit into the available space. Currently there's a fairly hefty workaround to generate the subreport as an image, rotate it in java, then cram the rotated image into the right place on the invoice. This would be an excellent feature to add in.

  • Status:Feedback Requested» Acknowledged
  • Status:Acknowledged» Confirmed

Was this ever implemented? Am in a situation where such a feature would help alot.



If we want subreports to have the ability to rotate, then we need all elements that someone can put in a subreport template, to also have this ability.
We currently have only text elements that can be rotated and I guess we can also do it for images.

But what about more complex graphic elements such as the ones rendered using Javascript. I doubt there is an easy way to make a third party Javascript based chart rotate.

Having said that, I think the least expensive solution to achieve this functionality is by rendering the subreport content as SVG. This was already suggested on this tracker and I would probably try making such workaround easier to use. We would be always clipping the subreport content into the design time area of the subreport element.