Sometimes we may bump into a requirement of displaying a list value in the Title Bar and it is very tricky situation in Jaspersoft Studio.

Title and Summary Bar will not display a List Value field and if we try to drag and drop a column with No Calculation Function, It will display the first indexed value. Please see the screenshots below to understand the concept.

I created a simple Report and Now when I drag and Drop the SHIPNAME Field into Title and see What happens.

LIS_Img03

LIS_Img02

LIS_Img01

In this case, there two ways to display a list value in the Title or Summary Bar
1) Is by creating a SubReport with required data and place it in the Title Field.
2) is by Adding a List palette and creating a new Dataset.

Using Sub Report Method:

In the above example, I will now display Top 10 Country Name in the title Band using Sub Report.

I have already created a Report with Top 10 Country values and the Value field is added in the detailed section of the sub report.I will just add this report as a Sub Report using the palette. Detailed explanation of creating and using Sub Report will be explained in a different Blog.

Here I added the Sub Report in the title section as follows

LIS_Img04

Now when we preview the report, This is how the display would be.

LIS_Img05

So, This is one way to display the List in Title or Summary Band is by using Sub Report.

Using List Method:

Drag and Drop the List Component from the Palette.

LIS_Img06

Create a New Data Set and Name it as your wish.

LIS_Img07

LIS_Img08

Create the Query for the List items to be displayed.

LIS_Img09

This will create the List component. Place it in the Title Band.

LIS_Img10

Drag and Drop the field variable from the new Dataset “Fields ” section into the List Component you just created.

LIS_Img11

Align the Component and Preview.

LIS_Img12

To Align the ListComponent:

Once you have created the List Component, you need to align it properly so that you can place it anywhere in the Band and it should display the list without space between two Values. For that

1) Right Click on the Component and Select Arrange In Container –> Horizontal Layout

LIS_Img13

2) This will align the Field to top left corner. Now Drag the Bottom right corner of the Component to fit the Value Field.
3) Now you can place it anywhere in the Band and it will align to the band. as shown below.

LIS_Img14