Live Chat Icon For mobile
Live Chat Icon

Formatting a Report in Bold Reports

Displaying information directly from the database doesn’t often look very nice. So, formatting a report plays a vital role in data reporting. Formatting a report includes highlighting important numbers; putting the focus on specific sets of data, applying colors, fonts, and backgrounds; and formatting labels and values. It improves the design and sense of a report and helps zoom in on key sections of it.

In the Bold Reports Designer, to make the reports look further engaging, you can format data after retrieving it from a database using static or dynamic formatting. In this blog, I am going to present simple formatting examples with table cell formatting.

Choose a cell in the table report item and open the Properties panel. It will open with various properties with which we can format the data in the table cell.

Text Box Properties View
Text Box Properties View

Static formatting

Under the Basic Settings category, you can directly enter the required format in the Format property text field or click on the button to open the format dialog.

Format Property Field
Format Property Field

I am going to use the Format Dialog.

Format Dialog
Format Dialog

Number formatting

Follow these steps to present the data set field in integer, currency, and percentage formats in a report.

Integer

To display the Population field values as an integer number, open the format dialog for the respective text box. Choose Number as the Type, enter 0 in Decimal Places, enable the Use 1000 Separator(,) check box, and let the other options remain with their default values.

Number Formatting
Number Formatting

Click OK.

Before Formatting

After Formatting

By default, during report run time the formatting will be applied based on default system language settings. You can change the language under Localization category in the text box properties. I am changing the language code to bg, Bulgarian.

Localization Property
Localization Property

At run time, the formatting will be applied based on the selected language code. In Bulgarian format, the comma separators will be treated as spaces. In the following report preview, you can see the data in the population column is separated with spaces.

Report Showcases Numbers
Numbers Formatting in Bulgarian Language

Currency

Now, I am going to display the Price data field in German currency format:

  1. Open the format dialog for the right text box.
  2. Choose Currency as the Type.
  3. Enter in Decimal Places.
  4. Set the Currency Culture to German to display the currency symbol.
  5. Enable the Use 1000 Separator(,) check box.
  6. Select 12345 in Negative values to display negative values with the minus symbol.
  7. Let the other options remain with their default values.

    Currency Formatting
    Currency Formatting
  8. Click OK.

Before Formatting

After Formatting
After Formatting

Now, let’s further format the Price data field using the localization property. Set the language code to de in the Localization property.

Format Currency in German Culture
Set German Culture

At run time, the data in the Price column is displayed in German cultural format. In German culture, the comma and period characters switch functions from American culture, with periods visually breaking up larger numbers and commas separating whole numbers from fractions.

Currency Formatting in German Culture
Currency Formatting in German Culture

Percentage

To display the Discount data field in percentage format, open the format dialog for the respective text box. Choose Percentage as the Type, enter 0 in Decimal Places, and let the other options remain with their default values.

Percentage Formatting
Percentage Formatting

Click OK. At run time, the data in the Discount column is formatted as percentage values with no decimal points.

Before Formatting

After Formatting

Date formatting

To display the Date field in the desired date format, open the format dialog for the respective text box. Choose Date as the Type, and the 31 Jan 2000 format in the Date drop-down.

Date Formatting
Date Formatting

Click OK. At run time, the data in the Birth Date column is formatted to dd MM yyyy format.

Before Formatting
Before Formatting

After Formatting
After Formatting

String formatting

You can present plain text content or HTML-formatted text from a data set field in a report and format it using the properties listed in the Properties panel.

Plain Text

To format plain text, select the respective table cell or text box and open the Properties panel. We can format the font properties in the Basic Settings category, set the alignment properties in the Alignment category, set the border and fill color of the text box in the Appearance category, and a few other properties.

Text Box Properties View
Text Box Properties View

You can understand how formatting options change the look and feel of the report from following designs.

Before Formatting

After Formatting
After Formatting

HTML text

You can display HTML-formatted text in the report using the Markup Type property in a text box report item. Enter the HTML-formatted text directly or dynamically insert a field from your data set that returns HTML text. Refer to the “Add HTML into a report” documentation for more information.

Plain Text

HTML-Formatted Text
HTML-Formatted Text

Dynamic formatting

In the Bold Reports Designer, we can dynamically format reports using Expressions. During report run time, the expressions are evaluated and applied to the data. Refer to the “Display dynamic text using expressions” documentation for more information about formatting text using expressions in text box report items. Here, I am going to format the text from the data set field using a particular text case format. Select the proper expression text in the text box and right-click.

Open Expression in Text Box
Open Expression in Text Box

Click on the Expression option in the menu and the Expression Builder will open with existing data set field expression format.

Expression Builder with Data Set Field
Expression Builder with Data Set Field

Now, using StrConv and vbProperCase functions, we can convert the casing of the string. The StrConv function converts a string of text into the proper case; vbProperCase converts the first letter of every word in the string to uppercase and all other characters to lowercase. Modify the expression as required and click OK.

String Conversion Using Expression
String Conversion Using an Expression

At run time, this expression will be evaluated and applied to the specific data in the report.

Before Formatting

After Formatting

Conclusion

I hope this blog provided a clear idea about the formatting options available and how to enhance your report using them in the Report Designer. To explore further, go through our sample reports and Bold Reports documentation.

If you have any questions, please post them in the comments section. You can also contact us by submitting them through our contact page, or if you already have an account, you can log in to submit them.

Bold Reports now comes with a 15-day free trial with no credit card information required. We welcome you to start a free trial and experience Bold Reports for yourself. Give it a try and let us know what you think!

Stay tuned to our official TwitterFacebookLinkedInPinterest, and Instagram pages for announcements about upcoming releases.

Leave a Reply