| René Nyffenegger's collection of things on the web | |
|
René Nyffenegger on Oracle - Most wanted - Feedback
|
Jasper - Stretch with overflow | ||
|
Streth with Overflow (<isStretchWithOverflow>): the result is correct on the screen, but not in the text export.
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport
xmlns="http://jasperreports.sourceforge.net/jasperreports"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"
name ="Ex 14 ... "
pageWidth = "280"
pageHeight = "420"
columnWidth = "210"
leftMargin = "0"
rightMargin = "0"
topMargin = "0"
bottomMargin = "0"
>
<!--
Should, if so desired, be exported with char width: 7, char height: 14.
Never mind if you don't understand last sentence.
-->
<queryString language="SQL">
<![CDATA[
select 'aa' col_1, 'bb' col_2, 'cc' col_3 from dual union all
select 'dd dd' col_1, 'ee ee' col_2, 'ff ff' col_3 from dual union all
select 'gg gg gg' col_1, 'hh hh hh' col_2, 'ii ii ii' col_3 from dual union all
select 'jj jj jj jj' col_1, 'kk kk kk kk' col_2, 'll ll ll ll' col_3 from dual union all
select 'mm mm mm mm mm' col_1, 'nn nn nn nn nn' col_2, 'oo oo oo oo oo' col_3 from dual union all
select 'pp pp pp pp pp pp' col_1, 'qq qq qq qq qq qq' col_2, 'rr rr rr rr rr rr' col_3 from dual union all
select 'ss ss ss ss ss ss ss' col_1, 'tt tt tt tt tt tt tt' col_2, 'uu uu uu uu uu uu uu' col_3 from dual union all
select 'vv vv vv vv vv vv vv vv' col_1, 'ww ww ww ww ww ww ww ww' col_2, 'xx xx xx xx xx xx xx xx' col_3 from dual union all
select '1234567890' col_1, '1234567890' col_2, '1234567890' col_3 from dual
]]>
</queryString>
<field name="COL_1" class="java.lang.String"/>
<field name="COL_2" class="java.lang.String"/>
<field name="COL_3" class="java.lang.String"/>
<pageHeader>
<band height='42'>
<staticText><reportElement x= " 7" y="14" width="42" height="14"/><text><![CDATA[col 1]]></text></staticText>
<staticText><reportElement x= " 70" y="14" width="42" height="14"/><text><![CDATA[col 2]]></text></staticText>
<staticText><reportElement x= "133" y="14" width="42" height="14"/><text><![CDATA[col 3]]></text></staticText>
</band>
</pageHeader>
<detail>
<band height="14" splitType="Stretch">
<textField > <reportElement x= " 7" y="0" width="42" height="14"/><textElement><font fontName="Courier New" size="12"/></textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{COL_1}]]></textFieldExpression> </textField>
<textField isStretchWithOverflow="true"> <reportElement x=" 70" y="0" width="35" height="14"/><textElement><font fontName="Courier New" size="12"/></textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{COL_2}]]></textFieldExpression> </textField>
<textField isStretchWithOverflow="true"> <reportElement x="133" y="0" width="42" height="14"/><textElement><font fontName="Courier New" size="12"/></textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{COL_3}]]></textFieldExpression> </textField>
</band>
</detail>
<pageFooter> </pageFooter>
<summary> </summary>
</jasperReport>
See also other Jasper examples.
|