shardalule Posted December 16, 2010 Share Posted December 16, 2010 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 More sharing options...
cbarlow3 Posted December 16, 2010 Share Posted December 16, 2010 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 More sharing options...
shardalule Posted December 17, 2010 Author Share Posted December 17, 2010 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 More sharing options...
hozawa Posted December 17, 2010 Share Posted December 17, 2010 Where are you putting your table? If you put it in the details band, it's going get repeated per data source row. Link to comment Share on other sites More sharing options...
cbarlow3 Posted December 17, 2010 Share Posted December 17, 2010 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 More sharing options...
mogador Posted June 16, 2011 Share Posted June 16, 2011 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 headerI don't know how to do it. I am using iReport 4.0.1.Thanks and regardsPost Edited by mogador86 at 06/16/2011 14:20 Link to comment Share on other sites More sharing options...
mogador Posted June 16, 2011 Share Posted June 16, 2011 SOLVED !!There is an option in report inspector for showing summary with page header and page footer. Link to comment Share on other sites More sharing options...
despec Posted June 16, 2011 Share Posted June 16, 2011 Try designing groups in your SQL query. In that way, you can display multiple graphs within each group footer in Ireport. David Link to comment Share on other sites More sharing options...
adaliko Posted January 25, 2013 Share Posted January 25, 2013 Other option is go to 'PRINT WHEN EXPRESSION' and put $V{REPORT_COUNT}==1 to avoid repeated values Link to comment Share on other sites More sharing options...
kasunsageera Posted June 18, 2014 Share Posted June 18, 2014 Find 'PRINT WHEN EXPRESSION' property and put $V{REPORT_COUNT}==1 .. This function needs to apply for detail band to avoid repeated values. Link to comment Share on other sites More sharing options...
skatariya Posted February 18, 2015 Share Posted February 18, 2015 I am also facing the same problem. I tried using $V{REPORT_COUNT}==1 into the PRINT WHEN Expression. But now my values are not repeated but still the number of pages generating are in thousands. The actual number should be 25. Can anybody help me with this? Link to comment Share on other sites More sharing options...
dee211 Posted May 15, 2015 Share Posted May 15, 2015 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 More sharing options...
salnikov Posted November 27, 2015 Share Posted November 27, 2015 You just have to place your table into SUMMARY section of report instead of DETAIL section. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now