nord_tramper Posted November 29, 2016 Share Posted November 29, 2016 Hello!I have two subreports in main report located in details sections on tthe one line. Left subreport contain Crosstab which can be quite wide. The question is how to place second subreport at the right from first subreport and subreports should not overlap. Link to comment Share on other sites More sharing options...
reportdev Posted December 2, 2016 Share Posted December 2, 2016 Limit each of the report by using a frame.jrxml with frame : <?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:21:39 --><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="PRODSUP"/> <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="#FF002A"> <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="287"> <frame> <reportElement x="-1" y="0" width="381" height="275" uuid="452f167f-3f8f-4a6e-92c9-4f8ba8fc1a6b"/> <crosstab> <reportElement x="0" y="0" width="381" 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> </frame> <frame> <reportElement x="410" y="0" width="381" height="275" uuid="3fdc06c9-ce6e-4bf1-9088-d3bfc24ae7a1"/> <crosstab> <reportElement x="0" y="0" width="381" height="59" uuid="21bca7bf-60d3-44e5-b4a2-e29a5a921c93"> <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="59ef0ea3-4b6e-4570-89d8-342e1367f0ef"/> <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" backcolor="#FF0400" uuid="21b55848-6685-4ffc-8486-c2004f51dd07"/> <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="6c11d9a3-e4cc-4b7d-bc24-8cf121b7f419"/> <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" backcolor="#FF0400" uuid="ac6b18b3-dea1-4213-96f4-40a49c0d1c22"/> <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="8e51cecb-03c4-4ce3-9578-1a2c1473be53"/> <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" backcolor="#FF0400" uuid="1d0d4a59-a7d6-43f8-8e8c-9e9bc522b429"/> <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" backcolor="#FF0400" uuid="2c4c4f78-ddeb-4639-9235-9a34713b79af"/> <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" backcolor="#FF0400" uuid="c9b16b9d-ff90-4a68-aeb4-44d5d3deb4c7"/> <textFieldExpression><![CDATA[$V{BUSINESS_DATE_MEASURE1}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> </crosstab> </frame> </band> </summary></jasperReport> Link to comment Share on other sites More sharing options...
nord_tramper Posted December 6, 2016 Author Share Posted December 6, 2016 Hello!It is working in this layout. But I need left Crosstab with Ignore Width = true to get it in one line. May you know how to implement this case? 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