Hi,
I really hope someone has a clue on this layout issue, because I am already
out of ideas.
Although I think that my problem has something to do with the designs i.e.
with way Jasper treats them (layout), here's some general information abou
the application.
Basically we have a JAVA client-server application and we use Jasper to
generate a bunch of reports. The Jasper designs are processed by a servlet
on the server-side and sent to the client as jrprint files, where they are
being presented to the user. We also have a scriptlet that does some stuff -
concatenating data etc.
The report that I am having trouble with has the following structure shown
in code snippet #1
The data for it comes from a SQL query that works perfectly, so it's only
the layout that is bugging me.
In the detail I have a bunch of textfields that visualise some hierarchy and
another textfield that can contain relatively large amount of text. I've
packed each of them in a frame, both of them building up another frame.
Beneath them I have another frame which can contain 0,1 or 2 images
(ideally). I end up with a report containing pages like the one in
attachment 1.
My goal is to have report pages where there is no space between the above
frame and the image frame - like the one in attachment 2, and of course with
the text within the upper frame. At the moment this is only possible if I
get rid of the lengthy text.
In my opinion, the problem lies in the definition of the field for the
lengthy text. As I don't know how long the string would be, i define it with
a height of 13 (code snippet #2 ), that is one line only. Because of the
stretching properties of the fields it accommodates accordingly, but by
doing so it pushes the images down by variable number of lines. So, is there
any way to avoid that pushing, which ruins the design.
Any help will be deeply appreciated. Thanks for it in advance.
Regards, al
- code #1
band height=245 isSplitAllowed=false!-- 245 --
frame
reportElement isRemoveLineWhenBlank=true
positionType=Float width=545 y=0 x=0 height=75
stretchType=RelativeToBandHeight
/reportElement
box
pen lineColor=black lineStyle=Solid
lineWidth=1 /
/box
frame
reportElement isRemoveLineWhenBlank=true
positionType=FixRelativeToTop width=200 y=0 x=55
height=75 stretchType=RelativeToTallestObject/
box
pen lineColor=green lineStyle=Solid
lineWidth=3 /
/box
textField isStretchWithOverflow=true pattern=
isBlankWhenNull=true evaluationGroup=Ebene2
reportElement x=0 y=0 width=200
height=13 positionType=Float isRemoveLineWhenBlank=true
isPrintInFirstWholeBand=true
printWhenExpression![CDATA[new Boolean(
($F{AnlagenEbeneOfSchaden}).intValue()==1 )]]/printWhenExpression
/reportElement
textElement
/textElement
textFieldExpression
class=java.lang.String![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
1)]]/textFieldExpression
/textField
textField isStretchWithOverflow=true pattern=
isBlankWhenNull=true evaluationGroup=Ebene2
reportElement x=15 y=0 width=185
height=13 mode=Opaque positionType=Float
isRemoveLineWhenBlank=true isPrintInFirstWholeBand=true /
textElement
/textElement
textFieldExpression
class=java.lang.String![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
2)]]/textFieldExpression
/textField
textField isStretchWithOverflow=true pattern=
isBlankWhenNull=true evaluationGroup=Ebene3
reportElement mode=Opaque x=30 y=15
width=170 height=13 positionType=Float
isRemoveLineWhenBlank=true /
textElement
/textElement
textFieldExpression
class=java.lang.String![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
3)]]/textFieldExpression
/textField
textField isStretchWithOverflow=true pattern=
isBlankWhenNull=true
reportElement mode=Opaque x=45 y=30
width=155 height=13 positionType=Float
isRemoveLineWhenBlank=true /
textElement
/textElement
textFieldExpression
class=java.lang.String![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
4)]]/textFieldExpression
/textField
textField isStretchWithOverflow=true pattern=
isBlankWhenNull=true
reportElement mode=Opaque x=60 y=45
width=140 height=13 positionType=Float
isRemoveLineWhenBlank=true /
textElement
/textElement
textFieldExpression
class=java.lang.String![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},