jovan688 Posted November 30, 2016 Share Posted November 30, 2016 I Have around 12 columns but all of them do not fit them in the page , so I would like present the first six columns in one page and send the other columns to another page and that way maybe create a report with 2 pages.I 've tried to use a column break but It seems that doesn't work ... at least the make a page break .If anybody had done something like that ... I would like to explain to me , please .thx .Maybe with the drawing you all understandme ... Link to comment Share on other sites More sharing options...
reportdev Posted December 2, 2016 Share Posted December 2, 2016 Try using Crosstabs. Attached is the sample jrxml with my data. this is oracle sql. <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2016-12-02T14:13:49 --><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="sss" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d636513c-6fad-4279-973d-754c6d542965"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value=""/> <property name="com.jaspersoft.studio.unit." value="pixel"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/> <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/> <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/> <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/> <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/> <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/> <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/> <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/> <style name="Crosstab_CH" mode="Opaque" backcolor="#F0F8FF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> <topPen lineWidth="0.5" lineColor="#000000"/> <leftPen lineWidth="0.5" lineColor="#000000"/> <bottomPen lineWidth="0.5" lineColor="#000000"/> <rightPen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="Crosstab_CG" mode="Opaque" backcolor="#BFE1FF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> <topPen lineWidth="0.5" lineColor="#000000"/> <leftPen lineWidth="0.5" lineColor="#000000"/> <bottomPen lineWidth="0.5" lineColor="#000000"/> <rightPen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="Crosstab_CT" mode="Opaque" backcolor="#005FB3"> <box> <pen lineWidth="0.5" lineColor="#000000"/> <topPen lineWidth="0.5" lineColor="#000000"/> <leftPen lineWidth="0.5" lineColor="#000000"/> <bottomPen lineWidth="0.5" lineColor="#000000"/> <rightPen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="Crosstab_CD" mode="Opaque" backcolor="#FFFFFF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> <topPen lineWidth="0.5" lineColor="#000000"/> <leftPen lineWidth="0.5" lineColor="#000000"/> <bottomPen lineWidth="0.5" lineColor="#000000"/> <rightPen lineWidth="0.5" lineColor="#000000"/> </box> </style> <queryString> <![CDATA[select (trunc(sysdate+1) + level -1) as business_date, extract(year from (trunc(sysdate+1) + level -1)) yearfrom dualconnect by sysdate + level -1 < sysdate + 5000]]> </queryString> <field name="BUSINESS_DATE" class="java.sql.Timestamp"/> <field name="YEAR" class="java.math.BigDecimal"/> <background> <band splitType="Stretch"/> </background> <summary> <band height="59"> <crosstab> <reportElement x="0" y="0" width="800" height="59" uuid="f3e8c67c-fa93-464c-85f0-346d357607b6"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/> </reportElement> <rowGroup name="YEAR1" width="60" totalPosition="End"> <bucket class="java.math.BigDecimal"> <bucketExpression><![CDATA[$F{YEAR}]]></bucketExpression> </bucket> <crosstabRowHeader> <cellContents mode="Opaque" style="Crosstab_CH"> <textField> <reportElement x="0" y="0" width="60" height="20" uuid="94facf16-e67d-4cc9-94fe-a746932bd878"/> <textFieldExpression><![CDATA[$V{YEAR1}]]></textFieldExpression> </textField> </cellContents> </crosstabRowHeader> <crosstabTotalRowHeader> <cellContents mode="Opaque" style="Crosstab_CT"> <staticText> <reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="315f219e-4d34-4086-a3a2-98d32bb69c3d"/> <text><![CDATA[Total YEAR1]]></text> </staticText> </cellContents> </crosstabTotalRowHeader> </rowGroup> <columnGroup name="BUSINESS_DATE1" height="20" totalPosition="End"> <bucket class="java.lang.String"> <bucketExpression><![CDATA[new SimpleDateFormat("yyyy-MM").format($F{BUSINESS_DATE})]]></bucketExpression> </bucket> <crosstabColumnHeader> <cellContents mode="Opaque" style="Crosstab_CH"> <textField> <reportElement x="0" y="0" width="60" height="20" uuid="8d1ff01b-fd2c-48c2-b36a-1d6134dcfffa"/> <textFieldExpression><![CDATA[$V{BUSINESS_DATE1}]]></textFieldExpression> </textField> </cellContents> </crosstabColumnHeader> <crosstabTotalColumnHeader> <cellContents mode="Opaque" style="Crosstab_CT"> <staticText> <reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="e902d3a9-9e6c-4bbc-bbd5-cc02da7ab52f"/> <text><![CDATA[Total BUSINESS_DATE1]]></text> </staticText> </cellContents> </crosstabTotalColumnHeader> </columnGroup> <measure name="BUSINESS_DATE_MEASURE1" class="java.lang.Integer" calculation="Count"> <measureExpression><![CDATA[$F{BUSINESS_DATE}]]></measureExpression> </measure> <crosstabCell width="60" height="20"> <cellContents mode="Opaque" style="Crosstab_CD"> <textField> <reportElement x="0" y="0" width="60" height="20" uuid="e77e54cf-41a6-417d-8328-efd3755eb82a"/> <textFieldExpression><![CDATA[$V{BUSINESS_DATE_MEASURE1}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="60" height="20" columnTotalGroup="BUSINESS_DATE1"> <cellContents mode="Opaque" style="Crosstab_CT"> <textField> <reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="0139e2de-0bfd-48f7-a048-c47a3474e25f"/> <textFieldExpression><![CDATA[$V{BUSINESS_DATE_MEASURE1}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="60" height="20" rowTotalGroup="YEAR1"> <cellContents mode="Opaque" style="Crosstab_CT"> <textField> <reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="e2302ae7-bad4-4c06-9f75-80065d141f6e"/> <textFieldExpression><![CDATA[$V{BUSINESS_DATE_MEASURE1}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="60" height="20" rowTotalGroup="YEAR1" columnTotalGroup="BUSINESS_DATE1"> <cellContents mode="Opaque" style="Crosstab_CT"> <textField> <reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="560cc2c0-d77a-4cde-8033-96f6eccbc8db"/> <textFieldExpression><![CDATA[$V{BUSINESS_DATE_MEASURE1}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> </crosstab> </band> </summary></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