ktrinad Posted August 29, 2006 Share Posted August 29, 2006 By: abangkisp - abangkisp looping 2003-01-14 00:40 Hello, i'm new with ireport... I'm using a simple query like select * from account order by accountno i want to show all the row in my report i follow the tutorial, got the connection, put the textfield in the detail band. But it only show the 1st row. if i use 2 column. the second row shown in the next column. does anyone have any idea? TIA By: Giulio Toffoli - gt78 RE: looping 2003-01-14 00:59 Can I see the XML source? Giulio By: abangkisp - abangkisp RE: looping 2003-01-14 01:14 Sorry i dont know where to cut to make it short, so this is the full code <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="COAReport" columnCount="2" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="252" columnSpacing="30" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <queryString><![CDATA[ select * from account order by accountno ]]></queryString> <field name="accountno" class="java.lang.String"/> <field name="name" class="java.lang.String"/> <field name="valutacode" class="java.lang.String"/> <field name="isheader" class="java.lang.String"/> <field name="accountgroup" class="java.lang.String"/> <field name="normalsaldo" class="java.lang.String"/> <field name="linkid" class="java.lang.String"/> <field name="issuspended" class="java.lang.String"/> <field name="description" class="java.lang.String"/> <group name="group1" isStartNewColumn="true" isStartNewPage="false" isResetPageNumber="false" isReprintHeaderOnEachPage="false" minHeightToStartNewPage="0" > <groupExpression><![CDATA[ $F{accountno} ]]></groupExpression> <groupHeader> <band height="10"> </band> </groupHeader> <groupFooter> <band height="50"> </band> </groupFooter> </group> <title> <band height="43"> <staticText> <reportElement mode="Transparent" x="60" y="4" width="455" height="37" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica-Bold" size="20" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[CHART OF ACCOUNT REPORT]]></text> </staticText> </band> </title> <pageHeader> <band height="2"> </band> </pageHeader> <columnHeader> <band height="40"> <rectangle> <reportElement mode="Opaque" x="4" y="0" width="522" height="25" forecolor="#000000" backcolor="#000000" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" printWhenGroupChanges="group1" isPrintWhenDetailOverflows="false"/> <graphicElement stretchType="NoStretch" pen="None" fill="Solid" /> </rectangle> <staticText> <reportElement mode="Transparent" x="21" y="3" width="99" height="21" forecolor="#FFFFFF" backcolor="#400040" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" printWhenGroupChanges="group1" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica-Bold" size="10" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[Account Number]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="143" y="3" width="99" height="21" forecolor="#FFFFFF" backcolor="#400040" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" printWhenGroupChanges="group1" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[Account Name]]></text> </staticText> </band> </columnHeader> <detail> <band height="96"> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Group" evaluationGroup="group1" hyperlinkType="None" > <reportElement mode="Transparent" x="20" y="11" width="99" height="16" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" printWhenGroupChanges="group1" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{accountno}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="144" y="9" width="99" height="16" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" printWhenGroupChanges="group1" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="30"> </band> </columnFooter> <pageFooter> <band height="50"> </band> </pageFooter> <summary> <band height="50"> </band> </summary> </jasperReport> By: Giulio Toffoli - gt78 RE: looping 2003-01-14 07:44 You have made some confusion adding a unuseful group and setting the evaluation time for some elements. Try this one. Giulio <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="COAReport" columnCount="2" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="252" columnSpacing="30" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <queryString><![CDATA[ select * from account order by accountno ]]></queryString> <field name="accountno" class="java.lang.String"/> <field name="name" class="java.lang.String"/> <title> <band height="43"> <staticText> <reportElement mode="Transparent" x="60" y="4" width="455" height="37" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Center" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica-Bold" size="20" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[CHART OF ACCOUNT REPORT]]></text> </staticText> </band> </title> <pageHeader> <band height="3"> </band> </pageHeader> <columnHeader> <band height="26"> <rectangle> <reportElement mode="Opaque" x="4" y="0" width="522" height="25" forecolor="#000000" backcolor="#000000" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <graphicElement stretchType="NoStretch" pen="None" fill="Solid" /> </rectangle> <staticText> <reportElement mode="Transparent" x="21" y="3" width="99" height="21" forecolor="#FFFFFF" backcolor="#400040" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica-Bold" size="10" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[Account Number]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="143" y="3" width="99" height="21" forecolor="#FFFFFF" backcolor="#400040" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <text><![CDATA[Account Name]]></text> </staticText> </band> </columnHeader> <detail> <band height="21"> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="1" y="0" width="107" height="21" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{accountno}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="109" y="1" width="139" height="20" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica-Bold" size="10" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="5"> </band> </columnFooter> <pageFooter> <band height="7"> </band> </pageFooter> <summary> <band height="50"> </band> </summary> </jasperReport> By: abangkisp - abangkisp RE: looping 2003-01-14 08:11 Wow that works. Sorry for the long posting. need to re-read the tutorials Thanks 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