Jump to content
We've recently updated our Privacy Statement, available here ×

mauri.alessandroit

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by mauri.alessandroit

  1. yama818, it's close, I'm trying to manage that....i forgot to mention that I'm taking data from a json passed through api...now I'm using a mock: [ { "NomeAnomalia": "MIT Impalcati,Travi,Traversi CA CAP", "GruppiAnomalie": 201, "Total": "6%", "anomalyList": [ { "GruppiAnomalie": 201, "Code": "cacap1", "Name": "Macchie di umidita passiva", "Class": 1, "Severity": "0 - Lieve", "Value": 3.2736806021763885 }, { "GruppiAnomalie": 201, "Code": "cacap12", "Name": "Macchie di umidita passiva", "Class": 1, "Severity": "0 - Lieve", "Value": 1.2736806021763885 }, { "GruppiAnomalie": 201, "Code": "cacap16", "Name": "Macchie di umidita passiva", "Class": 2, "Severity": "2 - Forte", "Value": 0.7736806021763885 }, { "GruppiAnomalie": 201, "Code": "DifGen1", "Name": "Macchie di umidita passiva", "Class": 5, "Severity": "1 - Media", "Value": 1.571812154 }, { "GruppiAnomalie": 201, "Code": "Test Code", "Name": "Test Name", "Class": 5, "Severity": "1 - Media", "Value": -1 }, { "GruppiAnomalie": 201, "Code": "Test Code 2", "Name": "Test Name 2", "Class": 5, "Severity": "2 - Forte", "Value": -1 } ], "pieChartData": [ {"severityName": "Lieve", "severityValue": 25, "severityLabel": "25%"}, {"severityName": "Media", "severityValue": 15, "severityLabel": "15%"}, {"severityName": "Forte", "severityValue": 38, "severityLabel": "38%"} ] }, { "NomeAnomalia": "MIT Pile,Spalle,Fondazioni CLS", "GruppiAnomalie": 202, "Total": "6%", "anomalyList": [ { "GruppiAnomalie": 202, "Code": "cacap1", "Name": "Macchie di umidita passiva", "Class": 2, "Severity": "0 - Lieve", "Value": 3.2736806021763885 }, { "GruppiAnomalie": 202, "Code": "cacap12", "Name": "Macchie di umidita passiva", "Class": 1, "Severity": "0 - Lieve", "Value": 1.2736806021763885 }, { "GruppiAnomalie": 202, "Code": "cacap16", "Name": "Macchie di umidita passiva", "Class": 1, "Severity": "2 - Forte", "Value": 0.7736806021763885 } ], "pieChartData": [ {"severityName": "Lieve", "severityValue": 25, "severityLabel": "5%"}, {"severityName": "Media", "severityValue": 15, "severityLabel": "87%"}, {"severityName": "Forte", "severityValue": 38, "severityLabel": "47%"} ] }][/code]anomalyList is the part of the json passed to the subreport (i passed other values too, like "NomeAnomalia", "GruppiAnomalie" and "Total" through parameters). Every single column should have "Class", "Code", and "Severity" value. Measurements are showed with "Value" field, and I already managed to have a total of each "Value" at the end of the row (second image i posted in the first post). As you noted, total % is already there, and with values of Severity ("0 - Lieve", "1 - Media", "2 - Forte") I already managed to give it a order. Your solution is close but not right...I will try to modify your example and see what I got...if you have time and will, you can start too starting from the json file Thank you again!
  2. I'm using TIBCO Jaspersoft® Studio 6.8.0 and I'm creating a subreport containing a Crosstab. The problem is I'm not sure how to manipulate it to create the view i want. Or if there is another element / mix of elements to create something similar. This is the final result I'd like to have (not the colors, just the structure): As you can see we have a full row text used as title, then a row for "Classe", another full row for "Codice Anomalia" and then the crosstab. So far i created the crosstab part like this Here's the code (it's a subreport, so we have few parameters from the master report): <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.8.0.final using JasperReports Library version 6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b --><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="Prova" pageWidth="595" pageHeight="842" orientation="Landscape" whenNoDataType="NoPages" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryNewPage="true" isSummaryWithPageHeaderAndFooter="true" uuid="1916d28f-c2ed-4735-a541-6dfbd82fe676"> <property name="com.jaspersoft.studio.unit." value="pixel"/> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="reportmockAnomalies_Evolution_sub.xml"/> <style name="DefaultStyle" isDefault="true" fontName="SinaFont" fontSize="8"/> <style name="DefaultTableStyle" style="DefaultStyle"> <box> <pen lineWidth="0.5" lineColor="#888888"/> </box> </style> <style name="DefaultTableHeaderStyle" style="DefaultTableStyle" mode="Opaque" backcolor="#F0F0F0"/> <style name="Table_T" style="DefaultTableStyle"/> <parameter name="NomeAnomalia_P" class="java.lang.String" isForPrompting="false"/> <parameter name="GruppiAnomalie_P" class="java.lang.Integer" isForPrompting="false"/> <parameter name="Total_P" class="java.lang.String" isForPrompting="false"/> <queryString> <![CDATA[]]> </queryString> <field name="Value" class="java.lang.String"/> <field name="Code" class="java.lang.String"/> <field name="Severity" class="java.lang.String"/> <field name="Class" class="java.lang.Integer"/> <variable name="VI" class="java.lang.Float"> <variableExpression><![CDATA[Float.parseFloat($F{Value})]]></variableExpression> </variable> <variable name="NomeAnomalia" class="java.lang.String"> <variableExpression><![CDATA[$P{NomeAnomalia_P}]]></variableExpression> </variable> <variable name="GruppiAnomalie" class="java.lang.Integer"> <variableExpression><![CDATA[$P{GruppiAnomalie_P}]]></variableExpression> </variable> <variable name="Total" class="java.lang.String"> <variableExpression><![CDATA[$P{Total_P}]]></variableExpression> </variable> <group name="Group1"> <groupExpression><![CDATA[$V{GruppiAnomalie}]]></groupExpression> <groupFooter> <band height="362"> <crosstab> <reportElement x="10" y="100" width="520" height="130" uuid="ac2fc6d0-7f1c-4d18-885e-4eac7a3e1606"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/> <property name="com.jaspersoft.studio.crosstab.style.header" value="Crosstab_CH"/> <property name="com.jaspersoft.studio.crosstab.style.group" value="Crosstab_CG"/> <property name="com.jaspersoft.studio.crosstab.style.total" value="Crosstab_CT"/> <property name="com.jaspersoft.studio.crosstab.style.detail" value="Crosstab_CD"/> </reportElement> <crosstabParameter name="NomeAnomalia_CT"> <parameterValueExpression><![CDATA[$V{NomeAnomalia}]]></parameterValueExpression> </crosstabParameter> <rowGroup name="Severity" width="60" totalPosition="End"> <bucket class="java.lang.String"> <bucketExpression><![CDATA[$F{Severity}]]></bucketExpression> </bucket> <crosstabRowHeader> <cellContents mode="Opaque" style="Crosstab_CH"> <textField> <reportElement x="0" y="0" width="60" height="20" uuid="2a96a380-5476-4519-9668-d8b74e3c3dce"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$V{Severity}.substring(4)]]></textFieldExpression> </textField> </cellContents> </crosstabRowHeader> <crosstabTotalRowHeader> <cellContents mode="Opaque" style="Crosstab_CT"/> </crosstabTotalRowHeader> </rowGroup> <columnGroup name="Code" height="20" totalPosition="End"> <bucket class="java.lang.String"> <bucketExpression><![CDATA[$F{Code}]]></bucketExpression> </bucket> <crosstabColumnHeader> <cellContents mode="Opaque" style="Crosstab_CH"> <textField> <reportElement x="0" y="0" width="60" height="20" uuid="6b72c99c-2807-4ecd-9229-60501eef76a8"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$V{Code}]]></textFieldExpression> </textField> </cellContents> </crosstabColumnHeader> <crosstabTotalColumnHeader> <cellContents mode="Opaque" style="Crosstab_CT"> <staticText> <reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="ff63be8e-5eb2-4c34-b7d8-5c468d2bde9c"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <text><![CDATA[%]]></text> </staticText> </cellContents> </crosstabTotalColumnHeader> </columnGroup> <measure name="Value_MEASURE1" class="java.lang.Float" calculation="Sum"> <measureExpression><![CDATA[$V{VI}]]></measureExpression> </measure> <measure name="NA" class="java.lang.String"> <measureExpression><![CDATA["n/a"]]></measureExpression> </measure> <measure name="totalCount" class="java.lang.Float" calculation="Sum"> <measureExpression><![CDATA[$V{VI} == -1 ? 0 : $V{VI}]]></measureExpression> </measure> <crosstabCell width="60" height="20"> <cellContents mode="Opaque" style="Crosstab_CD"> <textField> <reportElement x="0" y="0" width="60" height="20" uuid="2f6aa90e-73f8-4f5f-8fdf-47ea4df80674"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$V{Value_MEASURE1} == -1 ? $V{NA} : $V{Value_MEASURE1}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="60" height="20" columnTotalGroup="Code"> <cellContents mode="Opaque" style="Crosstab_CT"> <textField> <reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="2b009b35-e77c-4cba-857e-84ba4ea6bfc6"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression><![CDATA[$V{totalCount}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="60" height="20" rowTotalGroup="Severity"> <cellContents mode="Opaque" style="Crosstab_CT"/> </crosstabCell> <crosstabCell width="60" height="20" rowTotalGroup="Severity" columnTotalGroup="Code"> <cellContents mode="Opaque" style="Crosstab_CT"/> </crosstabCell> </crosstab> </band> </groupFooter> </group></jasperReport>[/code]What I'd like is to add the 3 upper rows like I explained above, is this possible? I'm open to alternatives too regarding other elements or mixing different elements, as long as the result is similar to the first photo. Thank you in advance! Edit following the answer of yama818 yama818, it's close, I'm trying to manage that....i forgot to mention that I'm taking data from a json passed through api...now I'm using a mock: [ { "NomeAnomalia": "MIT Impalcati,Travi,Traversi CA CAP", "GruppiAnomalie": 201, "Total": "6%", "anomalyList": [ { "GruppiAnomalie": 201, "Code": "cacap1", "Name": "Macchie di umidita passiva", "Class": 1, "Severity": "0 - Lieve", "Value": 3.2736806021763885 }, { "GruppiAnomalie": 201, "Code": "cacap12", "Name": "Macchie di umidita passiva", "Class": 1, "Severity": "0 - Lieve", "Value": 1.2736806021763885 }, { "GruppiAnomalie": 201, "Code": "cacap16", "Name": "Macchie di umidita passiva", "Class": 2, "Severity": "2 - Forte", "Value": 0.7736806021763885 }, { "GruppiAnomalie": 201, "Code": "DifGen1", "Name": "Macchie di umidita passiva", "Class": 5, "Severity": "1 - Media", "Value": 1.571812154 }, { "GruppiAnomalie": 201, "Code": "Test Code", "Name": "Test Name", "Class": 5, "Severity": "1 - Media", "Value": -1 }, { "GruppiAnomalie": 201, "Code": "Test Code 2", "Name": "Test Name 2", "Class": 5, "Severity": "2 - Forte", "Value": -1 } ], "pieChartData": [ {"severityName": "Lieve", "severityValue": 25, "severityLabel": "25%"}, {"severityName": "Media", "severityValue": 15, "severityLabel": "15%"}, {"severityName": "Forte", "severityValue": 38, "severityLabel": "38%"} ] }, { "NomeAnomalia": "MIT Pile,Spalle,Fondazioni CLS", "GruppiAnomalie": 202, "Total": "6%", "anomalyList": [ { "GruppiAnomalie": 202, "Code": "cacap1", "Name": "Macchie di umidita passiva", "Class": 2, "Severity": "0 - Lieve", "Value": 3.2736806021763885 }, { "GruppiAnomalie": 202, "Code": "cacap12", "Name": "Macchie di umidita passiva", "Class": 1, "Severity": "0 - Lieve", "Value": 1.2736806021763885 }, { "GruppiAnomalie": 202, "Code": "cacap16", "Name": "Macchie di umidita passiva", "Class": 1, "Severity": "2 - Forte", "Value": 0.7736806021763885 } ], "pieChartData": [ {"severityName": "Lieve", "severityValue": 25, "severityLabel": "5%"}, {"severityName": "Media", "severityValue": 15, "severityLabel": "87%"}, {"severityName": "Forte", "severityValue": 38, "severityLabel": "47%"} ] }] anomalyList is the part of the json passed to the subreport (i passed other values too, like "NomeAnomalia", "GruppiAnomalie" and "Total" through parameters). Every single column should have "Class", "Code", and "Severity" value. Measurements are showed with "Value" field, and I already managed to have a total of each "Value" at the end of the row (second image i posted in the first post). As you noted, total % is already there, and with values of Severity ("0 - Lieve", "1 - Media", "2 - Forte") I already managed to give it a order. If anyone has got a solution... Thank you again!
×
×
  • Create New...