jasper reports - How to align total fields in column footer? -


i have created report in jasper ireport. alignment of fields in not appropriate want.

i have added date , sms count in detail band , total sms count in column band. when have total sms count in detail band iterate , show multiple time.

sms count report image:

sms count report image

xml 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="smscount" 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="0"/> <parameter name="subreport_dir" class="java.lang.string" isforprompting="false">     <defaultvalueexpression><![cdata["c:\\users\\nic\\desktop\\report\\"]]></defaultvalueexpression> </parameter> <parameter name="fromdate" class="java.util.date"/> <parameter name="todate" class="java.util.date"/> <querystring>     <![cdata[select (select sum(sent_count) immigration.overstay_sent_sms_count  sent_date between $p{fromdate} , $p{todate}) totalcount,to_char(sent_date,'dd-mm-yyyy') sent_date,sent_count immigration.overstay_sent_sms_count sent_date between $p{fromdate} , $p{todate}]]> </querystring> <field name="totalcount" class="java.math.bigdecimal"/> <field name="sent_date" class="java.lang.string"/> <field name="sent_count" class="java.math.bigdecimal"/> <background>     <band splittype="stretch"/> </background> <title>     <band height="83" splittype="stretch">         <statictext>             <reportelement x="122" y="21" width="420" height="48" forecolor="#ff9999"/>             <textelement>                 <font size="30"/>             </textelement>             <text><![cdata[national informatic center]]></text>         </statictext>     </band> </title> <pageheader>     <band height="35" splittype="stretch">         <statictext>             <reportelement x="234" y="0" width="139" height="24"/>             <textelement>                 <font size="14" isunderline="true"/>             </textelement>             <text><![cdata[sms count reports]]></text>         </statictext>     </band> </pageheader> <columnheader>     <band height="28" splittype="stretch">         <statictext>             <reportelement mode="transparent" x="61" y="0" width="100" height="20" backcolor="#cccccc"/>             <textelement textalignment="center">                 <font size="12"/>             </textelement>             <text><![cdata[date]]></text>         </statictext>         <statictext>             <reportelement x="404" y="0" width="100" height="20" backcolor="#cccccc"/>             <textelement textalignment="center">                 <font size="12"/>             </textelement>             <text><![cdata[sms count]]></text>         </statictext>     </band> </columnheader> <detail>     <band height="35" splittype="stretch">         <textfield>             <reportelement x="61" y="9" width="100" height="20" backcolor="#ffffff"/>             <textelement textalignment="center"/>             <textfieldexpression><![cdata[$f{sent_date}]]></textfieldexpression>         </textfield>         <textfield>             <reportelement x="404" y="9" width="100" height="20"/>             <textelement textalignment="center"/>             <textfieldexpression><![cdata[$f{sent_count}]]></textfieldexpression>         </textfield>     </band> </detail> <columnfooter>     <band height="35">         <textfield>             <reportelement x="404" y="0" width="100" height="20"/>             <textelement textalignment="center"/>             <textfieldexpression><![cdata[$f{totalcount}]]></textfieldexpression>         </textfield>         <statictext>             <reportelement x="291" y="0" width="113" height="20"/>             <textelement>                 <font isitalic="true"/>             </textelement>             <text><![cdata[     total sms count=]]></text>         </statictext>     </band> </columnfooter> 

activate "float column footer" in report properties.

ireport screenshot


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -