reportdev
Members-
Posts
413 -
Joined
-
Last visited
Content Type
Profiles
Forum
Events
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Downloads
Everything posted by reportdev
-
Show vertical result and add new column after the middle.
reportdev replied to mfelipe.ayala's topic in Products
use this code and replace your fields <?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:26:12 --> <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" columnCount="2" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="376" columnSpacing="50" 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=""/> <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="RowBanding"> <conditionalStyle> <conditionExpression><![CDATA[$V{REPORT_COUNT}%2==0]]></conditionExpression> <style mode="Opaque" backcolor="#F2F2F2"/> </conditionalStyle> </style> <queryString> <![CDATA[select (trunc(sysdate+1) + level -1) as business_date, extract(year from (trunc(sysdate+1) + level -1)) year from dual connect by sysdate + level -1 < sysdate + 5000]]> </queryString> <field name="BUSINESS_DATE" class="java.sql.Timestamp"/> <field name="YEAR" class="java.math.BigDecimal"/> <columnHeader> <band height="20"> <staticText> <reportElement mode="Opaque" x="180" y="0" width="200" height="20" forecolor="#FFFFFF" backcolor="#FF0400" uuid="dc1f8377-01ea-460d-975c-9a8cf7d3c401"/> <textElement textAlignment="Center"> <font isBold="true"/> </textElement> <text><![CDATA[Price]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="0" y="0" width="180" height="20" forecolor="#FFFFFF" backcolor="#FF0400" uuid="eb0beb3c-cced-47bf-804e-8a7f768f1f0c"/> <textElement textAlignment="Center"> <font isBold="true"/> </textElement> <text><![CDATA[Product]]></text> </staticText> </band> </columnHeader> <detail> <band height="20"> <textField> <reportElement style="RowBanding" x="1" y="0" width="180" height="20" uuid="076918a4-6c44-440b-b20e-9cb79f67212f"/> <textElement textAlignment="Center"/> <textFieldExpression><![CDATA[$F{YEAR}]]></textFieldExpression> </textField> <textField> <reportElement style="RowBanding" x="180" y="0" width="201" height="20" uuid="049aea15-a587-4d2d-a222-ac399f6496d5"/> <textElement textAlignment="Center"/> <textFieldExpression><![CDATA[$F{BUSINESS_DATE}]]></textFieldExpression> </textField> </band> </detail> </jasperReport> -
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)) year from dual connect 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>
- 2 replies
-
- subreports
- crosstab
-
(and 2 more)
Tagged with:
-
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)) year from dual connect 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>
-
How To insert custom pagination beyond page format
reportdev replied to francesco.basenghi_1's topic in Products
Check this jrxml. the page breaks at each year... this is oracle sql. The height is set at 15000 pixels which i believe is totally sufficient for any requirement. <?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:03:08 --> <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="2000" pageHeight="15000" orientation="Landscape" columnWidth="1960" 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=""/> <queryString> <![CDATA[select (trunc(sysdate+1) + level -1) as business_date, extract(year from (trunc(sysdate+1) + level -1)) year from dual connect by sysdate + level -1 < sysdate + 5000]]> </queryString> <field name="BUSINESS_DATE" class="java.sql.Timestamp"/> <field name="YEAR" class="java.math.BigDecimal"/> <group name="YEAR" isStartNewPage="true"> <groupExpression><![CDATA[$F{YEAR}]]></groupExpression> <groupHeader> <band height="30"> <textField> <reportElement mode="Opaque" x="0" y="0" width="100" height="30" backcolor="#FF0400" uuid="59706528-fe71-4ae4-8d62-ed22c89b0b51"/> <textFieldExpression><![CDATA[$F{YEAR}]]></textFieldExpression> </textField> </band> </groupHeader> </group> <background> <band splitType="Stretch"/> </background> <detail> <band height="30"> <textField pattern="MMM dd, yyyy"> <reportElement x="0" y="0" width="392" height="30" uuid="7e28de3c-2a78-4a36-8b56-419c431512de"/> <textFieldExpression><![CDATA[$F{BUSINESS_DATE}]]></textFieldExpression> </textField> </band> </detail> </jasperReport> -
If you have created groups in order to achieve this report, For showing details when the page changes: Select the fields and on the text field properties, check the Print In First Whole Band option.For Showing details when each group changes: Select the fields you want to show when group changes, select your group name in the Group Changes option of Print When.
- 1 reply
-
- japserreport
- Jaspersoft Studio
-
(and 1 more)
Tagged with:
-
the no data band needs to be added to the report. If you want to display custom message for no data : From the Outline, right click on No Data and select Add BandCopy your column header fields and place them in the no data band. Below these fields, place a static field with messageFrom the report properties, change the 'When No Data Type' option to 'No Data Section'
-
this is not possible. when the text overflows the text field size can be increased in the downward direction dynamically. instead put one text field on top of the other text field and play with the print when expressions on both text fields
-
do you want to filter out the report based on year 2015 ? or do you want to populate 2015 in the report ?
-
For excel page breaks you need to add some properties to the elements where you want the break. For example you want the excel page break after a static element then place the below property on the static element. net.sf.jasperreports.export.xls.break.before.row --- this is for page break net.sf.jasperreports.export.xls.sheet.name --- this is for naming the next sheet
-
For excel page breaks you need to add some properties to the elements where you want the break. For example you want the excel page break after a static element then place the below property on the static element. net.sf.jasperreports.export.xls.break.before.row --- this is for page break net.sf.jasperreports.export.xls.sheet.name --- this is for naming the next sheet
-
change that java.util.Collections to java.util.ArrayList. It should work the sameway as Collections.
-
Allowing only one parameter to fill by user out of 2 param
reportdev replied to chaitanya.koli's topic in Products
In the Jasper Studio, parameter options can be found for this option. Parameter Options - > is for Prompting. By default this is switched to True. You can disable it and the parameter will be hidden. -
There could be multiple reasons for this kind of behaviour. The dev environment configuration files might be different from the UAT environment conf filesThe version of the server might be differentCompatibility between the studio and server versioncould you please elaborate on the difference in report design.
-
Create Conditional Style for odd and even pages
reportdev replied to michael.dmitrenko's topic in Products
Check this jrxml. It creates different coloring for even and odd pages. I have used Oracle SQL. You need to create a layered style. <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2016-10-17T11:54:43 --><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="Blank_A4_Landscape_3" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ad85a7eb-9eb3-4ee4-ba7d-82fddd8cf50b"> <property name="com.jaspersoft.studio.data.sql.tables" value="" /> <property name="com.jaspersoft.studio.unit." value="pixel" /> <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" /> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="PRODSUP"/> <style name="Even" style="Odd"> <conditionalStyle> <conditionExpression> <![CDATA[$V{REPORT_COUNT}%2==0]]> </conditionExpression> <style mode="Opaque" backcolor="#FF0400" hTextAlign="Center" vTextAlign="Middle" fontSize="14"/> </conditionalStyle> </style> <style name="Odd"> <conditionalStyle> <conditionExpression> <![CDATA[$V{REPORT_COUNT}%1==0]]> </conditionExpression> <style mode="Opaque" backcolor="#0DFF00" hTextAlign="Center" vTextAlign="Middle" fontSize="14"/> </conditionalStyle> </style> <queryString> <![CDATA[select 1 as Fiscal from dual union select 2 as Fiscal from dual union select 3 as Fiscal from dual union select 4 as Fiscal from dual union select 5 as Fiscal from dual union select 6 as Fiscal from dual union select 7 as Fiscal from dual union select 8 as Fiscal from dual union select 9 as Fiscal from dual union select 10 as Fiscal from dual union select 11 as Fiscal from dual union select 12 as Fiscal from dual union select 13 as Fiscal from dual union select 14 as Fiscal from dual union select 15 as Fiscal from dual union select 16 as Fiscal from dual union select 17 as Fiscal from dual union select 18 as Fiscal from dual union select 19 as Fiscal from dual union select 20 as Fiscal from dual]]> </queryString> <field name="FISCAL" class="java.math.BigDecimal"/> <group name="FISCAL" isStartNewPage="true"> <groupExpression><![CDATA[$F{FISCAL}]]></groupExpression> <groupFooter> <band height="30"> <textField> <reportElement style="Even" x="0" y="0" width="555" height="30" uuid="45e229ab-d071-4454-87c4-9931967827c7"/> <textElement verticalAlignment="Middle"/> <textFieldExpression> <![CDATA[$F{FISCAL}]]> </textFieldExpression> </textField> </band> </groupFooter> </group> <background> <band splitType="Stretch"/> </background></jasperReport>[/code] -
-
Jasper Server supports using multiple databases on a single report. Default Data adapters Create a datasource xml file with username, password and connection stringsPlace your datasource xml file on the Tomcat webapps directory and related jdbc driver in the lib folder.On the Report Dataset properties - default data adapter, reference the datasource xml file on the webapps directory.
-
I'm using JS 6.2 and the tooltip will show up when hovered on the description. There is a 250 character limit on the description.
-
We had the same problem with the WAR installation. The WAR installation explodes with multiple config files and its not an easy thing to find the relevant files which needs to be modified. We had to start from scratch and explode the WAR with the required password and then it worked.
- 4 replies
-
- configuration
- postgresql
-
(and 2 more)
Tagged with:
-
I agree with Hozawa, exporting all the data and importing into a new server would be the easiest way. The WAR file installation is complicated it has many xml files which needs to be configured with the correct tomcat location and port numbers.
-
I believe there should be a way in jasper to move the last text element, but i would prefer to include the text in the sql itself. Try using a union at the bottom of your query with the message that you want to display. The message will be considered as the last text field and will be populated in the last column always.
-
You could just create a simple html page and pass the parameters to the server using REST API. I have used javascript in the below html page. <html> <style>label{display:inline-block;width:200px;margin-right:30px;text-align:right;} input{ } fieldset{border:none;width:800px;margin:0px auto;}</style> <form name="data_entry" action="#"> <fieldset><p><label for="export">Export Options:</label> <select id="exportoptions" name="export" size="1"> <option value=".html">HTML</option> <option value=".pdf">PDF</option> <option value=".xls">XLS</option> </select> </p> <p><label for="Reportunit">Reporting Unit Number: </label><input type="text" id="runumber" name="runumber" size = "20"> <a id="ru" href="" size = "5">Download Report for RU</a></p> <p><label for="fiscal_year">Fiscal Year: </label><input type="text" id="fiscalyear" name="fiscalyear" size = "20"> <a id="fy" href="" size = "5">Download Report for FY</a></p> <p><label for="resetform">Reset Form: </label><input type="button" name="reset_form" value="Reset Form" onclick="this.form.reset();" size = "20"></p> </form> <script type="text/javascript">//<![CDATA[var sel = document.getElementById('runumber');var sel2 = document.getElementById('fiscalyear');var sel3 = document.getElementById('exportoptions'); sel.onchange = function () { document.getElementById("ru").href = "https://localhost:8081/jasperserver/rest_v2/reports/reports/JasperUsers/reporting_units" + sel3.value + "?RUNO=" + this.value;}; sel2.onchange = function () { document.getElementById("fy").href = "https://localhost:8081/jasperserver/rest_v2/reports/reports/JasperUsers/reporting_units" + sel3.value + "?FY=" + this.value;}; </script> </html>
-
It looks like a subreport or related element got deleted on the server and this particular jrxml is not able to access that element anymore. check if all the related elements are in place on the server.
-
How to sum double datatype when the column contains null value
reportdev replied to chakravarthy.9866's topic in Products
Simplest way would be to replace these null values as zero in your SQL with nvl function (if you are using oracle). But this can also be done using Java. First you need to create variables for each month Apr, May, Jun, July, Total. Inside these month variables check if the value is null and replace with Zero.Ex: $F{APR}!=null ? BigDecimal.valueOf($F{APR}) : BigDecimal.ZEROThen Add all these month variables inside the Total variable using .add method Ex: $V{APR}.add($V{MAY}).add($V{JUN}).add($V{JULY}) -
Avoid printing last page footer in new page.
reportdev replied to bhagyashree.manedeshmukh_1's topic in Products
Instead of creating a last page footer, place your total field values in the summary band. Summary band will not create a separate page.