Jump to content
Changes to the Jaspersoft community edition download ×

please solve my problem in ireport Designer


jhansee

Recommended Posts

I required to design a report in the following format which i have attached.I am using sql database to fill the data.I am using tables and changing report properties to columns = 2 and print order =vertical but i am getting only 1st row (i.e 1st semester and 2nd semester) in one page.In the next page 3rd semeter and 4th semester.In the Last page 5 th and 6th semesters. i want all the semesters in the single page. please help me to solve this problem. Its is very urgent.

 

 

thanks

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

"Report properties to columns = 2 and print order =vertical" will fill the report on the left column first until reach the bottom of the current page then fill the right column. This is an expected behavior as you will see this format in the newspaper print.

Your design requirement is actually to fill the 2 column report HORIZONTALLY. However, this report oder orientation is not supported by report table element. You should use regular report tabular layout to meet this requirement.  Below is a sample JRXML for this approach:

<?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="report-table-element" language="groovy" columnCount="2" printOrder="Horizontal" pageWidth="612" pageHeight="792" columnWidth="286" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="989c293b-9730-48a1-8f77-65ac0c3cc98c">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <style name="table">
        <box>
            <pen lineWidth="1.0" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 1">
        <box>
            <pen lineWidth="1.0" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 2">
        <box>
            <pen lineWidth="1.0" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 2_TH" mode="Opaque" backcolor="#F0F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 2_CH" mode="Opaque" backcolor="#BFE1FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 2_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <queryString>
        <![CDATA[select '1st semester' as semester
union all
select '2nd semester' as semester
union all
select '3rd semester' as semester
union all
select '4th semester' as semester
union all
select '5th semester' as semester
union all
select '6th semester' as semester]]>
    </queryString>
    <field name="semester" class="java.lang.String"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band splitType="Stretch"/>
    </title>
    <pageHeader>
        <band splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="25" splitType="Stretch">
            <textField>
                <reportElement x="0" y="0" width="284" height="25" uuid="b88b3293-2554-432b-b6ce-84fba9c2c358"/>
                <textFieldExpression><![CDATA[$F{semester}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band splitType="Stretch"/>
    </summary>
</jasperReport>

 

Link to comment
Share on other sites

"Report properties to columns = 2 and print order =vertical" will fill the report on the left column first until reach the bottom of the current page then fill the right column. This is an expected behavior as you will see this format in the news paper print.

Your design requirement is actually to fill the 2 column report HORIZONTALLY. However, this report oder orientation is not supported by report table element. You should use regular report tabular layout to meet this requirement.

 

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