santosh.audi19 Posted February 2, 2016 Share Posted February 2, 2016 Hi Every one , Suppose I have a Query ` Select name from inv_investments ` , Usually when we Drop the Name field into Detail and we run the report in Single Page we might get 20 Investments namesNow i want to print One Name of investment in One Page.How can I achieve this.Thanks. Link to comment Share on other sites More sharing options...
Solution kotapati.krishna Posted February 2, 2016 Solution Share Posted February 2, 2016 Santhosh,Add Report Group and than click on Start on new page . Example :<?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="reportCharts" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="280bc2bd-2f2c-49d3-8486-7883e25f53e4"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <subDataset name="New Datase" uuid="0f112c92-c4d3-43bb-9634-8d7e301002ee"> <queryString> <![CDATA[sELECT NAME,count(*) FROM TYPE GROUP BY type.name]]> </queryString> <field name="name" class="java.lang.String"/> <field name="count" class="java.lang.Long"/> <group name="name"> <groupExpression><![CDATA[$F{name}]]></groupExpression> </group> <group name="count"> <groupExpression><![CDATA[$F{count}]]></groupExpression> </group> </subDataset> <queryString> <![CDATA[sELECT NAME,value FROM TYPE]]> </queryString> <field name="name" class="java.lang.String"/> <field name="value" class="java.lang.String"/> <group name="newPage" isStartNewPage="true"> <groupExpression><![CDATA[$F{name}]]></groupExpression> <groupFooter> <band height="20"> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement x="129" y="0" width="100" height="20" uuid="bd7343be-9e94-4984-a7cf-206d937aa3bb"/> <textFieldExpression><![CDATA[$F{value}]]></textFieldExpression> </textField> <textField> <reportElement x="29" y="0" width="100" height="20" uuid="7b2cef47-3606-40b1-b7a6-fe584e5ab47e"/> <textFieldExpression><![CDATA[$F{name}]]></textFieldExpression> </textField> </band> </groupFooter> </group> <columnHeader> <band height="22" splitType="Stretch"> <staticText> <reportElement x="29" y="2" width="100" height="20" uuid="b750ab81-dde8-4be2-8c72-ba988e58af62"/> <text><![CDATA[name]]></text> </staticText> <staticText> <reportElement x="129" y="2" width="100" height="20" uuid="a5721f23-ab24-4dd7-a8ce-3c9d766c3ac3"/> <text><![CDATA[value]]></text> </staticText> </band> </columnHeader> <detail> <band height="1" splitType="Stretch"/> </detail></jasperReport> 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