Jump to content
We've recently updated our Privacy Statement, available here ×

vu.minh

Members
  • Posts

    2
  • Joined

  • Last visited

vu.minh's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi all, actually im working with iReport 3.7.2 and try to display "page x of y", but page 1 of 16 is only displayed on the first page. All others show null of 16. The structure of report is as followed: title detail band with subreport page footer: page x of y last page footer: page x of y Im using the same mechanism for this scenario as described in official iReport manual. Test sources are included. Many thanks in advance Main 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="page_x_of_y" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.9487171000000014"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <style name="Crosstab Data Text" hAlign="Center"/> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["C:\Users\vu\Documents\projekte\iReport\"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[/* just one row */select orderid from orderswhere orderid = 10248]]> </queryString> <field name="ORDERID" class="java.lang.Integer"/> <variable name="act_pageno" class="java.lang.String" resetType="Page" incrementType="Page"> <variableExpression><![CDATA[$V{PAGE_NUMBER}]]></variableExpression> </variable> <title> <band height="25" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="89" height="19"/> <textElement> <font size="13" isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Test page X of Y with subreport"]]></textFieldExpression> </textField> </band> </title> <detail> <band height="10"> <subreport> <reportElement x="0" y="0" width="555" height="10"/> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "page_x_of_y_subreport.jasper"]]></subreportExpression> </subreport> </band> </detail> <pageFooter> <band height="20"> <textField> <reportElement x="0" y="5" width="89" height="15"/> <textElement> <font size="10" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["page " + $V{act_pageno} + " of " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> </band> </pageFooter> <lastPageFooter> <band height="16"> <textField> <reportElement x="0" y="0" width="89" height="15"/> <textElement> <font size="10" isBold="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["last page " + $V{act_pageno} + " of " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> </band> </lastPageFooter></jasperReport>[/code]Subreport <?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="page_x_of_y_subreport" language="groovy" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="ireport.zoom" value="2.1435888100000016"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <queryString language="SQL"> <![CDATA[select orderid from orders]]> </queryString> <field name="ORDERID" class="java.lang.Integer"/> <detail> <band height="15" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="100" height="15"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA["orderid = " + $F{ORDERID}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  2. I want to place a total column of ireports crosstab at a fixed/user defined position, but can not find any resolution yet (iReport 4.1.3). Is it possible to do this? If no, is there any work around? To test i just use the example described in iReport manual (2013). Every tip is very appriciated. Many thanks in advance. Attached are the source and picture <?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"><property name="ireport.zoom" value="1.771561000000001"/><property name="ireport.x" value="0"/><property name="ireport.y" value="0"/><style name="Crosstab Data Text" hAlign="Center"/><queryString><![CDATA[select * from orders]]></queryString><field name="ORDERID" class="java.lang.Integer"/><field name="CUSTOMERID" class="java.lang.String"/><field name="EMPLOYEEID" class="java.lang.Integer"/><field name="ORDERDATE" class="java.sql.Timestamp"/><field name="REQUIREDDATE" class="java.sql.Timestamp"/><field name="SHIPPEDDATE" class="java.sql.Timestamp"/><field name="SHIPVIA" class="java.lang.Integer"/><field name="FREIGHT" class="java.math.BigDecimal"/><field name="SHIPNAME" class="java.lang.String"/><field name="SHIPADDRESS" class="java.lang.String"/><field name="SHIPCITY" class="java.lang.String"/><field name="SHIPREGION" class="java.lang.String"/><field name="SHIPPOSTALCODE" class="java.lang.String"/><field name="SHIPCOUNTRY" class="java.lang.String"/><summary><band height="49" splitType="Stretch"><crosstab><reportElement x="0" y="30" width="555" height="19"/><rowGroup name="SHIPCITY" width="70" totalPosition="End"><bucket class="java.lang.String"><bucketExpression><![CDATA[$F{SHIPCITY}]]></bucketExpression></bucket><crosstabRowHeader><cellContents backcolor="#F0F8FF" mode="Opaque"><box><pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/></box><textField><reportElement style="Crosstab Data Text" x="0" y="0" width="70" height="25"/><textElement/><textFieldExpression><![CDATA[$V{SHIPCITY}]]></textFieldExpression></textField></cellContents></crosstabRowHeader><crosstabTotalRowHeader><cellContents backcolor="#BFE1FF" mode="Opaque"><box><pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/></box><staticText><reportElement x="0" y="0" width="70" height="25"/><textElement textAlignment="Center" verticalAlignment="Middle"/><text><![CDATA[Total SHIPCITY]]></text></staticText></cellContents></crosstabTotalRowHeader></rowGroup><columnGroup name="SHIPPEDDATE" height="30" totalPosition="End"><bucket class="java.lang.String"><bucketExpression><![CDATA[(new SimpleDateFormat("yyyy")).format($F{SHIPPEDDATE})]]></bucketExpression></bucket><crosstabColumnHeader><cellContents backcolor="#F0F8FF" mode="Opaque"><box><pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/></box><textField><reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="30"/><textElement/><textFieldExpression><![CDATA[$V{SHIPPEDDATE}]]></textFieldExpression></textField></cellContents></crosstabColumnHeader><crosstabTotalColumnHeader><cellContents backcolor="#BFE1FF" mode="Opaque"><box><pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/></box><staticText><reportElement x="0" y="0" width="50" height="30"/><textElement textAlignment="Center" verticalAlignment="Middle"/><text><![CDATA[Total SHIPPEDDATE]]></text></staticText></cellContents></crosstabTotalColumnHeader></columnGroup><measure name="ORDERIDMeasure" class="java.lang.Integer" calculation="Count"><measureExpression><![CDATA[$F{ORDERID}]]></measureExpression></measure><crosstabCell width="50" height="25"><cellContents><box><pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/></box><textField><reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/><textElement/><textFieldExpression><![CDATA[$V{ORDERIDMeasure}]]></textFieldExpression></textField></cellContents></crosstabCell><crosstabCell height="25" rowTotalGroup="SHIPCITY"><cellContents backcolor="#BFE1FF" mode="Opaque"><box><pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/></box><textField><reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/><textElement/><textFieldExpression><![CDATA[$V{ORDERIDMeasure}]]></textFieldExpression></textField></cellContents></crosstabCell><crosstabCell width="50" columnTotalGroup="SHIPPEDDATE"><cellContents backcolor="#BFE1FF" mode="Opaque"><box><pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/></box><textField><reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/><textElement/><textFieldExpression><![CDATA[$V{ORDERIDMeasure}]]></textFieldExpression></textField></cellContents></crosstabCell><crosstabCell rowTotalGroup="SHIPCITY" columnTotalGroup="SHIPPEDDATE"><cellContents backcolor="#BFE1FF" mode="Opaque"><box><pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/></box><textField><reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/><textElement/><textFieldExpression><![CDATA[$V{ORDERIDMeasure}]]></textFieldExpression></textField></cellContents></crosstabCell></crosstab><staticText><reportElement x="0" y="3" width="70" height="20"/><box leftPadding="3"><leftPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/></box><textElement><font size="9"/></textElement><text><![CDATA[City]]></text></staticText><staticText><reportElement x="450" y="3" width="75" height="20"/><box leftPadding="3"><leftPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/></box><textElement><font size="9"/></textElement><text><![CDATA[Total SHIPPED]]></text></staticText><staticText><reportElement x="70" y="3" width="380" height="20"/><box leftPadding="3"><leftPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/></box><textElement><font size="9"/></textElement><text><![CDATA[Dynamic columns...]]></text></staticText></band></summary></jasperReport>
×
×
  • Create New...