skatariya
-
Posts
14 -
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
Posts posted by skatariya
-
-
-
<?xml version="1.0" encoding="UTF-8"?> <!-- Created with Jaspersoft Studio version 6.0.1.final using JasperReports Library version 6.0.0 --> <!-- 2015-02-18T17:42:21 --> <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="Test_Report" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d0e6ee29-e376-474e-b0b1-e510b1b98d66"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Domain JRS"/> <parameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User" isForPrompting="false"/> <parameter name="LoggedInUsername" class="java.lang.String" isForPrompting="false"/> <queryString language="domain"> <![CDATA[<query> <queryFields> <queryField id="LoC"/> <queryField id="H_Name"/> <queryField id="C_Charge"/> <queryField id="T_Charge"/> </queryFields> </query>]]> </queryString> <field name="LoC" class="java.lang.String"> <fieldDescription><![CDATA[LoC]]></fieldDescription> </field> <field name="H_Name" class="java.lang.String"> <fieldDescription><![CDATA[H_Name]]></fieldDescription> </field> <field name="C_Charge" class="java.math.BigDecimal"> <fieldDescription><![CDATA[C_Charge]]></fieldDescription> </field> <field name="T_Charge" class="java.math.BigDecimal"> <fieldDescription><![CDATA[T_Charge]]></fieldDescription> </field> <variable name="C_Charge" class="java.lang.Float" calculation="Count"> <variableExpression><![CDATA[$F{C_Charge}]]></variableExpression> </variable> <variable name="T_Charge" class="java.lang.Float" calculation="Count"> <variableExpression><![CDATA[$F{T_Charge}]]></variableExpression> </variable> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"> <staticText> <reportElement x="169" y="31" width="141" height="30" uuid="f8e8d350-5e62-4cb1-88f4-4d90c0a26f0f"/> <text><![CDATA[Test_Report]]></text> </staticText> </band> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="61" splitType="Stretch"> <staticText> <reportElement x="10" y="15" width="100" height="30" uuid="3137cb54-5ceb-4610-9694-43e3350ba2ca"/> <text><![CDATA[H_Name]]></text> </staticText> <staticText> <reportElement x="120" y="15" width="100" height="30" uuid="31b82771-b233-420c-8527-4b19539c4541"/> <text><![CDATA[LoC]]></text> </staticText> <staticText> <reportElement x="230" y="20" width="100" height="30" uuid="1bb775a5-0687-4cd3-8866-66c49241fcec"/> <text><![CDATA[C_Charge]]></text> </staticText> <staticText> <reportElement x="340" y="20" width="100" height="30" uuid="daa3b268-25bb-4432-8520-435ccbcb8b85"/> <text><![CDATA[T_Charge]]></text> </staticText> <staticText> <reportElement x="450" y="20" width="100" height="30" uuid="96b292e7-ea61-46e2-ac3d-4a01384d619a"/> <text><![CDATA[Percent]]></text> </staticText> </band> </columnHeader> <detail> <band height="125" splitType="Stretch"> <textField> <reportElement x="10" y="20" width="100" height="30" uuid="f2e609df-32ac-4c90-a4b0-839c96941834"/> <textFieldExpression><![CDATA[$F{H_Name}]]></textFieldExpression> </textField> <textField> <reportElement x="120" y="20" width="100" height="30" uuid="02e3487b-a9c6-4abe-9158-5b1cf01ca886"/> <textFieldExpression><![CDATA[$F{LoC}]]></textFieldExpression> </textField> <textField> <reportElement x="230" y="20" width="100" height="30" uuid="0273b625-0046-482e-b7bd-17d4a4454d49"/> <textFieldExpression><![CDATA[$V{C_Charge}]]></textFieldExpression> </textField> <textField> <reportElement x="340" y="20" width="100" height="30" uuid="c08b805e-8c0d-440a-8e9e-00e9516f9724"/> <textFieldExpression><![CDATA[$V{T_Charge}]]></textFieldExpression> </textField> <textField pattern="#,##0.##%"> <reportElement x="450" y="20" width="100" height="30" uuid="3ae46dc6-e5df-491c-8063-ddf600f0bb92"/> <textFieldExpression><![CDATA[$V{C_Charge}/$V{T_Charge}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="12" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary> </jasperReport>
-
@gert_1
In the code I have 2 strings LoC and H_Name. I am taking aggregate function count for C_Charge and T_Charge.
Last column I want (C_CHarge/T_Charge)%
Final result should be as
for ex- say: for all H_Name with John of LoC type X the percent of utilization is 25%
I want only one entry of all same name with similar type displaying the utilization percentage.
Again in next row same name say kelly with similar type and then percentage and so on.
There are 5 columns wherein first 2 are strings, 3rd and 4th are count and 5th is calculated based on (3rd/4th)%
Please let me know. Its kind of urgent.
-
In the code I have 2 strings LoC and H_Name. I am taking aggregate function count for C_Charge and T_Charge.
Last column I want (C_CHarge/T_Charge)%
Final result should be as
for ex- say: for all H_Name with John of LoC type X the percent of utilization is 25%
I want only one entry of all same name with similar type displaying the utilization percentage.
Again in next row same name say kelly with similar type and then percentage and so on.
There are 5 columns wherein first 2 are strings, 3rd and 4th are count and 5th is calculated based on (3rd/4th)%
Please let me know. Its kind of urgent.
-
Thank you marinol this is the link for the code. Please let me know
http://community.jaspersoft.com/sites/default/files/files/TestReport.txt
-
http://community.jaspersoft.com/sites/default/files/files/TestReport.txt
Thank you gert_1. Please have a look into the code.
If this doesn't work I have posted in the answer below.
-
-
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.0.1.final using JasperReports Library version 6.0.0 -->
<!-- 2015-02-18T17:42:21 -->
<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="Test_Report" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d0e6ee29-e376-474e-b0b1-e510b1b98d66">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Domain JRS"/>
<parameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User" isForPrompting="false"/>
<parameter name="LoggedInUsername" class="java.lang.String" isForPrompting="false"/>
<queryString language="domain">
<![CDATA[<query>
<queryFields>
<queryField id="LoC"/>
<queryField id="H_Name"/>
<queryField id="C_Charge"/>
<queryField id="T_Charge"/>
</queryFields>
</query>]]>
</queryString>
<field name="LoC" class="java.lang.String">
<fieldDescription><![CDATA[LoC]]></fieldDescription>
</field>
<field name="H_Name" class="java.lang.String">
<fieldDescription><![CDATA[H_Name]]></fieldDescription>
</field>
<field name="C_Charge" class="java.math.BigDecimal">
<fieldDescription><![CDATA[C_Charge]]></fieldDescription>
</field>
<field name="T_Charge" class="java.math.BigDecimal">
<fieldDescription><![CDATA[T_Charge]]></fieldDescription>
</field>
<variable name="C_Charge" class="java.lang.Float" calculation="Count">
<variableExpression><![CDATA[$F{C_Charge}]]></variableExpression>
</variable>
<variable name="T_Charge" class="java.lang.Float" calculation="Count">
<variableExpression><![CDATA[$F{T_Charge}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch">
<staticText>
<reportElement x="169" y="31" width="141" height="30" uuid="f8e8d350-5e62-4cb1-88f4-4d90c0a26f0f"/>
<text><![CDATA[Test_Report]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch">
<staticText>
<reportElement x="10" y="15" width="100" height="30" uuid="3137cb54-5ceb-4610-9694-43e3350ba2ca"/>
<text><![CDATA[H_Name]]></text>
</staticText>
<staticText>
<reportElement x="120" y="15" width="100" height="30" uuid="31b82771-b233-420c-8527-4b19539c4541"/>
<text><![CDATA[LoC]]></text>
</staticText>
<staticText>
<reportElement x="230" y="20" width="100" height="30" uuid="1bb775a5-0687-4cd3-8866-66c49241fcec"/>
<text><![CDATA[C_Charge]]></text>
</staticText>
<staticText>
<reportElement x="340" y="20" width="100" height="30" uuid="daa3b268-25bb-4432-8520-435ccbcb8b85"/>
<text><![CDATA[T_Charge]]></text>
</staticText>
<staticText>
<reportElement x="450" y="20" width="100" height="30" uuid="96b292e7-ea61-46e2-ac3d-4a01384d619a"/>
<text><![CDATA[Percent]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<textField>
<reportElement x="10" y="20" width="100" height="30" uuid="f2e609df-32ac-4c90-a4b0-839c96941834"/>
<textFieldExpression><![CDATA[$F{H_Name}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="120" y="20" width="100" height="30" uuid="02e3487b-a9c6-4abe-9158-5b1cf01ca886"/>
<textFieldExpression><![CDATA[$F{LoC}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="230" y="20" width="100" height="30" uuid="0273b625-0046-482e-b7bd-17d4a4454d49"/>
<textFieldExpression><![CDATA[$V{C_Charge}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="340" y="20" width="100" height="30" uuid="c08b805e-8c0d-440a-8e9e-00e9516f9724"/>
<textFieldExpression><![CDATA[$V{T_Charge}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.##%">
<reportElement x="450" y="20" width="100" height="30" uuid="3ae46dc6-e5df-491c-8063-ddf600f0bb92"/>
<textFieldExpression><![CDATA[$V{C_Charge}/$V{T_Charge}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="12" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
-
This not the case with me. I am using domain based adapter and SQL based. I am connecting to the server and then get access to the database and simply drag the fields. So I am not getting any group By option. That's what I am thinking the issue is.
-
Can you please tell me how do I upload the file. I am not getting any option for that. Sorry I am new to the community.
-
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.0.1.final using JasperReports Library version 6.0.0 -->
<!-- 2015-02-18T17:42:21 -->
<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="Test_Report" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d0e6ee29-e376-474e-b0b1-e510b1b98d66">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Domain JRS"/>
<parameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User" isForPrompting="false"/>
<parameter name="LoggedInUsername" class="java.lang.String" isForPrompting="false"/>
<queryString language="domain">
<![CDATA[<query>
<queryFields>
<queryField id="LoC"/>
<queryField id="H_Name"/>
<queryField id="C_Charge"/>
<queryField id="T_Charge"/>
</queryFields>
</query>]]>
</queryString>
<field name="LoC" class="java.lang.String">
<fieldDescription><![CDATA[LoC]]></fieldDescription>
</field>
<field name="H_Name" class="java.lang.String">
<fieldDescription><![CDATA[H_Name]]></fieldDescription>
</field>
<field name="C_Charge" class="java.math.BigDecimal">
<fieldDescription><![CDATA[C_Charge]]></fieldDescription>
</field>
<field name="T_Charge" class="java.math.BigDecimal">
<fieldDescription><![CDATA[T_Charge]]></fieldDescription>
</field>
<variable name="C_Charge" class="java.lang.Float" calculation="Count">
<variableExpression><![CDATA[$F{C_Charge}]]></variableExpression>
</variable>
<variable name="T_Charge" class="java.lang.Float" calculation="Count">
<variableExpression><![CDATA[$F{T_Charge}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch">
<staticText>
<reportElement x="169" y="31" width="141" height="30" uuid="f8e8d350-5e62-4cb1-88f4-4d90c0a26f0f"/>
<text><![CDATA[Test_Report]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch">
<staticText>
<reportElement x="10" y="15" width="100" height="30" uuid="3137cb54-5ceb-4610-9694-43e3350ba2ca"/>
<text><![CDATA[H_Name]]></text>
</staticText>
<staticText>
<reportElement x="120" y="15" width="100" height="30" uuid="31b82771-b233-420c-8527-4b19539c4541"/>
<text><![CDATA[LoC]]></text>
</staticText>
<staticText>
<reportElement x="230" y="20" width="100" height="30" uuid="1bb775a5-0687-4cd3-8866-66c49241fcec"/>
<text><![CDATA[C_Charge]]></text>
</staticText>
<staticText>
<reportElement x="340" y="20" width="100" height="30" uuid="daa3b268-25bb-4432-8520-435ccbcb8b85"/>
<text><![CDATA[T_Charge]]></text>
</staticText>
<staticText>
<reportElement x="450" y="20" width="100" height="30" uuid="96b292e7-ea61-46e2-ac3d-4a01384d619a"/>
<text><![CDATA[Percent]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<textField>
<reportElement x="10" y="20" width="100" height="30" uuid="f2e609df-32ac-4c90-a4b0-839c96941834"/>
<textFieldExpression><![CDATA[$F{H_Name}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="120" y="20" width="100" height="30" uuid="02e3487b-a9c6-4abe-9158-5b1cf01ca886"/>
<textFieldExpression><![CDATA[$F{LoC}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="230" y="20" width="100" height="30" uuid="0273b625-0046-482e-b7bd-17d4a4454d49"/>
<textFieldExpression><![CDATA[$V{C_Charge}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="340" y="20" width="100" height="30" uuid="c08b805e-8c0d-440a-8e9e-00e9516f9724"/>
<textFieldExpression><![CDATA[$V{T_Charge}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.##%">
<reportElement x="450" y="20" width="100" height="30" uuid="3ae46dc6-e5df-491c-8063-ddf600f0bb92"/>
<textFieldExpression><![CDATA[$V{C_Charge}/$V{T_Charge}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="12" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
-
I have tried following things.
$V{REPORT_COUNT}==1 in the Print When Expression
Cheking the BLANK when null
Also putting everything from detail to Summary but then it renders no values.
I will be really glad if someone can help me with this.
This is the link for code http://community.jaspersoft.com/sites/default/files/files/TestReport.txt
-
I am also facing the same problem. I tried using $V{REPORT_COUNT}==1 into the PRINT WHEN Expression. But now my values are not repeated but still the number of pages generating are in thousands. The actual number should be 25. Can anybody help me with this?
How to use colorAxis.DataClasses property of Highcharts in JRXML
in Products
Posted
And then I am setting this property
I have already used color stops but we have specific requirement of dataclasses.
Please let me know how to use them in JRXML
I am using Jaspersoft Studio version 6