Jump to content
We've recently updated our Privacy Statement, available here ×

Table field is not stretching with overflow if it has multiple line data in database.


mramireddy

Recommended Posts

Table field is not stretching with overflow if it has multiple line data in database..

 

I have set the properties below way.

 

stretchWithOverflow=true;  positionType="Float" stretchType="RelativeToTallestObject" 

 

Still it is displying only 1 line data in report.

 

Please suggest us how to disply mutliple line data in table field of Jasper Reports.

 

Thanks,

Rami

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I have tried using the same attributes and the filed is stretching inside the table element.

Check below jrxml.

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0  --><!-- 2017-04-13T09:57:00 --><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="Blank_A4_2" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="7980397a-5175-4537-bd09-edc66d92a625">    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>    <style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">        <box>            <pen lineWidth="0.5" lineColor="#000000"/>            <topPen lineWidth="0.5" lineColor="#000000"/>            <leftPen lineWidth="0.5" lineColor="#000000"/>            <bottomPen lineWidth="0.5" lineColor="#000000"/>            <rightPen lineWidth="0.5" lineColor="#000000"/>        </box>    </style>    <style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">        <box>            <pen lineWidth="0.5" lineColor="#000000"/>            <topPen lineWidth="0.5" lineColor="#000000"/>            <leftPen lineWidth="0.5" lineColor="#000000"/>            <bottomPen lineWidth="0.5" lineColor="#000000"/>            <rightPen lineWidth="0.5" lineColor="#000000"/>        </box>    </style>    <style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">        <box>            <pen lineWidth="0.5" lineColor="#000000"/>            <topPen lineWidth="0.5" lineColor="#000000"/>            <leftPen lineWidth="0.5" lineColor="#000000"/>            <bottomPen lineWidth="0.5" lineColor="#000000"/>            <rightPen lineWidth="0.5" lineColor="#000000"/>        </box>    </style>    <subDataset name="Dataset1" uuid="29fd14bd-7d78-4778-9eed-90b6501e246f">        <property name="com.jaspersoft.studio.data.sql.tables" value=""/>        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="PRODSUP"/>        <queryString>            <![CDATA[select * from messages smwhere length(sm.message) > 2000and rownum < 10]]>        </queryString>        <field name="THREAD_ID" class="java.math.BigDecimal"/>        <field name="MESSAGE" class="java.lang.String"/>    </subDataset>    <queryString>        <![CDATA[select * from dual]]>    </queryString>    <field name="DUMMY" class="java.lang.String"/>    <background>        <band splitType="Stretch"/>    </background>    <detail>        <band height="30" splitType="Stretch">            <textField>                <reportElement x="0" y="0" width="100" height="30" uuid="7d7b5a55-ceac-4257-9892-61bea5314ee9"/>                <textFieldExpression><![CDATA[$F{DUMMY}]]></textFieldExpression>            </textField>        </band>    </detail>    <summary>        <band height="30" splitType="Stretch">            <componentElement>                <reportElement x="0" y="0" width="555" height="30" uuid="3a3e7aa0-e4e9-4826-8e46-de95d32044f2">                    <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>                </reportElement>                <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">                    <datasetRun subDataset="Dataset1" uuid="dd549297-20b4-4178-9151-71efcf99935f">                        <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>                    </datasetRun>                    <jr:column width="100" uuid="d10b2380-4719-471b-a3a4-86a81b9ff252">                        <jr:detailCell style="Table_TD" height="30">                            <textField>                                <reportElement x="0" y="0" width="100" height="30" uuid="45eaa619-db6b-49ad-95f3-56312387b8af"/>                                <textFieldExpression><![CDATA[$F{THREAD_ID}]]></textFieldExpression>                            </textField>                        </jr:detailCell>                    </jr:column>                    <jr:column width="455" uuid="824077b9-9cf1-42b1-adea-daa2c6336936">                        <jr:detailCell style="Table_TD" height="30">                            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>                            <textField isStretchWithOverflow="true">                                <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="455" height="30" uuid="25974241-9ed7-48b9-b33d-3abc693bc951"/>                                <textFieldExpression><![CDATA[$F{MESSAGE}]]></textFieldExpression>                            </textField>                        </jr:detailCell>                    </jr:column>                </jr:table>            </componentElement>        </band>    </summary></jasperReport>[/code]

 

Link to comment
Share on other sites

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