Jump to content
Changes to the Jaspersoft community edition download ×

Table Data Repeating Issue


shardalule

Recommended Posts

I m using the table in the iReport to present my report.The data is also displaying but the table gets repeated and the data also get repeated .I m having only 21 rows to display but its providing the ooutput of about 23 pages.

I have checked all the properties but no good luck the data is repeating in the table and also the pages in the output is also increasing.

Please suggest in which band i need to place the table and  which properties i need to check to stop the repition of data.

Thanks and regards,

Link to comment
Share on other sites

  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

If you can paste your jrxml in the "Code:" box on the forum, it might help us analyze the problem.  I don't know about "tables", but when you use a chart to summarize a group or all of the detail lines, the chart would typically go in the Summary band, which only appears once in the report.  Anything you put in the Detail band will normally appear once for every row returned from the query.

Carl

Link to comment
Share on other sites

I have pasted the code below .The query contains only ten rows but while displaying the report it showing around 7 pages.

Even i kept the table in the summary band but it stills repeating the values.

Please suggest  if possible.

Thanks and regards

 

Code:
<?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="Test1" language="groovy" pageWidth="595" pageHeight="842" 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="98"/>	<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>	<subDataset name="Report">		<queryString language="SQL">			<![CDATA[  SELECT userid FROM users u limit 0,10]]>		</queryString>		<field name="userid" class="java.math.BigInteger"/>	</subDataset>	<subDataset name="New Dataset 1">		<queryString language="SQL">			<![CDATA[  SELECT userid FROM users u limit 0,10]]>		</queryString>		<field name="userid" class="java.math.BigInteger"/>	</subDataset>	<queryString language="SQL">		<![CDATA[sELECT userid FROM users u limit 0,10]]>	</queryString>	<field name="userid" class="java.math.BigInteger"/>	<background>		<band splitType="Stretch"/>	</background>	<title>		<band height="79" splitType="Stretch"/>	</title>	<pageHeader>		<band height="35" splitType="Stretch"/>	</pageHeader>	<columnHeader>		<band height="61" splitType="Stretch"/>	</columnHeader>	<detail>		<band height="74" splitType="Stretch">			<componentElement>				<reportElement key="table 1" style="table 1" x="47" y="10" width="90" height="48"/>				<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">						<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>					</datasetRun>					<jr:column width="90">						<jr:tableHeader style="table 1_TH" height="30"/>						<jr:tableFooter style="table 1_TH" height="30"/>						<jr:columnHeader style="table 1_CH" height="30">							<staticText>								<reportElement x="0" y="0" width="90" height="30"/>								<textElement/>								<text><![CDATA[userid]]></text>							</staticText>						</jr:columnHeader>						<jr:columnFooter style="table 1_CH" height="30"/>						<jr:detailCell style="table 1_TD" height="20">							<textField>								<reportElement x="0" y="0" width="90" height="20"/>								<textElement/>								<textFieldExpression class="java.lang.Number"><![CDATA[$F{userid}]]></textFieldExpression>							</textField>						</jr:detailCell>					</jr:column>				</jr:table>			</componentElement>		</band>	</detail>	<columnFooter>		<band height="45" splitType="Stretch"/>	</columnFooter>	<pageFooter>		<band height="54" splitType="Stretch"/>	</pageFooter>	<summary>		<band height="42" splitType="Stretch"/>	</summary></jasperReport>
Link to comment
Share on other sites

I can't even load your jrxml without an error...the Table support must not have made it to the Professional version yet.  But in the jrxml, it looks like you still have your table in the Detail band, when it should probably be dragged into the summary band, as has been suggested twice now.  Additionally, it looks to me like your table is using a subdataset (although I don't see any fields defined in that subdataset), but then you include a field from your main dataset in a cell of the table.  If your only problem is the repeating of valid data on your report, then ignore my comment about the subdataset.  If you're having other problems as well (the table is not only repeating but looks empty/wrong), you might look into that subdataset.

Good luck!

Carl

Link to comment
Share on other sites

  • 5 months later...

Hello,

I am having the same problem. The thing is that if I put my graphs and my text fields in summary, then, if I have more than one page, only the first page is going to have page footer and page header.

I am trying to display some charts in diferent pages keeping the page footer and the page header. If I put my elements in the detail field, my charts are going to be duplicated ( as many times as rows in the table of the database. i will have one page per row). And if i put them in summary i am loosing the page footer and page header

I don't know how to do it. I am using iReport 4.0.1.

Thanks and regards



Post Edited by mogador86 at 06/16/2011 14:20
Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...
  • 8 months later...
  • 2 months later...

I find that if you add some kind of limit to your query it works. MySQL uses 'limit' and Oracle uses 'rownum <=1'. If you add this into your reports query (not your dataset query) then the table in the details band will not repeat.

Link to comment
Share on other sites

  • 6 months later...

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