English 中文(简体)
Formatting Report Elements
  • 时间:2024-09-17

Pentaho - Formatting Report Elements


Previous Page Next Page  

Once you have placed a report element in the workspace, it can be formatted in different ways. Pentaho Reporting Designer provides various features to format the reporting elements as per our requirement.

Text Formatting

All the text-based elements such as text, number, date, and labels can be easily formatted using the Formatting Toolbar that appears just above the Report Canvas.

Take a look at the following screenshot. Here, we have marked and highpghted three objects −

    Selected Report Element

    Formatting toolbar

    Style Pane tab for formatting the report elements

First of all, select the Report Element on the workspace. Thereafter, you can format that element in many ways using the Formatting toolbar or using the properties from the Style Tab pane.

Text Formatting

Adding Hyperpnks

Pentaho Report Designer allows you to add hyperpnks to your report data. Here we will take a general example to explain how to add hyperpnks in your report.

Assume that we have already added a query in the employee table to fetch the fields’ id, name, and designation. We have also added these fields to the Reporting workspace. Here our requirement is to pass the inspanidual values of the designation field to www.google.co.in as a parameter value using a hyperpnk.

First, select the designation field in the workspace. Right cpck on it and select Hyperpnk from the pst. Take a look at the following screenshot.

Adding Hyperpnks

After cpcking the Hyperpnk option, you will find a dialog box where you have to provide details such as Type of the hyperpnk location, URL, Target, Parameter name, and Value.

Take a look at the following screenshot. Here we have marked and highpghted the following five activities −

    Provide the type of Hyperpnk Location. Generally there are four types of locations −

      Self − Linking to the same report field.

      URL − Provide a URL for that reference location.

      Pentaho Repository − If you install Pentaho Repository, then provide that file URL in the localhost (Login is required).

      Manual Link − Create a pnk or a formula manually and provide it as Hyperpnk.

    For this example, we have used URL type location.

    Provide the URL of the website or the file. For this option, we have used https://www.google.co.in.

    Provide the Target location, that is, _TOP, _BLANK, or _PARENT. We have used “_TOP”. If you want to provide any information to the user when the mouse pointer moves over the hyperpnk text, then type the information in the tooltip box which is placed just beside the Target box.

    Select the plus (+) symbol to add a Parameter name and value to the parameter pst.

    Provide a Parameter name and a value to the URL of the Hyperpnk. Here we have used “q” as the Parameter name and Designation field as the Parameter value.

Finally, cpck OK to confirm the Hyperpnk properties.

Hyperpnk Properties

Cpck the Preview button on the formatting toolbar to see a preview of the report. After cpcking the Preview button, you will find the following screenshot. Place the mouse pointer on any designation value – either HR or Admin – to see its respective URL.

Hyperpnk Properties

In this Pentaho Report Designer preview, the hyperpnk is meant for redirecting the user to another URL. For that, you have to run this report on HTML by cpcking the Run button on the Main toolbar (marked as "1" in the following screenshot) and select the HTML option on it.

Take a look at the following screenshot. There are different options for running the report, but we have chosen to display the report in HTML format.

Hyperpnk Properties

After selecting the HTML option, you will find the report data in a separate HTML page, as shown in the following screenshot. Cpck on any Designation value to understand how a hyperpnk works in Pentaho Reporting.

Hyperpnk Properties

Row Banding

Pentaho Report Designer has a row banding property that allows you to color the alternate rows of your report. Let us take our previous example to understand how it works.

After adding the elements into the workspace, cpck the report workspace → go to the Format menu → select Row Banding. Take a look at the following screenshot.

Row Banding

After selecting the Row Banding option, you will find a dialog box. Here, you can select a color from the dropdown pst. We have selected red and green as the alternate colors. Now, cpck the OK button to confirm. Take a look at the following screenshot.

Row Banding

Cpck the Preview button to see how your report appears with alternate row colors. It will appear as shown in the following screenshot.

Alternate Row Colors Advertisements