swapnilppawar76 Posted June 16, 2015 Posted June 16, 2015 Hello Guys , I am new in jasper report ,currently i have an task to print the repeated value only once in table . that i did using by checking " Print repeated value" but it show the blank cell . I want to remove it also and print the hole row up to the value gets change. please help me its very urgent...please brief it as i am new in jasper report.
swapnilppawar76 Posted June 16, 2015 Author Posted June 16, 2015 please here is my 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="Demotable" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="fc8d9908-8849-47e4-96fd-c1052fd63a08"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <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="Table Dataset 1" uuid="4d04fade-64a1-4418-9c7f-2db1eb1d16a6"> <parameter name="scan_no" class="java.lang.Integer" isForPrompting="false"/> <parameter name="user_name" class="java.lang.String" isForPrompting="false"/> <queryString> <![CDATA[select vname,vurl from D34TAILR3P0RT where scan_no=$P{scan_no} and user_name=$P{user_name}]]> </queryString> <field name="VNAME" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="VURL" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <filterExpression><![CDATA[$F{VNAME}!=null]]></filterExpression> </subDataset> <parameter name="scan_no" class="java.lang.Integer"/> <parameter name="user_name" class="java.lang.String"/> <queryString> <![CDATA[select vname,vurl from D34TAILR3P0RT where scan_no=$P{scan_no} and user_name=$P{user_name}]]> </queryString> <field name="VNAME" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="VURL" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <group name="vcount"> <groupExpression><![CDATA[$F{VNAME}]]></groupExpression> </group> <group name="VNAME"> <groupExpression><![CDATA[$F{VNAME}]]></groupExpression> </group> <group name="check"> <groupExpression><![CDATA[$F{VNAME}.equals( "1" )]]></groupExpression> </group> <group name="kp"> <groupExpression><![CDATA[$F{VNAME}]]></groupExpression> </group> <group name="column1"> <groupExpression><![CDATA[$F{VNAME}]]></groupExpression> </group> <background> <band splitType="Stretch"/> </background> <pageHeader> <band height="35" splitType="Stretch"> <staticText> <reportElement x="234" y="4" width="100" height="20" forecolor="#FF00FF" uuid="a6c8ba50-5010-436b-8f87-fa64ee0354c7"/> <textElement> <font size="14" isBold="true" isItalic="true"/> </textElement> <text><![CDATA[Demo Praject]]></text> </staticText> </band> </pageHeader> <detail> <band height="158"> <printWhenExpression><![CDATA[$V{REPORT_COUNT}==1]]></printWhenExpression> <componentElement> <reportElement key="table 1" style="table 1_TD" positionType="Float" stretchType="RelativeToTallestObject" mode="Transparent" x="120" y="32" width="360" height="89" isPrintWhenDetailOverflows="true" uuid="039391c0-59f6-45a2-80d5-ad3ab29a4f4f"/> <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="Table Dataset 1" uuid="eb9830a3-2df8-4322-b6f0-3ed534c72fea"> <datasetParameter name="scan_no"> <datasetParameterExpression><![CDATA[$P{scan_no}]]></datasetParameterExpression> </datasetParameter> <datasetParameter name="user_name"> <datasetParameterExpression><![CDATA[$P{user_name}]]></datasetParameterExpression> </datasetParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> </datasetRun> <jr:column width="90" uuid="2db11c41-48f7-4a05-b58d-bccf619409b8"> <jr:columnHeader style="table 1_CH" height="60" rowSpan="1"> <staticText> <reportElement x="0" y="0" width="90" height="30" uuid="22b6db66-bafc-4f07-9d05-a95d64091a07"/> <text><![CDATA[VNAME]]></text> </staticText> </jr:columnHeader> <jr:detailCell style="table 1_TD" height="40" rowSpan="1"> <textField isStretchWithOverflow="true" pattern=""> <reportElement style="table 1" positionType="Float" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="0" y="0" width="90" height="40" isPrintWhenDetailOverflows="true" forecolor="#CC0000" uuid="0f3e8a62-1446-4c7d-861f-f399c0a80b66"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{VNAME}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="268" uuid="fac4df48-8d3c-4d64-84f2-869d083edf05"> <jr:columnHeader style="table 1_CH" height="60" rowSpan="1"> <staticText> <reportElement x="0" y="0" width="268" height="30" uuid="f4a1e7a0-3d8a-4c6d-9263-26b79d01c04f"/> <text><![CDATA[VURL]]></text> </staticText> </jr:columnHeader> <jr:detailCell style="table 1_TD" height="40" rowSpan="1"> <textField> <reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="0" width="268" height="20" uuid="8e807bc5-1438-4302-a2be-53e725bd7677"/> <textFieldExpression><![CDATA[$F{VURL}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> </jr:table> </componentElement> </band> </detail></jasperReport>
swapnilppawar76 Posted June 16, 2015 Author Posted June 16, 2015 here is my code can you solve this and revert to me<?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="Demotable" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="fc8d9908-8849-47e4-96fd-c1052fd63a08"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <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="Table Dataset 1" uuid="4d04fade-64a1-4418-9c7f-2db1eb1d16a6"> <parameter name="scan_no" class="java.lang.Integer" isForPrompting="false"/> <parameter name="user_name" class="java.lang.String" isForPrompting="false"/> <queryString> <![CDATA[select vname,vurl from D34TAILR3P0RT where scan_no=$P{scan_no} and user_name=$P{user_name}]]> </queryString> <field name="VNAME" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="VURL" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <filterExpression><![CDATA[$F{VNAME}!=null]]></filterExpression> </subDataset> <parameter name="scan_no" class="java.lang.Integer"/> <parameter name="user_name" class="java.lang.String"/> <queryString> <![CDATA[select vname,vurl from D34TAILR3P0RT where scan_no=$P{scan_no} and user_name=$P{user_name}]]> </queryString> <field name="VNAME" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="VURL" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <group name="vcount"> <groupExpression><![CDATA[$F{VNAME}]]></groupExpression> </group> <group name="VNAME"> <groupExpression><![CDATA[$F{VNAME}]]></groupExpression> </group> <group name="check"> <groupExpression><![CDATA[$F{VNAME}.equals( "1" )]]></groupExpression> </group> <group name="kp"> <groupExpression><![CDATA[$F{VNAME}]]></groupExpression> </group> <group name="column1"> <groupExpression><![CDATA[$F{VNAME}]]></groupExpression> </group> <background> <band splitType="Stretch"/> </background> <pageHeader> <band height="35" splitType="Stretch"> <staticText> <reportElement x="234" y="4" width="100" height="20" forecolor="#FF00FF" uuid="a6c8ba50-5010-436b-8f87-fa64ee0354c7"/> <textElement> <font size="14" isBold="true" isItalic="true"/> </textElement> <text><![CDATA[Demo Praject]]></text> </staticText> </band> </pageHeader> <detail> <band height="158"> <printWhenExpression><![CDATA[$V{REPORT_COUNT}==1]]></printWhenExpression> <componentElement> <reportElement key="table 1" style="table 1_TD" positionType="Float" stretchType="RelativeToTallestObject" mode="Transparent" x="120" y="32" width="360" height="89" isPrintWhenDetailOverflows="true" uuid="039391c0-59f6-45a2-80d5-ad3ab29a4f4f"/> <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="Table Dataset 1" uuid="eb9830a3-2df8-4322-b6f0-3ed534c72fea"> <datasetParameter name="scan_no"> <datasetParameterExpression><![CDATA[$P{scan_no}]]></datasetParameterExpression> </datasetParameter> <datasetParameter name="user_name"> <datasetParameterExpression><![CDATA[$P{user_name}]]></datasetParameterExpression> </datasetParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> </datasetRun> <jr:column width="90" uuid="2db11c41-48f7-4a05-b58d-bccf619409b8"> <jr:columnHeader style="table 1_CH" height="60" rowSpan="1"> <staticText> <reportElement x="0" y="0" width="90" height="30" uuid="22b6db66-bafc-4f07-9d05-a95d64091a07"/> <text><![CDATA[VNAME]]></text> </staticText> </jr:columnHeader> <jr:detailCell style="table 1_TD" height="40" rowSpan="1"> <textField isStretchWithOverflow="true" pattern=""> <reportElement style="table 1" positionType="Float" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="0" y="0" width="90" height="40" isPrintWhenDetailOverflows="true" forecolor="#CC0000" uuid="0f3e8a62-1446-4c7d-861f-f399c0a80b66"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{VNAME}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="268" uuid="fac4df48-8d3c-4d64-84f2-869d083edf05"> <jr:columnHeader style="table 1_CH" height="60" rowSpan="1"> <staticText> <reportElement x="0" y="0" width="268" height="30" uuid="f4a1e7a0-3d8a-4c6d-9263-26b79d01c04f"/> <text><![CDATA[VURL]]></text> </staticText> </jr:columnHeader> <jr:detailCell style="table 1_TD" height="40" rowSpan="1"> <textField> <reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="0" width="268" height="20" uuid="8e807bc5-1438-4302-a2be-53e725bd7677"/> <textFieldExpression><![CDATA[$F{VURL}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> </jr:table> </componentElement> </band> </detail></jasperReport>
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