JasperReports: Subreport renders multiple times, causing duplicate pages - jasper-reports

I am using JasperReports to generate a graph and table for a web application using two separate queries. My main JRXML generates the graph, and I include a subreport in the Detail band to generate the table. However, when it renders, the subreport seems to get rendered multiple times (12 to be exact), which results in the generated report being the same graph and table on 12 pages (exact duplicates of each other). This happens both through the online application and iReport.
My main JRXML, subreport JRXML, and report generation code are below (some details have been removed for NDA reasons).
Any insight or ideas on what the issue is would be very helpful.
Main JRXML:
<?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" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["<<PATH_TO_SUBREPORT>>"]]></defaultValueExpression>
</parameter>
<parameter name="param" class="java.util.Collection" />
<queryString language="SQL">
<![CDATA[<<DATABASE_QUERY>>]]>
</queryString>
<field name="FIELD1" class="java.lang.Integer"/>
<field name="FIELD2" class="java.sql.Date"/>
<field name="FIELD3" class="java.math.BigDecimal"/>
<field name="FIELD4" class="java.math.BigDecimal"/>
<field name="FIELD5" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="10" splitType="Stretch"/>
</title>
<pageHeader>
<band height="5" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="5" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="513" splitType="Stretch">
<lineChart>
<chart>
<reportElement positionType="Float" x="51" y="0" width="680" height="400"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<categoryDataset>
<categorySeries>
<seriesExpression><![CDATA["FIELD1"]]></seriesExpression>
<categoryExpression><![CDATA[$F{f1}]]></categoryExpression>
<valueExpression><![CDATA[$F{f2}]]></valueExpression>
</categorySeries>
<categorySeries>
<seriesExpression><![CDATA["FIELD2"]]></seriesExpression>
<categoryExpression><![CDATA[$F{f1}]]></categoryExpression>
<valueExpression><![CDATA[$F{f2}]]></valueExpression>
</categorySeries>
<categorySeries>
<seriesExpression><![CDATA["FIELD3"]]></seriesExpression>
<categoryExpression><![CDATA[$F{f1}]]></categoryExpression>
<valueExpression><![CDATA[$F{f2}]]></valueExpression>
</categorySeries>
</categoryDataset>
<linePlot>
<plot labelRotation="-90.0"/>
<categoryAxisFormat labelRotation="-90.0">
<axisFormat>
<tickLabelFont>
<font size="12"/>
</tickLabelFont>
</axisFormat>
</categoryAxisFormat>
<rangeAxisMinValueExpression><![CDATA[0]]></rangeAxisMinValueExpression>
<rangeAxisMaxValueExpression><![CDATA[101]]></rangeAxisMaxValueExpression>
</linePlot>
</lineChart>
<subreport>
<reportElement x="377" y="413" width="425" height="100"/>
<subreportParameter name="param">
<subreportParameterExpression><![CDATA[$P{param}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "testReport.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
<columnFooter>
<band height="5" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="15" splitType="Stretch">
<textField>
<reportElement mode="Opaque" x="3" y="2" width="759" height="13" backcolor="#E6E6E6"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement mode="Opaque" x="762" y="2" width="40" height="13" backcolor="#E6E6E6"/>
<textElement/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement x="3" y="0" width="100" height="13"/>
<textElement/>
<textFieldExpression><![CDATA[new SimpleDateFormat("MM-dd-yyyy").format(
new java.util.Date())]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="10" splitType="Stretch"/>
</summary>
</jasperReport>
Sub Report JRXML:
<?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="evcas_sub" language="groovy" pageWidth="450" pageHeight="150" columnWidth="10" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10">
<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="#0000FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFBFFF">
<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>
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
<style backcolor="#EFEFFF"/>
</conditionalStyle>
</style>
<style name="Crosstab Data Text" hAlign="Center"/>
<parameter name="param" class="java.util.Collection" />
<queryString>
<![CDATA[<<DATABASE_QUERY>>]]>
</queryString>
<field name="FIELD1" class="java.lang.String"/>
<field name="FIELD2" class="java.math.BigDecimal"/>
<field name="FIELD3" class="java.math.BigDecimal"/>
<field name="FIELD4" class="java.math.BigDecimal"/>
<field name="FIELD5" class="java.math.BigDecimal"/>
<field name="FIELD6" class="java.math.BigDecimal"/>
<field name="FIELD7" class="java.math.BigDecimal"/>
<field name="FIELD8" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="5" splitType="Stretch"/>
</title>
<pageHeader>
<band height="5"/>
</pageHeader>
<columnHeader>
<band height="12">
<textField>
<reportElement style="table_TH" x="0" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD1"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="50" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD2"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="100" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD3"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="150" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD4"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="200" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD5"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="250" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD6"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="300" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD7"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="350" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD8"]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="12">
<textField>
<reportElement style="table_CH" x="0" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f1}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="50" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f2}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="100" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f3}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="150" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f4}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="200" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f5}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="250" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f6}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="300" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f7}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="350" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f8}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="5" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="5" splitType="Stretch"/>
</pageFooter>
</jasperReport>
Rendering Code:
String strFileName = "<<FILENAME>>";
File jrxml = new File(strFileName);
InputStream iStream = new FileInputStream(jrxml);
JasperReport objJReport = JasperCompileManager.compileReport(iStream);
JasperPrint objJPrint = JasperFillManager.fillReport(objJReport, hashMap, datasource.getConnection());
JasperExportManager.exportReportToPdfStream(objJPrint, os);

One detail band is printed per record in your data set. So if your database query returns 12 rows, you get 12 copies of the detail band. Each band uses data from a single row, but this is inconsequential for you as you are using a chart and subreport to display the data.
To avoid this repetition, just put your chart and subreport into a different band. I'd go for column header or footer, but anything except detail will work.

Related

Document is empty in Jasper Studio

i am using a oracle data adapter. when i put my query in sql developer it returns value. but in jasper it shows document is empty. is their any way to check if my data adapter is working properly or not?
i am new in jasper studio. if any setting need to change please mention. i am using oracle 11G express edition.
here is my jrxml file:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.11.0.final using JasperReports Library version 6.11.0-0c4056ccaa4d25a5a8c45672d2f764ea3498bebb -->
<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="Cherry_2" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="13acf49e-4913-4d1b-bccc-113817ad15d1">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="KHALID"/>
<style name="Title" forecolor="#FFFFFF" fontName="Times New Roman" fontSize="50" isBold="false"/>
<style name="SubTitle" forecolor="#CCCCCC" fontName="Times New Roman" fontSize="18" isBold="false"/>
<style name="Column header" forecolor="#666666" fontName="Times New Roman" fontSize="14" isBold="true"/>
<style name="Detail" mode="Transparent" fontName="Times New Roman"/>
<style name="Row" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style mode="Opaque" backcolor="#F0EFEF"/>
</conditionalStyle>
</style>
<queryString language="SQL">
<![CDATA[select c.productname, sum(b.quantity)
from orders a, orderdetails b, products c
where a.orderid = b.orderid
and b.PRODUCT = c.id
group by c.productname]]>
</queryString>
<field name="PRODUCTNAME" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="PRODUCTNAME"/>
</field>
<field name="SUM(B.QUANTITY)" class="java.math.BigDecimal">
<property name="com.jaspersoft.studio.field.label" value="SUM(B.QUANTITY)"/>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="132" splitType="Stretch">
<image>
<reportElement x="456" y="0" width="99" height="132" uuid="97705585-a0b5-4ec7-86f3-ae10c220e6af"/>
<imageExpression><![CDATA["cherry.jpg"]]></imageExpression>
</image>
<frame>
<reportElement mode="Opaque" x="0" y="0" width="451" height="95" backcolor="#000000" uuid="6c6ca4e1-17cd-4913-93d6-5e670ea9ae8a"/>
<staticText>
<reportElement style="Title" x="0" y="0" width="370" height="66" uuid="a2a2cac8-5a7d-4487-8c54-dab235ce4e21"/>
<textElement>
<font isBold="false"/>
</textElement>
<text><![CDATA[Cherry Title]]></text>
</staticText>
<staticText>
<reportElement style="SubTitle" x="157" y="66" width="249" height="29" uuid="8978eac3-c578-41c9-837e-48d2b0184642"/>
<textElement>
<font size="22" isBold="false"/>
</textElement>
<text><![CDATA[Cherry SubTitle]]></text>
</staticText>
</frame>
<frame>
<reportElement mode="Opaque" x="0" y="100" width="451" height="32" forecolor="#000000" backcolor="#CC0000" uuid="e3c14156-5b51-4201-918b-97fdc012e5d4"/>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement x="307" y="12" width="144" height="20" forecolor="#FFFFFF" uuid="5c3301e7-a737-4c59-8a2f-a6c79fd1adb8"/>
<textElement textAlignment="Right">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</frame>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="26" splitType="Stretch">
<staticText>
<reportElement style="Column header" x="0" y="7" width="277" height="18" forecolor="#000000" uuid="a6b37150-9bee-492a-b969-f034f64edf4c">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="e1446586-9fcf-432d-9dd5-955ccb125ee4"/>
</reportElement>
<textElement>
<font isBold="false"/>
</textElement>
<text><![CDATA[PRODUCTNAME]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="277" y="7" width="277" height="18" forecolor="#000000" uuid="6d1296a7-fb7c-46ca-9371-77d96da01824">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="dd4b0dcc-1ffd-4aa0-9af2-c6c23bcffe7d"/>
</reportElement>
<textElement>
<font isBold="false"/>
</textElement>
<text><![CDATA[SUM(B.QUANTITY)]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="18" splitType="Stretch">
<frame>
<reportElement style="Row" mode="Opaque" x="0" y="0" width="555" height="18" uuid="b50221b5-8254-440b-8c6f-1f0b138c9259"/>
<textField textAdjust="StretchHeight">
<reportElement style="Detail" positionType="Float" x="0" y="0" width="277" height="18" uuid="3c5fe24a-0a12-4767-98ee-528641a8400b">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="e1446586-9fcf-432d-9dd5-955ccb125ee4"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{PRODUCTNAME}]]></textFieldExpression>
</textField>
<textField textAdjust="StretchHeight">
<reportElement style="Detail" positionType="Float" x="277" y="0" width="277" height="18" uuid="f11c3ade-0bb6-4270-820f-639e51664491">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="dd4b0dcc-1ffd-4aa0-9af2-c6c23bcffe7d"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{SUM(B.QUANTITY)}]]></textFieldExpression>
</textField>
</frame>
</band>
</detail>
<columnFooter>
<band height="7" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1" uuid="1133a906-5b71-476e-9f3e-bc97c97058c1"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnFooter>
<pageFooter>
<band height="25" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="0" y="1" width="555" height="24" forecolor="#D0B48E" backcolor="#000000" uuid="729c3539-f946-4d0e-a0a7-bda2815ea1b0"/>
<textField evaluationTime="Report">
<reportElement style="Column header" x="513" y="0" width="40" height="20" forecolor="#FFFFFF" uuid="4834e99c-7f6c-485a-b098-50e5187f2ab4"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Column header" x="433" y="0" width="80" height="20" forecolor="#FFFFFF" uuid="9825b46e-76f1-469a-abb8-a1cc27aad685"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="2" y="1" width="197" height="20" forecolor="#FFFFFF" uuid="137d38c7-1a83-4fc5-b156-9d5f1b1a0ddc"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</frame>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>
This problem happened to me once and I solved it confirmed the changes and it was not bringing data, in oracle run:
commit;

jasper ireport subreport variable or main report variable main report variable duplicate print

I am new in jasper report, I used jasper ireport 5.6.0.
I have two reports main report or subreport and I returned variable value from subreport to the main report value successfully returned from subreport, but here is a problem I have faced:
When I have printed sub-report variable or sum in grand total with the main report, the main report variable total duplicate two print with subreport variable here below screenshot.
> mian report
<?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="printBillReport" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" scriptletClass="com.reporter.jasper.ConvertToWord" uuid="bd072f9e-2dda-451a-b0a1-13e9f2aa0d3b">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["C:\\Users\\windows\\Documents\\NetBeansProjects\\SteplizerElectronics\\src\\steplizerelectronics\\"]]></defaultValueExpression>
</parameter>
<parameter name="cusID" class="java.lang.Integer"/>
<queryString>
<![CDATA[select *from sale where cus_id=$P{cusID}]]>
</queryString>
<field name="ID" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cat_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="model_no" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="user_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="comp_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_cell" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="sel_price" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="qty" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="amount" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="payable" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="borrow" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="status" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="regdate" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<variable name="amount_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{amount}]]></variableExpression>
</variable>
<variable name="qty_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{qty}]]></variableExpression>
</variable>
<variable name="borrow_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{borrow}]]></variableExpression>
</variable>
<variable name="payable_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{payable}]]></variableExpression>
</variable>
<variable name="grandTotall" class="java.lang.Double"/>
<variable name="total_amount" class="java.lang.Double" calculation="Sum">
<variableExpression><![CDATA[$F{amount}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="123" splitType="Stretch">
<staticText>
<reportElement x="137" y="80" width="66" height="20" uuid="3b4ea294-f433-491e-9803-2c36e8092e59"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Manufactur:]]></text>
</staticText>
<rectangle radius="10">
<reportElement x="1" y="1" width="555" height="118" uuid="f86b54e6-471d-4395-acda-da815bae56ae"/>
<graphicElement>
<pen lineWidth="2.0" lineStyle="Double"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="10" y="113" width="112" height="3" uuid="f3df3b93-035d-4379-8635-c5947bdd4f62"/>
<textElement>
<font size="9"/>
</textElement>
<text><![CDATA[14-DS Main Bund Road, Near Chohan Road, Islam Pura, Lahore.]]></text>
</staticText>
<line>
<reportElement x="310" y="97" width="1" height="19" uuid="fab4c957-2174-44a7-a773-945807f51b60"/>
</line>
<staticText>
<reportElement x="118" y="8" width="258" height="22" uuid="1bbc2106-275b-45be-ae87-cd4607dc8c04"/>
<textElement>
<font fontName="Audiowide" size="14"/>
</textElement>
<text><![CDATA[AONE ELECTRONICS FACTORY]]></text>
</staticText>
<image>
<reportElement x="1" y="3" width="102" height="68" uuid="94d07030-0eae-424a-a92e-b2c80f63d49e"/>
<imageExpression><![CDATA["C:\\Users\\windows\\Desktop\\aone.png"]]></imageExpression>
</image>
<staticText>
<reportElement x="11" y="71" width="48" height="16" uuid="52f2829b-19ca-4269-bec6-80bdb9951674"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Address:]]></text>
</staticText>
<staticText>
<reportElement x="285" y="99" width="83" height="14" uuid="85f72593-8c79-49ec-81b1-a266a1fbe68e"/>
<text><![CDATA[M/S]]></text>
</staticText>
<line>
<reportElement x="279" y="73" width="274" height="1" uuid="b0e7d11d-efc3-4833-a07b-bb5ffc4f3f63"/>
</line>
<line>
<reportElement x="279" y="74" width="1" height="44" uuid="c4a74d99-3a03-469d-972b-f4319ae837ec"/>
</line>
<staticText>
<reportElement x="396" y="-14" width="35" height="16" uuid="93706ffc-0443-4a0c-9a78-8ae0258beeca"/>
<text><![CDATA[Date]]></text>
</staticText>
<staticText>
<reportElement x="142" y="89" width="136" height="30" uuid="30a5b94f-a0a3-44d1-8e81-b8d5bdc70719"/>
<text><![CDATA[Automatic Voltage steplizer Regulators & UPS]]></text>
</staticText>
<componentElement>
<reportElement x="373" y="7" width="177" height="31" uuid="088518ef-edd8-4c30-a126-e9514f1b13d2"/>
<jr:barbecue xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" type="Code39 (Extended)" drawText="false" checksumRequired="false">
<jr:codeExpression><![CDATA[$F{cus_name}+$F{cus_id}]]></jr:codeExpression>
</jr:barbecue>
</componentElement>
<textField>
<reportElement x="321" y="98" width="234" height="16" uuid="edbc7887-c6f6-4209-bcf3-68ad5be80ec8"/>
<textFieldExpression><![CDATA[$F{cus_name}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="143" y="73" width="60" height="16" uuid="abaf5bdb-61f6-4148-92c8-eafe2e5e6a9e"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Steplizers]]></text>
</staticText>
<staticText>
<reportElement x="285" y="77" width="100" height="16" uuid="c440daa7-1411-4e51-9750-6531b35acbd4"/>
<textElement>
<font size="11"/>
</textElement>
<text><![CDATA[Credit Sale]]></text>
</staticText>
</band>
</title>
<columnHeader>
<band height="27" splitType="Stretch">
<rectangle>
<reportElement x="1" y="0" width="552" height="26" uuid="ab9bb588-6c52-4e6f-858a-f64555e9c482"/>
<graphicElement>
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="10" y="2" width="26" height="20" uuid="cee00939-18a0-43a9-8f7b-8ef37c3c8136"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[ID]]></text>
</staticText>
<staticText>
<reportElement x="69" y="3" width="100" height="20" uuid="c5555982-8ed2-486b-9b20-c820ea2d6303"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[PARTICULARS]]></text>
</staticText>
<staticText>
<reportElement x="334" y="2" width="68" height="20" uuid="444d348c-5aec-47d9-9b8b-8a0df7d5d9cc"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[UNIT RATE]]></text>
</staticText>
<staticText>
<reportElement x="416" y="2" width="31" height="20" uuid="e03d0e0f-fee8-48f6-b649-d29122dae87b"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[QTY]]></text>
</staticText>
<staticText>
<reportElement x="452" y="2" width="88" height="20" uuid="4b3c8b66-6b26-4b2c-bfa4-58917ad61092"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Amount Rs]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="18" splitType="Stretch">
<line>
<reportElement x="1" y="-1" width="1" height="18" uuid="46636ee5-05ef-4ed0-98b3-8b3cdb0e388b"/>
<graphicElement>
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="50" y="-2" width="1" height="18" uuid="df3f7753-0f5e-4ff0-bf2c-a3ae8a1d29dc"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="325" y="-2" width="1" height="19" uuid="ff6ab656-efe5-47d2-b6cc-7560cef1f5f4"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="411" y="-1" width="1" height="18" uuid="c6ecd5da-b343-441e-983f-b2414fa30583"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="445" y="-1" width="1" height="18" uuid="0dabdb94-9868-4f7e-935a-0fa235ce0a13"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="553" y="-1" width="1" height="18" uuid="0bc274c2-5f26-4f5d-b68d-e21bc2c4c888"/>
<graphicElement>
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<textField>
<reportElement x="10" y="1" width="26" height="14" uuid="63a319b2-8afe-4318-bab9-878b61ad4a82"/>
<textElement verticalAlignment="Middle">
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="70" y="1" width="255" height="14" uuid="cf463437-6041-457b-800b-b7d4917676f6"/>
<textElement verticalAlignment="Middle">
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{cat_name}+", "+$F{model_no}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00">
<reportElement x="335" y="1" width="72" height="14" uuid="10d9300e-83f3-4942-836a-c547e02d8c7d"/>
<textElement verticalAlignment="Middle">
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{sel_price}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="417" y="1" width="32" height="14" uuid="d744148c-6afe-46dc-b14f-c1ba4d6859c0"/>
<textElement verticalAlignment="Middle">
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{qty}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00">
<reportElement x="452" y="1" width="89" height="14" uuid="b1d2ce72-c35f-4507-bb93-6f3e06b80a00"/>
<textElement verticalAlignment="Middle">
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{amount}]]></textFieldExpression>
</textField>
<line>
<reportElement x="50" y="-26" width="1" height="26" uuid="465616a8-77d2-4347-9290-149936abb9e7"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="325" y="-28" width="1" height="26" uuid="704a8402-1a4e-42a0-9ce3-673c8a9bc69b"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="411" y="-26" width="1" height="26" uuid="e4128970-6640-4c7b-9677-6b349dbfa0da"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="445" y="-27" width="1" height="26" uuid="4a2e897b-cd91-4573-a76d-a4f32b4cd077"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Double"/>
</graphicElement>
</line>
</band>
</detail>
<pageFooter>
<band height="39" splitType="Stretch">
<rectangle>
<reportElement x="-21" y="9" width="599" height="30" backcolor="#333333" uuid="8634a9b7-fcf3-4881-82c3-6679dbc18552"/>
</rectangle>
<staticText>
<reportElement x="141" y="15" width="244" height="12" forecolor="#FFFFFF" uuid="274941d4-cc0e-4fb4-997b-382c827badc9"/>
<textElement>
<font size="9"/>
</textElement>
<text><![CDATA[Software Provided by Ph# +923024712782]]></text>
</staticText>
<staticText>
<reportElement x="142" y="27" width="244" height="12" forecolor="#FFFFFF" uuid="a4ff6425-a7f1-4fff-b0ab-a92da8a2dcb5"/>
<textElement>
<font size="9"/>
</textElement>
<text><![CDATA[www.ultronhouse.com]]></text>
</staticText>
<textField>
<reportElement x="434" y="18" width="80" height="20" forecolor="#FFFFFF" uuid="d1d8921f-151b-44c9-8d12-4b82cb993ffe"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="514" y="18" width="40" height="20" forecolor="#FFFFFF" uuid="f31b2a21-d3fd-470f-9527-f998b02be397"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement x="-1" y="17" width="100" height="20" forecolor="#FFFFFF" uuid="34d4b240-cfb4-41d0-af4e-815e9e099d74"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="315" splitType="Stretch">
<rectangle>
<reportElement x="326" y="0" width="228" height="80" uuid="51ca5430-c464-4742-a4d6-178c75f4f4f8"/>
<graphicElement>
<pen lineWidth="2.0"/>
</graphicElement>
</rectangle>
<rectangle>
<reportElement x="0" y="0" width="325" height="22" uuid="e65cff7a-3ed1-450f-bfa7-585c580cfe60"/>
<graphicElement>
<pen lineWidth="1.0"/>
</graphicElement>
</rectangle>
<textField pattern="">
<reportElement x="63" y="5" width="263" height="20" uuid="102cb181-c6f9-4bf5-98cc-50333c2f9efa"/>
<textElement>
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{REPORT_SCRIPTLET}.readNumber($V{amount_1})]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="7" y="6" width="48" height="20" uuid="1d88c6eb-ba59-45f2-b1af-b5b1cf1634b0"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Ruppies:]]></text>
</staticText>
<line>
<reportElement x="327" y="60" width="226" height="1" uuid="95c9a5f3-5fed-4813-8bc1-076f9b658c09"/>
</line>
<staticText>
<reportElement x="333" y="3" width="77" height="20" uuid="fd70b399-0bf9-4840-87b9-c398765cd363"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Total]]></text>
</staticText>
<staticText>
<reportElement x="334" y="22" width="77" height="20" uuid="494a0fe7-85be-4220-9959-fbf09672ac68"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[QTY]]></text>
</staticText>
<staticText>
<reportElement x="334" y="61" width="110" height="20" uuid="fcb0a54c-5ecb-4e49-b7f0-0cd819c89a6c"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Grand Total]]></text>
</staticText>
<textField pattern="#,##0.00;#,##0.00-">
<reportElement x="453" y="3" width="100" height="20" uuid="62437a3a-407d-46a6-9531-4c445ecd0c98"/>
<textElement verticalAlignment="Top">
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$V{amount_1}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;#,##0.00-">
<reportElement x="454" y="22" width="100" height="20" uuid="65b192d8-375b-4f1b-b90e-7802d3fdb6eb"/>
<textElement verticalAlignment="Top">
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$V{qty_1}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report" pattern="#,##0.00;#,##0.00-">
<reportElement isPrintRepeatedValues="false" x="456" y="62" width="100" height="20" uuid="87f1c4f0-44ec-42a4-9416-527113afb9ed"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[($V{grandTotall}+$V{total_amount})-$V{total_amount}]]></textFieldExpression>
</textField>
<subreport>
<reportElement x="136" y="2" width="192" height="21" uuid="ffdec19a-5213-44a4-a6e4-a874bb2b6578"/>
<subreportParameter name="cusID">
<subreportParameterExpression><![CDATA[$F{cus_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<returnValue subreportVariable="grandTotall" toVariable="grandTotall"/>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "printBill_subreport.jasper"]]></subreportExpression>
</subreport>
<staticText>
<reportElement x="335" y="41" width="108" height="20" uuid="f4b88757-b2f9-4c43-abd2-1d458137016e"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Previous Balance]]></text>
</staticText>
<textField evaluationTime="Report" pattern="#,##0.00;(#,##0.00)">
<reportElement x="455" y="43" width="100" height="20" uuid="1ed3c932-ce63-4a21-9624-a60f22720620"/>
<textElement>
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$V{grandTotall}-$V{amount_1}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="86" y="60" width="100" height="20" uuid="d38785b9-638e-4e10-a9e2-b664205694e1"/>
<textFieldExpression><![CDATA[($V{total_amount}+1+$V{grandTotall})-$V{total_amount}]]></textFieldExpression>
</textField>
</band>
</summary>
</jasperReport>
Sub-report
<?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="printBill_subreport" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="40d765ae-ceb6-47eb-a59b-aa232f876bb6">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="cusID" class="java.lang.Integer"/>
<queryString>
<![CDATA[select *from ac_balance where cus_id=$P{cusID} and status='UnClear']]>
</queryString>
<field name="ID" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="sale_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="qty" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="payable" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="borrow" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="receiveable" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="total" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="status" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="regdate" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<variable name="borrow_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{borrow}]]></variableExpression>
</variable>
<variable name="grandTotall" class="java.lang.Double">
<variableExpression><![CDATA[$V{borrow_1}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="52" splitType="Stretch"/>
</title>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
Images
here below some screen shots of reports properties bellow.
[Sub-report Image1][1]
[main-report Image2][2]
[output print3][3]
[image4][4]
[1]: https://i.stack.imgur.com/Gqdi4.png
[2]: https://i.stack.imgur.com/j7OoC.png
[3]: https://i.stack.imgur.com/k6LG4.png
[4]: https://i.stack.imgur.com/EQALD.png

How to break the single Line chart into next pages

Can you please suggest the code for getting new pages.
How to break the single Line chart into next pages with JasperReports 5.0
Here the code i attached for more details.
<?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="SystemSummary" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bd0eaa3b-093e-4699-83ef-75015530229d">
<parameter name="whereClause" class="java.lang.String"/>
<parameter name="bankLogo" class="java.lang.String"/>
<parameter name="bankName" class="java.lang.String"/>
<parameter name="fromDate" class="java.util.Date">
<parameterDescription><![CDATA[]]></parameterDescription>
</parameter>
<parameter name="toDate" class="java.util.Date"/>
<parameter name="noData" class="java.lang.String"/>
<parameter name="userId" class="java.lang.String"/>
<queryString>
<![CDATA[select avg(jbase_user) as jbaseAvg,AVG(t24_user) as t24Avg,to_char(load_time, 'dd.Mon.yy HH24') as period
from tmc_system_summary group by (to_char(load_time, 'dd.Mon.yy HH24'))]]>
</queryString>
<field name="jbaseavg" class="java.math.BigDecimal"/>
<field name="t24avg" class="java.math.BigDecimal"/>
<field name="period" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="2" splitType="Stretch"/>
</title>
<pageHeader>
<band height="57" splitType="Stretch">
<staticText>
<reportElement x="300" y="25" width="235" height="15" uuid="164831c1-9eff-4cf2-8706-331d28fdf431"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[System Summary Report]]></text>
</staticText>
<textField pattern="dd/MM/yyyy">
<reportElement x="735" y="2" width="55" height="17" uuid="306ddad6-2b80-4abb-9893-859c59c8ede5"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="700" y="2" width="30" height="17" uuid="c6fdbff7-45a5-464e-bcbf-d550b174452f"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<text><![CDATA[Date:]]></text>
</staticText>
<image>
<reportElement x="20" y="3" width="130" height="30" uuid="513d2931-a2c7-4e54-bb86-188737502cae"/>
<imageExpression><![CDATA[$P{bankLogo}]]></imageExpression>
</image>
<staticText>
<reportElement x="20" y="40" width="58" height="14" uuid="5bd47ff1-6b81-428a-b7fd-50e777f70a22"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[From Date:]]></text>
</staticText>
<staticText>
<reportElement x="160" y="40" width="58" height="14" uuid="a7605d9e-c0d1-4a31-8230-c73db35766d4"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[To Date:]]></text>
</staticText>
<textField pattern="dd/MM/yyyy">
<reportElement x="80" y="40" width="70" height="14" uuid="faa13401-da98-4f06-ab43-5a1722d073f7"/>
<textFieldExpression><![CDATA[$P{fromDate} != null ? $P{fromDate} :" "]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="215" y="40" width="70" height="13" uuid="01fcdb71-820f-4ef1-9913-6ddcf36be2dc"/>
<textFieldExpression><![CDATA[$P{toDate} != null ? $P{toDate} : " "]]></textFieldExpression>
</textField>
<textField>
<reportElement x="300" y="5" width="235" height="17" uuid="7eec4f6f-5bfd-4bb0-8888-8cad8d9d84ad"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="14" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$P{bankName}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="700" y="22" width="30" height="15" uuid="08ba273e-733d-4652-9f7a-83a51f7d78ca"/>
<textElement textAlignment="Right"/>
<text><![CDATA[By:]]></text>
</staticText>
<textField>
<reportElement x="735" y="22" width="55" height="15" uuid="261308a5-7cef-42f8-8880-9d2c9cc5d5ae"/>
<textFieldExpression><![CDATA[$P{userId}]]></textFieldExpression>
</textField>
<line>
<reportElement x="10" y="54" width="780" height="1" uuid="062e928b-20d3-4345-a97e-b16eff81d254"/>
</line>
</band>
</pageHeader>
<columnHeader>
<band height="3" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="3" splitType="Stretch"/>
</detail>
<columnFooter>
<band height="2" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="27">
<textField>
<reportElement x="397" y="5" width="65" height="20" uuid="e40834ac-921f-4171-a500-ebfc9a43124a"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" size="10"/>
</textElement>
<textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="273" splitType="Stretch">
<lineChart>
<chart>
<reportElement x..
i am using line chart, how can i split the graph and keeping all the data next pages
maybe you can try to change the "splitType" of summary band to "Immediate"

x axis value displayed in line chart

I have Line chart, in x axis i should display date in string format in full format, but i cant display when more no of values in x axis, for that i decided to display x axis values in vertical manner instead of horizontal , please suggest me. for ref attached image..
<?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="sampl1" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="431d18d3-722a-4aaf-8207-da8bb0ea2fdd">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="51"/>
<parameter name="whereClause" class="java.lang.String"/>
<parameter name="bankLogo" class="java.lang.String"/>
<parameter name="bankName" class="java.lang.String"/>
<parameter name="fromDate" class="java.util.Date">
<parameterDescription><![CDATA[]]></parameterDescription>
</parameter>
<parameter name="toDate" class="java.util.Date"/>
<parameter name="noData" class="java.lang.String"/>
<parameter name="userId" class="java.lang.String"/>
<queryString>
<![CDATA[select avg(jbase_user) as jbaseAvg,AVG(t24_user) as t24Avg,to_char(load_time, 'dd.Mon.yy HH24') as period
from tmc_system_summary group by (to_char(load_time, 'dd.Mon.yy HH24'))]]>
</queryString>
<field name="jbaseavg" class="java.math.BigDecimal"/>
<field name="t24avg" class="java.math.BigDecimal"/>
<field name="period" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="30" splitType="Stretch"/>
</title>
<pageHeader>
<band height="67" splitType="Stretch">
<staticText>
<reportElement x="300" y="22" width="235" height="15" uuid="164831c1-9eff-4cf2-8706-331d28fdf431"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[ System Summary Report]]></text>
</staticText>
<image>
<reportElement x="12" y="3" width="161" height="30" uuid="513d2931-a2c7-4e54-bb86-188737502cae"/>
<imageExpression><![CDATA[$P{bankLogo}]]></imageExpression>
</image>
<textField pattern="dd/MM/yyyy">
<reportElement x="735" y="2" width="55" height="17" uuid="306ddad6-2b80-4abb-9893-859c59c8ede5"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="700" y="2" width="30" height="17" uuid="c6fdbff7-45a5-464e-bcbf-d550b174452f"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<text><![CDATA[Date:]]></text>
</staticText>
<staticText>
<reportElement x="20" y="40" width="58" height="14" uuid="5bd47ff1-6b81-428a-b7fd-50e777f70a22"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[From Date:]]></text>
</staticText>
<staticText>
<reportElement x="160" y="40" width="58" height="14" uuid="a7605d9e-c0d1-4a31-8230-c73db35766d4"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[To Date:]]></text>
</staticText>
<textField pattern="dd/MM/yyyy">
<reportElement x="80" y="40" width="70" height="14" uuid="faa13401-da98-4f06-ab43-5a1722d073f7"/>
<textFieldExpression><![CDATA[$P{fromDate} != null ? $P{fromDate} :" "]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="215" y="40" width="70" height="13" uuid="01fcdb71-820f-4ef1-9913-6ddcf36be2dc"/>
<textFieldExpression><![CDATA[$P{toDate} != null ? $P{toDate} : " "]]></textFieldExpression>
</textField>
<textField>
<reportElement x="300" y="2" width="235" height="17" uuid="7eec4f6f-5bfd-4bb0-8888-8cad8d9d84ad"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="14" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$P{bankName}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="700" y="22" width="30" height="15" uuid="08ba273e-733d-4652-9f7a-83a51f7d78ca"/>
<textElement textAlignment="Right"/>
<text><![CDATA[By:]]></text>
</staticText>
<textField>
<reportElement x="735" y="22" width="55" height="15" uuid="261308a5-7cef-42f8-8880-9d2c9cc5d5ae"/>
<textFieldExpression><![CDATA[$P{userId}]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="54" width="802" height="1" uuid="e17b6ea4-40fd-40ad-861f-a300f926d0e4"/>
</line>
</band>
</pageHeader>
<columnHeader>
<band splitType="Stretch"/>
![enter image description here][1] </columnHeader>
<columnFooter>
<band height="17" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="20" splitType="Stretch">
<textField>
<reportElement x="546" y="1" width="70" height="19" uuid="eeafb0de-dddb-4c9a-8a1d-942b65bf0a7f"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="10"/>
</textElement>
<textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="392" splitType="Stretch">
<lineChart>
<chart>
<reportElement x="12" y="18" width="779" height="355" uuid="f696d665..
By this you can display the x axis value in vertical ( topDown)
<categoryAxisFormat labelRotation="90.0">
it will work.

What is the reason of getting empty report with jdbc datasource? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am using iReport 4.7.0. To get report in table format I am connecting to SQL Server 2005.
I am creating a dataset while designing a table that gives me a field values which are in database table but after complete design while I am previewing my jrxml file it doesn't show me a table with values.
I want to know what is the problem.
My jrxml file:
<?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="Test" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="09817b9b-055f-4d9f-b22e-85b7fac3d81e" whenNoDataType="AllSectionsNoDetail">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="35"/>
<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>
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
<style backcolor="#EFF7FF"/>
</conditionalStyle>
</style>
<subDataset name="New Dataset 1" uuid="9bfe7683-aa43-4113-b4a6-8007d4c7ff5d">
<queryString language="SQL">
<![CDATA[select * from employee]]>
</queryString>
<field name="id" class="java.lang.Integer"/>
<field name="first_name" class="java.lang.String"/>
<field name="last_name" class="java.lang.String"/>
<field name="salary" class="java.lang.Integer"/>
<group name="id">
<groupExpression><![CDATA[$F{id}]]></groupExpression>
</group>
<group name="first_name">
<groupExpression><![CDATA[$F{first_name}]]></groupExpression>
</group>
<group name="last_name">
<groupExpression><![CDATA[$F{last_name}]]></groupExpression>
</group>
</subDataset>
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch">
<staticText>
<reportElement uuid="3f6a40c5-cb7c-4237-8635-19aab55cef63" x="205" y="16" width="100" height="20"/>
<textElement>
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[Test Database]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<detail>
<band height="125" splitType="Stretch">
<componentElement>
<reportElement uuid="6dc5bcfb-b281-4ec4-a611-4e5b602031ed" key="table" style="table" x="16" y="10" width="527" height="115"/>
<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="New Dataset 1" uuid="ba8de9b8-6e5b-4178-a62d-380ec6e268c2">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:column uuid="8a09f431-ce9d-4c86-bde8-b6eba830a10f" width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement uuid="05cb64bd-b18c-4323-9365-ed6fa5d763ae" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[id]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter style="table_CH" height="31" rowSpan="1"/>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement uuid="2fb15323-2f8b-4234-ae0b-7272676180df" x="0" y="0" width="90" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{id}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="db3eb7e3-b13d-4dff-b4cf-c64aa06853f2" width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement uuid="d60ed209-0e4f-4e66-8a4b-53a117a4fdf2" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[first_name]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter style="table_CH" height="31" rowSpan="1"/>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement uuid="4dc05d21-5b86-4da2-b64f-9f83666e1948" x="0" y="0" width="90" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{first_name}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="1bdd10f7-b718-4fbc-9fca-9f0a7883dc5c" width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement uuid="2bdbbd7d-f990-4261-9243-6b0f9f7feb7b" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[last_name]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter style="table_CH" height="31" rowSpan="1"/>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement uuid="d361d452-b63c-47ff-a2de-33b3f6bebe9c" x="0" y="0" width="90" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{last_name}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="da448dd2-72b0-4e70-92f8-0343fa894cc0" width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement uuid="388b140a-53d8-4097-b483-007767ab3494" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[salary]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter style="table_CH" height="31" rowSpan="1"/>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement uuid="25c5ca88-39e2-4ea2-abd7-d1afe2df4ed9" x="0" y="0" width="90" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{salary}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch">
<line>
<reportElement uuid="e22bf754-66e2-4993-9e24-93ef1cfadaaa" x="0" y="44" width="555" height="1"/>
</line>
</band>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch">
<textField>
<reportElement uuid="94fcb4b3-e6da-4603-a6f1-f10063aee62e" x="409" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
I think that your Detail band is not printed (your report's property When No Data has All Sections, No Detail value) because your main dataset is empty (I did not find in your template any others datasets except the New Dataset 1 subdataset).
You can move (put) your Table component to the Title band, for example.
You can find the sample of using Table component here.