Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How to create indentation within BIRT Reports

How to create indentation within BIRT Reports


How to create indentation within BIRT Reports


Indentation can be used within Birt Reports to represent hierarchy structure of various objects. The example below applies indentation to a Projects Requirements:

  • Open Silk Central Test Manager and go to ADMINSTRATION | REPORTS and download the "All Requirements" Report
  • Open Birt Reports and open the All Requirement.rptdesign Report
  • From within the OUTLINE pane expand the "Body" and select "Table" element. Change the layout view to script.

  • Ensure that the script is "onPrepare" mode and create a new variable blankSpace

Because this example is used to illustrate indentation only the requirement name is required. We will now remove all of the other requirement attributes.

  • From the Outline pane, expand "Table" and "Detail". Select all of the rows except for the first row, right click on the mouse and select delete.

  • Expand "Row" → "Cell" → "Data(reqName)" and click on the "Script" view and ensure the "onCreate" script is selected
  • Add the following lines of code to the end of existing code:

//loop through the reqNum for any instances of character . to determine indenting

if (reqNumber!=currentNumber){

for (var x=1; x

if(reqNumber.charAt(x)==".") blankSpace=blankSpace+" ";



  • Go to the Outline Pane and select "Text" below "Data(reqName)"
  • Select the "Layout" view and double click on the highlighted cell (
  • Modify the value of it so it includes the blankSpace at the start of the String:

    blankSpacereqNumber+" "+row["reqName"]

    • Save the report and upload to SilkCentral Test Manger by either creating a new report or updating a current one

Old KB# 25119


Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:52
Updated by:
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.