How to modify the width of a tab in RichObject

2021-09-05

Some users prefer to create tables by adjusting the tab width, or they want to create a table in a format that does not support them.

In previous versions of FastReport .NET, RichObject offered the function to modify the width of a tab in a line, but all their sizes after the first tab were the same. This has been fixed in the current version and now you can set the size for each tab character.

New property for TextObject TabPositions allows you to set the width of a tab. It is used when converting RichObject. Now you can control the width of tab characters in two ways:

– to set from the code the width of individual tab characters for each line of the TextObject;
– by uploading the finished document into RichObject.

The function to edit this property in the designer is temporarily unavailable. If there are more tab characters than widths, the tab size will be normal, and if there will be more values than tabs, the excess values of width will not be applied.

An example of a text with different tab widths

Original RTF document:

Adjusting the tab width in Word

How it looked in the previous version:

Different tab widths in the previous preview window

In the current version:

Different tab widths in the preview window of this version

Customizing tab width from the code:

 //create instance of class Report
 Report report = new Report();
 //create report page
 ReportPage pageBase = new ReportPage();
 //create data band
 DataBand dataBand = new DataBand();
 //create text object
 TextObject textObject = new TextObject();
 //set the text value
 textObject.Text = "1\t2\t3\t4";
 //set width for every symbol tab in centimeters
 textObject.TabPositions = new FloatCollection() { Units.Centimeters * 2.5f, Units.Centimeters * 3.5f, Units.Centimeters * 5 };
 //add the text object to data band
 textObject.Parent = dataBand;
 //set generated name
 textObject.CreateUniqueName();
 //set the text object bounds
 textObject.Bounds = new RectangleF(0, 0, Units.Centimeters * 15, Units.Centimeters * 0.5F);
 //create one more text object
 TextObject textObject2 = new TextObject();
 textObject2.Text = "5\t6\t7\t8";
 textObject2.TabPositions = new FloatCollection() { Units.Centimeters * 2.5f, Units.Centimeters * 3.5f, Units.Centimeters * 5 };
 textObject2.Parent = dataBand;
 textObject2.CreateUniqueName();
 textObject2.Bounds = new RectangleF(0, Units.Centimeters * 1, Units.Centimeters * 15, Units.Centimeters * 0.5F);
 //create one more text object
 TextObject textObject3 = new TextObject();
 textObject3.Text = "9\t10\t11\t12";
 textObject3.TabPositions = new FloatCollection() { Units.Centimeters * 2.5f, Units.Centimeters * 3.5f, Units.Centimeters * 5 };
 textObject3.Parent = dataBand;
 textObject3.CreateUniqueName();
 textObject3.Bounds = new RectangleF(0, Units.Centimeters * 2, Units.Centimeters * 15, Units.Centimeters * 0.5F);
 //add the band to band collection
 pageBase.Bands.Add(dataBand);
 //add created page to report page collection
 report.Pages.Add(pageBase);
 //show report
 report.Show();

Thus, you can turn RichObject and TextObject into an alternative to the Table object with the help of new improvements.

.NET .NET FastReport FastReport RTF RTF
October 26, 2026

Progress Bar in Delphi: The TfrProgressBar and TfrxProgressBar Components from FastReport VCL

Let’s take a closer look at the TfrProgressBar and TfrxProgressBar components from FastReport VCL: configuring the progress scale, thresholds and markers, binding to data, and a Delphi example.
October 26, 2026

TfrImageComboBox: A drop-down list with images and text captions in FastReport VCL

TfrImageComboBox from FastEditors VCL: a drop-down list with icons and labels for FastReport VCL. Properties, events, and usage examples in Delphi.
October 23, 2026

FastGrid from the Inside: The View Object, Columns, and Events of the Delphi Grid Component

FastGrid’s internal structure: the View object, the Appearance property, columns, events, and the DB and Unbound data modes in Delphi. Analysis using the GridDemo.dpr demo project as an example.

© 1998-2026 Fast Reports Inc.