Blog Archives

USING STYLES IN JASPER REPORTS

We have been accustomed to use style sheets or CSS in our HTML codes, parallel to that we can use Styles in Jasper Reports also. It provides same utilities like conditional, non -conditional and could be applied on any element in the Report.

Now how to create styles, there are two methods basically:

1. External Style Sheet (jrtx file)
2. Declaring Internal Styles in the report itself.

Read the rest of this entry

Display the Username of Logged in User in JasperServer

Many times we require the name of the person who logged into the Jasper Server and according to this information we are able to show/hide the elements on report, or simply to log the user name we can use it.

But what is the technique to achieve that?

We can create parameters in our report, with a specific name and datatype. Then these parameters will be automatically filled when the report is executed by JasperReports Server. LoggedInUsername (java.lang.String), with no default value. Then, we can use $P{LoggedInUsername} in a text field, in a query, in a printWhenExpression, etc.

Read the rest of this entry