Show Subscripts in IReport, Jasper Server and in PDF Export

Posted on by By Satya Gopi, in Business Intelligence, Jaspersoft, Open Source Business Intelligence | 0

Show subscripts in IReport, Jasper server and in PDF Export

Requirement: Show number in field value as subscripts in IReport ,Jasper server and in PDF Export.

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Grab The 30 Days Free Trail

Softwares used:
Jasper Server 5.6.0
IReport 5.6.0

Here I have created a sample Report to work out on above Requirement

Sample Query:

select ‘H2O’ AS SUBSCRIPT
UNION
SELECT ‘CO2’ AS SUBSCRIPT
UNION
SELECT ‘H3O2’ AS SUBSCRIPT
UNION
SELECT ‘S9O2’ AS SUBSCRIPT
UNION
SELECT ‘HO2CO32’ AS SUBSCRIPT

Output in IReport :

Output in Ireport

But actually we want result in below format

Actual Result

In the above screen shot if we observe, all the Numbers looks like SubScripts.So to Subscript the Numbers please follow the below steps

1.First add Tag to the number, which we want in SubScript

SubScript

In this 1 will come as a subscript

2.To apply the above Tag to a field first change the Markup language as Styled

Markup

3.Nextuse the Replace function to Replace the Numbers to show as SubScript

FieldName

4.In the above Report field name is SUBSCRIPT and replace the Numbers from 1 to 9

Replace

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Get your 30 Days Trail Version

Output in IReport :

Actual Result

Deployed in server the Output in Jasper server :

ServerOutput

Output in PDF :

PDFOutput

In all browsers this subscript will not work,eg:Mozila and Internet Explorer

To over come the above issue I have created Theme using overrides_custom.css ,and make this theme as a default theme

In the overrides_custom.css add the below code

#reportContainer td {
font-size: xx-small;
}

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

Thanks,

SatyaGopi

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments