Planet Jaspersoft

Filter by tags:

April 17, 2018

Hi folks,

Did you ever had a need of displaying column chart without having category from database ?
Did you ever want to have 4 fields of query output to be plotted as bars ?

Here we go.!
Let's say the query output format to be plotted as bars as follows

Query:
SELECT 100 AS Measure1, 200 AS Measure2, 300 AS Measure3, 400 AS Measure4 FROM customer limit 1

Output:
Measure1   Measure2   Measure3   Measure4
100               200              300              400


Usually, in jasper column graphs to get bars we write query in such a way that the output should come as below

field1      field2
category 100
category 200
category 300
category 400
and it gets the same color (by default blue incase of highcharts bars) as it has category field. 

Incase of only measures, we add them as individual measures in the chart Measures section as shown in below image. 

and when we preview the graph it would get different colors for each of the bar as the graph would plotted based on series although we don't have any series or for empty series.

In this cases, if we want to apply conditional colors on Measures, it can be done in the Advanced properties of each of the measures.

for instance, to apply conditional color on Measure1,
1) Double click on Measure1
2) In the popped up window select "Advanced properties".
3) Click on "Add" button
4) Select "SeriesItemProperty" in the dropdown of "Contributer".
5)  Give "color" as name in "Property Name"
6) Now, observe there are 4 ways like "Use constant Value", "Use bucket value", "Use Measure Value" and "Use Expression".
  As we don't have to deal with categories, we ignore "Use Bucket Value" property section. In usual cases of conditional colors we work with it. And the constant value and Use Measure is not the scope. Ultimately we need to use "Use Expression" property. Let's click on it to open it's expression editor and write below code of "Measure1"

($F{measure1}>=00  && $F{measure1} <=100 )? "red": ($F{measure1}>=101 &&  $F{measure1} <=200 ) ? "yellow":($F{measure1}>=201 &&  $F{measure1} <=300 ) ?"green":"blue"

Repeat the same steps of rest of the measures i.e., for Measure2, Measure3, Measure4. 

Based on the values range we provide different colors as shown in above image. In this case, I used 4 columns to plot and whenever the values meets the range provided each of the bar display either "red", "yellow", "green" or "blue". 

Note that in the sample output below I made the query to get 4 different colors for 4 bars but if you have the same value for any other measures it would get the same color. (look at case2 or case3 sample outputs below)

Sample output: case 1
SELECT 100 AS Measure1, 200 AS Measure2, 300 AS Measure3, 400 AS Measure4 FROM customer limit 1


Sample output : case 2 
SELECT 100 AS Measure1, 200 AS Measure2, 300 AS Measure3, 100 AS Measure4 FROM customer limit 1
Sample output : case 3
SELECT 300 AS Measure1, 200 AS Measure2, 300 AS Measure3, 300 AS Measure4 FROM customer limit 1
I hope this helps someone in community.!

- Sadakar Pochampalli

JRXML (Supports from 6.4.2 Professional version)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.2.final using JasperReports Library version 6.4.1  -->
<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="Custom colors for bars" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c6392b13-e801-4f23-97b3-c1721031bd19">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="foodmartlatha"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="ireport.jasperserver.url" value="http://localhost:8080/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="superuser"/>
<property name="ireport.jasperserver.report.resource" value="/EarthlySystems/Custom_colors_for_bars_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/EarthlySystems/Custom_colors_for_bars"/>
<queryString>
<![CDATA[SELECT 100 AS Measure1, 200 AS Measure2, 300 AS Measure3, 400 AS Measure4 FROM customer limit 1]]>
</queryString>
<field name="measure1" class="java.lang.Integer"/>
<field name="measure2" class="java.lang.Integer"/>
<field name="measure3" class="java.lang.Integer"/>
<field name="measure4" class="java.lang.Integer"/>
<background>
<band splitType="Stretch"/>
</background>
<summary>
<band height="270" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="555" height="270" uuid="9d82f52d-8919-49a1-b898-d54f4c9b74f1">
<property name="com.jaspersoft.jasperreports.highcharts.interactive" value="false"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
</reportElement>
<hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="Column">
<hc:chartSetting name="default">
<hc:chartProperty name="title.text" value=""/>
<hc:chartProperty name="credits.enabled" value="false"/>
<hc:chartProperty name="credits.href" value=""/>
<hc:chartProperty name="credits.text" value=""/>
<hc:chartProperty name="yAxis.title.text" value=""/>
<hc:chartProperty name="chart.zoomType" value="xy"/>
<hc:chartProperty name="legend.enabled_customSimpleMode" value="true"/>
<hc:chartProperty name="legend.enabled">
<hc:propertyExpression><![CDATA[false]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="yAxis.gridLineWidth" value="0"/>
<hc:chartProperty name="yAxis.visible" value="false"/>
<hc:chartProperty name="yAxis.labels.enabled" value="false"/>
<hc:chartProperty name="yAxis.labels.format" value="{}"/>
<hc:chartProperty name="chart.backgroundColor" value="#FFFFFF"/>
<hc:chartProperty name="plotOptions.column.pointPadding" value="0.3"/>
<hc:chartProperty name="xAxis.labels.enabled" value="false"/>
<hc:chartProperty name="plotOptions.series.shadow_customSimpleMode" value="true"/>
<hc:chartProperty name="chart.spacingLeft_customSimpleMode" value="true"/>
<hc:chartProperty name="chart.spacingLeft">
<hc:propertyExpression><![CDATA[2]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.spacingRight_customSimpleMode" value="true"/>
<hc:chartProperty name="chart.spacingRight">
<hc:propertyExpression><![CDATA[2]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="colors"/>
<hc:chartProperty name="xAxis.gridLineWidth" value="0"/>
<hc:chartProperty name="xAxis.lineWidth" value="0"/>
<hc:chartProperty name="xAxis.visible" value="false"/>
<hc:chartProperty name="yAxis.gridZIndex" value="0"/>
<hc:chartProperty name="yAxis.minorGridLineWidth" value="0"/>
<hc:chartProperty name="yAxis.lineWidth" value="0"/>
<hc:chartProperty name="plotOptions.column.borderColor">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="xAxis.gridLineColor">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="xAxis.lineColor" value="&quot;&quot;"/>
<hc:chartProperty name="xAxis.minorGridLineWidth" value="0"/>
<hc:chartProperty name="xAxis.minorTickLength" value="0"/>
<hc:chartProperty name="xAxis.tickWidth" value="0"/>
<hc:chartProperty name="xAxis.tickColor" value="&quot;&quot;"/>
<hc:chartProperty name="xAxis.labels.format" value="{}"/>
</hc:chartSetting>
<multiAxisData>
<multiAxisDataset>
<dataset resetType="None"/>
</multiAxisDataset>
<dataAxis axis="Rows">
<axisLevel name="EmptyCategory">
<labelExpression><![CDATA["Level Label expression"]]></labelExpression>
<axisLevelBucket class="java.lang.Comparable">
<bucketExpression><![CDATA["EmptyCategory"]]></bucketExpression>
</axisLevelBucket>
</axisLevel>
</dataAxis>
<dataAxis axis="Columns"/>
<multiAxisMeasure name="Measure1" class="java.lang.Number" calculation="Nothing">
<labelExpression><![CDATA["Measure1"]]></labelExpression>
<valueExpression><![CDATA[$F{measure1}]]></valueExpression>
</multiAxisMeasure>
<multiAxisMeasure name="Measure2" class="java.lang.Number" calculation="Nothing">
<labelExpression><![CDATA["Measure2"]]></labelExpression>
<valueExpression><![CDATA[$F{measure2}]]></valueExpression>
</multiAxisMeasure>
<multiAxisMeasure name="Measure3" class="java.lang.Number" calculation="Nothing">
<labelExpression><![CDATA["Measure3"]]></labelExpression>
<valueExpression><![CDATA[$F{measure3}]]></valueExpression>
</multiAxisMeasure>
<multiAxisMeasure name="Measure4" class="java.lang.Number" calculation="Nothing">
<labelExpression><![CDATA["Measure4"]]></labelExpression>
<valueExpression><![CDATA[$F{measure4}]]></valueExpression>
</multiAxisMeasure>
</multiAxisData>
<hc:series name="Measure1">
<hc:contributor name="SeriesItemProperty">
<hc:contributorProperty name="color" valueType="Expression">
<hc:valueExpression><![CDATA[($F{measure1}>=00  && $F{measure1} <=100 )? "red": ($F{measure1}>=101 &&  $F{measure1} <=200 ) ? "yellow":($F{measure1}>=201 &&  $F{measure1} <=300 ) ?"green":"blue"]]></hc:valueExpression>
</hc:contributorProperty>
</hc:contributor>
</hc:series>
<hc:series name="Measure2">
<hc:contributor name="SeriesItemProperty">
<hc:contributorProperty name="color" valueType="Expression">
<hc:valueExpression><![CDATA[($F{measure2}>=00  && $F{measure2} <=100 )? "red": ($F{measure2}>=101 &&  $F{measure2} <=200 ) ? "yellow":($F{measure2}>=201 &&  $F{measure2} <=300 ) ?"green":"blue"]]></hc:valueExpression>
</hc:contributorProperty>
</hc:contributor>
</hc:series>
<hc:series name="Measure3">
<hc:contributor name="SeriesItemProperty">
<hc:contributorProperty name="color" valueType="Expression">
<hc:valueExpression><![CDATA[($F{measure3}>=00  && $F{measure3} <=100 )? "red": ($F{measure3}>=101 &&  $F{measure3} <=200 ) ? "yellow":($F{measure3}>=201 &&  $F{measure3} <=300 ) ?"green":"blue"]]></hc:valueExpression>
</hc:contributorProperty>
</hc:contributor>
</hc:series>
<hc:series name="Measure4">
<hc:contributor name="SeriesItemProperty">
<hc:contributorProperty name="color" valueType="Expression">
<hc:valueExpression><![CDATA[($F{measure4}>=00  && $F{measure4} <=100 )? "red": ($F{measure4}>=101 &&  $F{measure4} <=200 ) ? "yellow":($F{measure4}>=201 &&  $F{measure4} <=300 ) ?"green":"blue"]]></hc:valueExpression>
</hc:contributorProperty>
</hc:contributor>
</hc:series>
</hc:chart>
</componentElement>
</band>
</summary>
</jasperReport>

April 17, 2018

Hi folks, 

In this post, you would see how to work with SparkLine widget in Jaspersoft reports. I'd be explaining core points as steps in this article. 

The aim of the post is to develop a report which would have below look and feel with sparkline widget.


1) Write below query in Query editor of the JRXML

Sample query:
(SELECT 'text' AS text1, 'text' AS text2, 10 AS value1, 20 AS value2, 30 AS value3, 40 AS value4,  1234 AS value FROM customer limit 1)
UNION ALL
(SELECT 'text' AS text1, 'text' AS text2, 34 AS value1, 54 AS value2, 12 AS value3, 78 AS value4,  1234 AS value FROM customer limit 1)
UNION ALL
(SELECT 'text' AS text1, 'text' AS text2, 43 AS value1, 76 AS value2, 21 AS value3, 40 AS value4,  1234 AS value FROM customer limit 1)
UNION ALL
(SELECT 'text' AS text1, 'text' AS text2, 40 AS value1, 20 AS value2, 12 AS value3, 43 AS value4, 1234 AS value FROM customer limit 1)
UNION ALL
(SELECT 'text' AS text1, 'text' AS text2, 65 AS value1, 21 AS value2, 87 AS value3, 45 AS value4,  1234 AS value FROM customer limit 1)

Sample output of the above query:

2) Drag and drop SparkLine widget from the "Widget Pro" section of the Palette. 

3) Our goal to get the spark lines in details of the report, so the report design should look like below 
i.e., keep spark line widget graph in detail band

4) Edit widget properties to provide the values for lines plotting on visualization. Usually, in a normal line chart we take category and values to plot lines but in case of spark lines we take directly the numeric columns say  value1, value2, value3 and value4 from the sample query. 

IMP NOTE : Ensure that Reset Type = None in "Widget Data" section of "Dataset"

IMP NOTE: Take a look at the Basic and Advanced properties of Widget graph to get the exact look and feel as shown in this article in the top image. 

5) Save the report and publish it to jasperserver and you would be able to see the report output as shown in very first image of the post. 


JRXML : ( Supported in 6.4.2 Professional)

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.2.final using JasperReports Library version 6.4.1  -->
<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="SparkLineWidgetDemo" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a3ce0107-9a6a-4388-a083-a433148b1fc7">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="foodmartlatha"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="ireport.jasperserver.url" value="http://localhost:8080/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="superuser"/>
<property name="ireport.jasperserver.report.resource" value="/EarthlySystems/SparkLineWidgetDemo_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/EarthlySystems/SparkLineWidgetDemo"/>
<queryString>
<![CDATA[(SELECT 'text' AS text1, 'text' AS text2, 10 AS value1, 20 AS value2, 30 AS value3, 40 AS value4,  1234 AS value FROM customer limit 1)
UNION ALL
(SELECT 'text' AS text1, 'text' AS text2, 34 AS value1, 54 AS value2, 12 AS value3, 78 AS value4,  1234 AS value FROM customer limit 1)
UNION ALL
(SELECT 'text' AS text1, 'text' AS text2, 43 AS value1, 76 AS value2, 21 AS value3, 40 AS value4,  1234 AS value FROM customer limit 1)
UNION ALL
(SELECT 'text' AS text1, 'text' AS text2, 40 AS value1, 20 AS value2, 12 AS value3, 43 AS value4, 1234 AS value FROM customer limit 1)
UNION ALL
(SELECT 'text' AS text1, 'text' AS text2, 65 AS value1, 21 AS value2, 87 AS value3, 45 AS value4,  1234 AS value FROM customer limit 1)]]>
</queryString>
<field name="text1" class="java.lang.String"/>
<field name="text2" class="java.lang.String"/>
<field name="value1" class="java.lang.Integer"/>
<field name="value2" class="java.lang.Integer"/>
<field name="value3" class="java.lang.Integer"/>
<field name="value4" class="java.lang.Integer"/>
<field name="value" class="java.lang.Integer"/>
<title>
<band height="30" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="555" height="30" uuid="afa9e0e5-7363-4dd3-9b8f-cf0b78ac465d"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="18" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Spark Line Widget Graph Demo"]]></textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band height="30" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="100" height="30" uuid="e9309669-8240-4ba6-99ca-5dcb335ac043"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Text1]]></text>
</staticText>
<staticText>
<reportElement x="100" y="0" width="100" height="30" uuid="be44cc9b-56da-4d81-93d4-2f41f83f2fb9"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Text2]]></text>
</staticText>
<staticText>
<reportElement x="400" y="0" width="150" height="30" uuid="d0b9756c-cd17-46d7-ae12-813f35f8fbf0"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Value]]></text>
</staticText>
<staticText>
<reportElement x="200" y="0" width="200" height="30" uuid="723477ea-8530-4357-84a1-952cc53ddb03"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Spark Line Graph]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="38" splitType="Stretch">
<componentElement>
<reportElement isPrintRepeatedValues="false" x="200" y="0" width="200" height="30" uuid="e6e7f751-bf9e-4678-918c-e9cf18584ec4">
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
</reportElement>
<fw:sparkLine xmlns:fw="http://jaspersoft.com/fusion" xsi:schemaLocation="http://jaspersoft.com/fusion http://jaspersoft.com/schema/fusion.xsd">
<fw:widgetProperty name="showCloseValue">
<fw:propertyExpression><![CDATA[Boolean.FALSE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="showHighLowValue">
<fw:propertyExpression><![CDATA[Boolean.FALSE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="showLowAnchor">
<fw:propertyExpression><![CDATA[Boolean.TRUE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="showCloseAnchor">
<fw:propertyExpression><![CDATA[Boolean.TRUE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="anchorColor">
<fw:propertyExpression><![CDATA[new java.awt.Color(-16154438)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="anchorRadius">
<fw:propertyExpression><![CDATA[new Integer(2)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="showHighAnchor">
<fw:propertyExpression><![CDATA[Boolean.TRUE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="showOpenAnchor">
<fw:propertyExpression><![CDATA[Boolean.TRUE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="openColor">
<fw:propertyExpression><![CDATA[new java.awt.Color(-16759166)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="closeColor">
<fw:propertyExpression><![CDATA[new java.awt.Color(-16759166)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="highColor">
<fw:propertyExpression><![CDATA[new java.awt.Color(-16759166)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="lowColor">
<fw:propertyExpression><![CDATA[new java.awt.Color(-16759166)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="lineColor">
<fw:propertyExpression><![CDATA[new java.awt.Color(-10987173)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="lineThickness">
<fw:propertyExpression><![CDATA[new Integer(1)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="anchorSides">
<fw:propertyExpression><![CDATA[new Integer(0)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="showBorder">
<fw:propertyExpression><![CDATA[Boolean.FALSE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="borderColor">
<fw:propertyExpression><![CDATA[new java.awt.Color(-1)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="borderThickness">
<fw:propertyExpression><![CDATA[new Integer(0)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="bgColor">
<fw:propertyExpression><![CDATA[new java.awt.Color(-2105118)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="periodLength">
<fw:propertyExpression><![CDATA[new Integer(0)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="periodColor">
<fw:propertyExpression><![CDATA[new java.awt.Color(-1)]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="drawAnchors">
<fw:propertyExpression><![CDATA[Boolean.TRUE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="showOpenValue">
<fw:propertyExpression><![CDATA[Boolean.FALSE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:widgetProperty name="connectNullData">
<fw:propertyExpression><![CDATA[Boolean.FALSE]]></fw:propertyExpression>
</fw:widgetProperty>
<fw:valuesDataset>
<dataset resetType="None"/>
<fw:valueExpression><![CDATA[$F{value1}]]></fw:valueExpression>
<fw:valueExpression><![CDATA[$F{value2}]]></fw:valueExpression>
<fw:valueExpression><![CDATA[$F{value3}]]></fw:valueExpression>
<fw:valueExpression><![CDATA[$F{value4}]]></fw:valueExpression>
</fw:valuesDataset>
</fw:sparkLine>
</componentElement>
<textField>
<reportElement x="0" y="0" width="100" height="30" uuid="4f213fe8-8d1e-449c-87ba-ae38a3dbad53"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{text1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="100" y="0" width="100" height="30" uuid="d6db57ae-f3e8-4a49-beb8-61f7e2d40600"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{text2}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="400" y="0" width="150" height="30" uuid="afb01f97-c840-4687-b167-1a4152cfd1f2"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{value}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

I hope this example helps someone in community.! 

- Sadakar Pochampalli 

April 17, 2018

April 11, 2018

Hi

1) Select the chart component
2) Go to advanced properties
3) In the Misc section click on Edit properties option to add below property.
com.jaspersoft.jasperreports.highcharts.interactive= false 
4) Save your report and preview the output in server or interactive mode in studio.

Sample output: 
Thank you for stopping by.!

- Sadakar Pochampalli 

April 11, 2018

Hi,

Problem Statement : 
How to remove yAxis values from  a highcharts column or bar graph ?
Solution: 
1) Navigate to the Advanced properties of the column graph.
2) From the list of folders in the advanced properties choose "yAxis" and expand it.
3) Scroll down till you find again a folder called "lables".
4) In the labels folder select "format" property (by default it would have default value as {value}) and double click or click on modify button.
5) Change the value of it from {value} to {}
6) Save your report and preview the the visualization
 


Output should look like as below


I hope this helps someone. 

- Sadakar Pochampalli

April 11, 2018

March 15, 2018

Hi,

Group count calculation can be done as follows in jasper reports.

Scenario : 
Report Design:
<GroupNumber>  <GroupBand>
                             <detailband>

Example: 
   IamGroupValue1
         row1_value
         row2_value
         row3_value
2    IamGroupValue2
       row1_value
       row2_value
  IamGroupValue2
      row1_value
      row2_value
      row3_value
      row4_value
...
...
...

Steps:
1) Create your group (lets say Group1 , give the field value by which you want to group by)
2) Observe variables - there it creates a variable called "Group1_Count"
3) Create a new variable of Integer type , let say : groupCount
4) Give below expression for the groupCount variable
      $V{Group1_COUNT} == 1 ? ($V{groupCount} + 1) : $V{groupCount}
5) Put Increment Type= [Group]Group1 and Reset Type =Report and Initial Value=1
6) Pull this variable onto the group header where you want to get it.
7) Run the report observe the group count in output.

Calculation Image: 

Reference : 
https://stackoverflow.com/questions/17480184/how-to-show-the-number-of-group


March 15, 2018

March 11, 2018

Hi,

To get the text only background with given color in jasper text elements, write below code.

"<style backcolor=\"yellow\">Hello .! My background color is yellow </style>"

Importantly , give MarkUp=Styled in the TextField properties

Click on image to get better view: 


Sample output:


Example JRXML:  (Studio 6.4 professional version)

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.0.final using JasperReports Library version 6.4.1  -->
<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_1" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="01d3505b-1aa3-468b-ae16-491d8c5ceb57">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="555" height="79" uuid="1a620294-fdcf-42f3-8fc3-66548fc72941"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA["<style backcolor=\"yellow\">Hello .! My background color is yellow </style>"]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="125" splitType="Stretch"/>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>

</jasperReport>

Reference: 
https://community.jaspersoft.com/questions/514115/setting-textelement-background-color-style-tag

March 11, 2018

January 13, 2018

Hi folks,

Happy New Year.! 2018.

It's been a long time, I have shared a technical write-up in Jaspersoft BI.

Today, here I come with an interesting concept, that is how to restrict the data for specific customers based on logged in user.

In this article, you will see, an end-to-end example starting from domain creation to ad-hoc view and then show you how to restrict the data.




The example(project zip file and explanation) is available as word document which you can download by clicking this link.


This example is also available in my YouTube channel. Watch out the video tutorial for the demonstration here

Page-1 Sample content 

Use case: Display brand wise store cost of customers in cross tabular (or pivot) view using ad-hoc reports.

To keep the demonstration simple and easy to understand the concept, let us take below three tables from foodmart database.

Tables: customer, product and sales_fact_1997

Let’s say customer1_userbelongs to "Alexandra Meyer" customer, customer2_user belongs to “Cathy Bohn” customer respectively and these users are created manually or populated by an ETL tool to the jaspersoft server (to jasperserver database).

When customer1_userlogs in and run the ad-hoc view/report he should be able to see only the data related to him and vice versa for the customer2_user


Page-4 Sample content 




Page-6 Sample content 

Sample snapshot of restricted data for customer1_user 


Read the full content by downloading the word/pdf document by clicking this link.


Stay tuned for more updates - an year for learning advanced concepts in Jaspersoft. 


Thank you
Until next, 
Sadakar Pochampalli 

January 13, 2018

October 25, 2017




<hc:chartProperty name="title.text" value="Chart Title in Center"/>
<hc:chartProperty name="title.verticalAlign" value="middle"/>
<hc:chartProperty name="title.floating_customSimpleMode" value="true"/>
<hc:chartProperty name="title.floating">






JRXML : Supports in 6.4 or later Pro

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.0.final using JasperReports Library version 6.4.1  -->
<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="Task_25_Oct_2017" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="62bf9297-750d-475a-94b8-bfd486dc5f00">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="foodmart"/>
<property name="ireport.jasperserver.url" value="http://localhost:8080/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="superuser"/>
<property name="ireport.jasperserver.report.resource" value="/EarthlySystems/Task_25_Oct_2017_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/EarthlySystems/Task_25_Oct_2017"/>
<subDataset name="Dataset1_Donut" uuid="b8746b75-d0d2-4837-9d6e-bf909eee2911">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="foodmart"/>
<queryString language="SQL">
<![CDATA[(SELECT 'Slice1' AS category, 15 AS value FROM customer limit 1)
UNION ALL
(SELECT 'Slice2' AS category,75 AS Value FROM customer limit 1)]]>
</queryString>
<field name="category" class="java.lang.String"/>
<field name="value" class="java.lang.Integer"/>
</subDataset>
<queryString language="SQL">
<![CDATA[]]>
</queryString>
<title>
<band height="320" splitType="Stretch">
<componentElement>
<reportElement x="60" y="0" width="400" height="320" uuid="9c464bcb-b23c-47d8-9b02-b0413f44c203">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="Pie">
<hc:chartSetting name="default">
<hc:chartProperty name="title.text" value="Chart Title in Center"/>
<hc:chartProperty name="credits.enabled" value="false"/>
<hc:chartProperty name="credits.href" value=""/>
<hc:chartProperty name="credits.text" value=""/>
<hc:chartProperty name="yAxis.title.text" value=""/>
<hc:chartProperty name="chart.zoomType" value="xy"/>
<hc:chartProperty name="plotOptions.pie.showInLegend" value="false"/>
<hc:chartProperty name="legend.enabled_customSimpleMode" value="true"/>
<hc:chartProperty name="legend.enabled">
<hc:propertyExpression><![CDATA[false]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="plotOptions.pie.dataLabels.enabled">
<hc:propertyExpression><![CDATA[false]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="plotOptions.pie.innerSize" value="90%"/>
<hc:chartProperty name="plotOptions.pie.dataLabels.padding" value="0"/>
<hc:chartProperty name="title.verticalAlign" value="middle"/>
<hc:chartProperty name="title.floating_customSimpleMode" value="true"/>
<hc:chartProperty name="title.floating">
<hc:propertyExpression><![CDATA[true]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="title.style.fontSize" value="14px"/>
<hc:chartProperty name="title.style.color" value="#C8CACF"/>
</hc:chartSetting>
<multiAxisData>
<multiAxisDataset>
<dataset>
<datasetRun subDataset="Dataset1_Donut" uuid="50243b95-3f10-43db-8d71-f23638e513b4"/>
</dataset>
</multiAxisDataset>
<dataAxis axis="Rows">
<axisLevel name="Level1">
<labelExpression><![CDATA["Level Label expression"]]></labelExpression>
<axisLevelBucket class="java.lang.String">
<bucketExpression><![CDATA[$F{category}]]></bucketExpression>
</axisLevelBucket>
</axisLevel>
</dataAxis>
<dataAxis axis="Columns"/>
<multiAxisMeasure name="Measure1" class="java.lang.Number" calculation="Nothing">
<labelExpression><![CDATA["Category:"]]></labelExpression>
<valueExpression><![CDATA[$F{value}]]></valueExpression>
</multiAxisMeasure>
</multiAxisData>
<hc:series name="Measure1"/>
</hc:chart>
</componentElement>
</band>
</title>
</jasperReport>

October 25, 2017

October 11, 2017

Hi,

Over a period of time, the product(jaspersoft) has improved by leaps and bounds .Though it had gained developer(s) attention, one may feel ambiguous in finding a particular property in highcharts advanced properties. So far, I found there are no cut corners instead to spend some good amount of time and the article is the outcome of latter.

Today, I have come across the titled task of this post and thought to put in this bank. You will see how to configure the "name(s)" of the label and "percentage(s)"of highcharts(HTML-5) in jaspersoft studio 6.4 pro.

The below property, you need to set in Advanced properties of HTML-5 pie chart and the following images will help you out where exactly you need to configure it.

plotOptions.pie.dataLabels.format = "{point.name} {point.percentage:.0f}%" 


Click on images to get the best sight of content highlighted. 


1) 


2)
3)

 4)

5)

Until the next tip.!

- Sadakar Pochampalli

October 11, 2017

July 6, 2017

It is always fun playing with date related calculations in Jasper reports.

Here is another use case to find out below shown(2nd Image) dates in Jasper Reports.

Sample Design : (Click on image to get best view of content)


Sample Output: (Click on image to get best view of content)




Example Developed in : Jaspersoft Studio Professional 6.4
(NOTE: If you get any error while doing copy paste the below JRXML code, just replace the very first line of xml from other jrxml opened in your studio).


NOTE : 
Analise the calculations in Parameters ( In some cases, we can develop the same using variables)

JRXML : Developed in 6.4 Pro  (Copy - Paste below code in a JRXML opened in your studio)

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.0.final using JasperReports Library version 6.4.1  -->
<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="Previous and Next Months" pageWidth="1000" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="960" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="be22b853-8ecd-45d5-993a-456ecbf2733b">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <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="ireport.jasperserver.url" value="http://localhost:8080/jasperserver-pro/"/>
    <property name="ireport.jasperserver.user" value="superuser"/>
    <property name="ireport.jasperserver.report.resource" value="/EarthlySystems/Previous_and_Next_Months_files/main_jrxml"/>
    <property name="ireport.jasperserver.reportUnit" value="/EarthlySystems/Previous_and_Next_Months"/>
    <import value="org.apache.commons.lang.time.*"/>
    <parameter name="Date" class="java.util.Date">
        <defaultValueExpression><![CDATA[new Date()]]></defaultValueExpression>
    </parameter>
    <parameter name="PreviousMonthDate" class="java.util.Date" isForPrompting="false">
        <defaultValueExpression><![CDATA[DateUtils.addMonths($P{Date},-1)]]></defaultValueExpression>
    </parameter>
    <parameter name="NextMonthDate" class="java.util.Date" isForPrompting="false">
        <defaultValueExpression><![CDATA[DateUtils.addMonths($P{Date},1)]]></defaultValueExpression>
    </parameter>
    <parameter name="FirstDateOfCurrentMonth" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA[new SimpleDateFormat("MM/dd/yyyy").format(java.util.Date.parse(MONTH($P{Date}) + "/1/" + YEAR($P{Date})))]]></defaultValueExpression>
    </parameter>
    <parameter name="FirstDayOfCurrentMonth" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA[new SimpleDateFormat("EEE").format(java.util.Date.parse(MONTH($P{Date}) + "/1/" + YEAR($P{Date})))]]></defaultValueExpression>
    </parameter>
    <parameter name="FirstDateOfPreviousMonth" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA[new SimpleDateFormat("MM/dd/yyyy").format(java.util.Date.parse(MONTH($P{PreviousMonthDate}) + "/1/" + YEAR($P{PreviousMonthDate})))]]></defaultValueExpression>
    </parameter>
    <parameter name="FirstDayOfPreviousMonth" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA[new SimpleDateFormat("EEE").format(java.util.Date.parse(MONTH($P{PreviousMonthDate}) + "/1/" + YEAR($P{PreviousMonthDate})))]]></defaultValueExpression>
    </parameter>
    <parameter name="FirstDateOfNextMonth" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA[new SimpleDateFormat("MM/dd/yyyy").format(java.util.Date.parse(MONTH($P{NextMonthDate}) + "/1/" + YEAR($P{NextMonthDate})))]]></defaultValueExpression>
    </parameter>
    <parameter name="FirstDayOfNextMonth" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA[new SimpleDateFormat("EEE").format(java.util.Date.parse(MONTH($P{NextMonthDate}) + "/1/" + YEAR($P{NextMonthDate})))]]></defaultValueExpression>
    </parameter>
    <parameter name="CurrentDateFirstDayValueString" class="java.lang.String" isForPrompting="false">
        <parameterDescription><![CDATA[]]></parameterDescription>
        <defaultValueExpression><![CDATA[$P{FirstDayOfCurrentMonth}.equals("Sun") ? "0":
$P{FirstDayOfCurrentMonth}.equals("Mon") ? "1" :
$P{FirstDayOfCurrentMonth}.equals("Tue") ? "2" :
$P{FirstDayOfCurrentMonth}.equals("Wed") ? "3" :
$P{FirstDayOfCurrentMonth}.equals("Thu") ? "4" :
$P{FirstDayOfCurrentMonth}.equals("Fri") ? "5" :
$P{FirstDayOfCurrentMonth}.equals("Sat") ? "6" : "100"]]></defaultValueExpression>
    </parameter>
    <parameter name="CurrentDateFirstDayValueInteger" class="java.lang.Integer" isForPrompting="false">
        <parameterDescription><![CDATA[]]></parameterDescription>
        <defaultValueExpression><![CDATA[Integer.parseInt($P{CurrentDateFirstDayValueString})]]></defaultValueExpression>
    </parameter>
    <parameter name="PreviousMonthFirstDayValueString" class="java.lang.String" isForPrompting="false">
        <parameterDescription><![CDATA[]]></parameterDescription>
        <defaultValueExpression><![CDATA[$P{FirstDayOfPreviousMonth}.equals("Sun") ? "0":
$P{FirstDayOfPreviousMonth}.equals("Mon") ? "1" :
$P{FirstDayOfPreviousMonth}.equals("Tue") ? "2" :
$P{FirstDayOfPreviousMonth}.equals("Wed") ? "3" :
$P{FirstDayOfPreviousMonth}.equals("Thu") ? "4" :
$P{FirstDayOfPreviousMonth}.equals("Fri") ? "5" :
$P{FirstDayOfPreviousMonth}.equals("Sat") ? "6" : "100"]]></defaultValueExpression>
    </parameter>
    <parameter name="PerviousMonthFirstDayValueInteger" class="java.lang.Integer" isForPrompting="false">
        <parameterDescription><![CDATA[]]></parameterDescription>
        <defaultValueExpression><![CDATA[Integer.parseInt($P{PreviousMonthFirstDayValueString})]]></defaultValueExpression>
    </parameter>
    <parameter name="NextMonthFirstDayValueString" class="java.lang.String" isForPrompting="false">
        <parameterDescription><![CDATA[]]></parameterDescription>
        <defaultValueExpression><![CDATA[$P{FirstDayOfNextMonth}.equals("Sun") ? "0":
$P{FirstDayOfNextMonth}.equals("Mon") ? "1" :
$P{FirstDayOfNextMonth}.equals("Tue") ? "2" :
$P{FirstDayOfNextMonth}.equals("Wed") ? "3" :
$P{FirstDayOfNextMonth}.equals("Thu") ? "4" :
$P{FirstDayOfNextMonth}.equals("Fri") ? "5" :
$P{FirstDayOfNextMonth}.equals("Sat") ? "6" : "100"]]></defaultValueExpression>
    </parameter>
    <parameter name="NextMonthFirstDayValueInteger" class="java.lang.Integer" isForPrompting="false">
        <parameterDescription><![CDATA[]]></parameterDescription>
        <defaultValueExpression><![CDATA[Integer.parseInt($P{NextMonthFirstDayValueString})]]></defaultValueExpression>
    </parameter>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="175" splitType="Stretch">
            <textField>
                <reportElement x="100" y="0" width="100" height="30" uuid="686f531e-d1c4-44ef-884d-378f2a36fc1e"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{Date}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="100" y="30" width="100" height="30" uuid="5ca971f8-a82e-4cd2-97b5-9e1e8055e59f">
                    <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
                </reportElement>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{PreviousMonthDate}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="100" y="60" width="100" height="30" uuid="6f1e9e0c-16f7-4ff1-b14f-21d1da654222"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{NextMonthDate}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="0" y="0" width="100" height="30" uuid="16e4c44e-16c8-477e-a31d-f8fe7582ae7f"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["Current Date"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="0" y="30" width="100" height="30" uuid="0b313be3-2ed2-4f90-933b-cbc57673ea69"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["Previous Month"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="0" y="60" width="100" height="30" uuid="a2585866-90c0-4b59-b68a-509247a5927e"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["Next Month"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="390" y="0" width="100" height="30" uuid="09a6c4ad-4b9a-43be-a05e-bc57a5b18bf9"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{FirstDateOfCurrentMonth}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="230" y="0" width="160" height="30" uuid="b67025b7-8677-4a3f-8f8d-1162bf7d26e3"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["First Date of Current Month"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="670" y="0" width="100" height="30" uuid="421e66b1-d745-4117-bee0-0af184eaca3d"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{FirstDayOfCurrentMonth}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="510" y="0" width="160" height="30" uuid="d180e9ba-ae84-4b94-9b51-43648bba475a"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["First Day of Current Month"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="230" y="30" width="160" height="30" uuid="7157a773-e62f-4e0c-9f03-4696a30a9136"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["First Date of Previous Month"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="390" y="30" width="100" height="30" uuid="3d3ed51e-f5f0-4892-9c42-ae52ef3b7651"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{FirstDateOfPreviousMonth}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="510" y="30" width="160" height="30" uuid="b384ade7-ea31-45ec-a756-82c37b8f6e02"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["First Day of Previous Month"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="670" y="30" width="100" height="30" uuid="4990802a-be00-4306-91f6-1a5e50c4bc98"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{FirstDayOfPreviousMonth}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="230" y="60" width="160" height="30" uuid="87c32b3a-5794-4853-b5de-129f0273b839"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["First Date of Next  Month"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="390" y="60" width="100" height="30" uuid="5d12680a-5c90-4b9f-af78-c41df1c5167d"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{FirstDateOfNextMonth}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="510" y="60" width="160" height="30" uuid="c981572c-6f18-4eb9-a7b9-d875d19f26ca"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["First Day of Next  Month"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="670" y="60" width="100" height="30" uuid="77c38b0a-3206-4767-9519-0e497db7cbe0"/>
                <textElement verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{FirstDayOfNextMonth}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="770" y="0" width="80" height="30" uuid="259b0efd-cf1c-4963-a4e3-1785d602d59c"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{CurrentDateFirstDayValueInteger}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="770" y="30" width="80" height="30" uuid="f10baf74-a727-48d9-bfcf-1b6d3452736f"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{PerviousMonthFirstDayValueInteger}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="770" y="60" width="80" height="30" uuid="71be88e2-4893-41d5-bef4-6bbdb4cb7c6a"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{NextMonthFirstDayValueInteger}]]></textFieldExpression>
            </textField>
            <textField hyperlinkType="ReportExecution" hyperlinkTarget="Blank">
                <reportElement x="139" y="126" width="281" height="30" uuid="7d969a03-940c-4081-8210-d90686c0ae5c"/>
                <textElement>
                    <font size="14"/>
                </textElement>
                <textFieldExpression><![CDATA["Previous Month"]]></textFieldExpression>
                <hyperlinkParameter name="_report">
                    <hyperlinkParameterExpression><![CDATA["/EarthlySystems/Previous_and_Next_Months"]]></hyperlinkParameterExpression>
                </hyperlinkParameter>
                <hyperlinkParameter name="Date">
                    <hyperlinkParameterExpression><![CDATA[$P{PreviousMonthDate}]]></hyperlinkParameterExpression>
                </hyperlinkParameter>
                <hyperlinkParameter name="DayReturnValueInteger">
                    <hyperlinkParameterExpression><![CDATA[$P{PerviousMonthFirstDayValueInteger}]]></hyperlinkParameterExpression>
                </hyperlinkParameter>
            </textField>
            <textField hyperlinkType="ReportExecution" hyperlinkTarget="Blank">
                <reportElement x="440" y="126" width="281" height="30" uuid="64116c95-e582-476e-b5ca-fe88e26c7d77"/>
                <textElement>
                    <font size="14"/>
                </textElement>
                <textFieldExpression><![CDATA["Next  Month"]]></textFieldExpression>
                <hyperlinkParameter name="_report">
                    <hyperlinkParameterExpression><![CDATA["/EarthlySystems/Previous_and_Next_Months"]]></hyperlinkParameterExpression>
                </hyperlinkParameter>
                <hyperlinkParameter name="Date">
                    <hyperlinkParameterExpression><![CDATA[$P{NextMonthDate}]]></hyperlinkParameterExpression>
                </hyperlinkParameter>
                <hyperlinkParameter name="DayReturnValueInteger">
                    <hyperlinkParameterExpression><![CDATA[$P{NextMonthFirstDayValueInteger}]]></hyperlinkParameterExpression>
                </hyperlinkParameter>
            </textField>
        </band>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="125" splitType="Stretch"/>
    </detail>
    <columnFooter>
        <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>


I hope it helps some one in community.!

Cheers.!
Sadakar Pochampalli

July 6, 2017

Pages

Feedback