Using the string.Format Method in Report Designer

Using the string.Format Method in Report Designer

Most of the articles in this section of the Knowledge Base focus on using the Text Format tool, but the Text Format tool does have one drawback, which this article intends to remedy.

While the Text Format tool is beneficial in formatting an entire text object, it cannot format individual values within expressions. When formatting individual values within a text object is necessary, it is recommended to use the string.Format method. The string.Format method provides most of the same formatting options as the Text Format tool, but the string.Format method provides even more flexibility.

To use the string.Format method in a text component, select the text component for editing, and enter the expression in the text field.


Fig. 01 – string.Format Example

As an example, when the need to format a value as currency arises, use the C specifier:

Product Value: {string.Format(“{0:C}”, Value)}

In the case that Value is 100.00, then after formatting, the line prints as:

Product Value: $100.00

Formatting more than one parameter is permissible with the string.Format method.

Product Values: {string.Format(“value1 – {0:C}, value2 – {0:1}”, Value1, Value2)}

For more information about string.Format , see String.Format Method.


    • Related Articles

    • Understanding Text Formatting in the Report Designer

      The articles in this section of the Knowledge Base involve Text Formatting for display in your reports. To access the Report Designer, select Toolbox Setup > Design Reports > Design (Report Type) Report. Select New Report to design a report from ...
    • Understanding Numerical Formatting in the Report Designer

      The articles in this section of the Knowledge Base involve Text Formatting for display in your reports. To learn more about Text Formatting and how to access this section within the Report Designer, see Understanding Text Formatting in the Report ...
    • Understanding Custom Formatting in Report Designer

      The articles in this section of the Knowledge Base involve Text Formatting for display in your reports. To learn more about Text Formatting and how to access this section within the Report Designer, see Understanding Text Formatting in the Report ...
    • Understanding Currency Formatting in the Report Designer

      The articles in this section of the Knowledge Base involve Text Formatting for display in your reports. To learn more about Text Formatting and how to access this section within the Report Designer, see Understanding Text Formatting in the Report ...
    • Understanding Boolean Values Formatting in the Report Designer

      The articles in this section of the Knowledge Base involve Text Formatting for display in your reports. To learn more about Text Formatting and how to access this section within the Report Designer, see Understanding Text Formatting in the Report ...
    • Recent Articles

    • Toolbox Release Notes | Build 25.1.1204.641

      The following release notes apply to Toolbox build 25.1.1204.641 Toolbox Login Screen Update Fig. 1: The updated Toolbox Login interface. The Toolbox Login interface has had several changes applied to it to enhance its usability and allow for greater ...
    • Toolbox Release Notes | Build 25.1.1120.641

      The following release notes apply to Toolbox build 25.1.1120.641 Mouse Wheel Fix There was a reported issue in certain interfaces (such as report groups) in which hovering over a dropdown menu (such as Output Type) would result in the options within ...
    • Dynamic Dimensioning in Toolbox BSB

      When applying dimensions to products and other solids in Toolbox BSB, by default, all dimensions are drawn in 2D on the Y plane, requiring one to switch to a top view (or an appropriately high isometric view) to see them. BricsCAD has a feature that ...
    • Toolbox Release Notes | Build 25.1.1107.641

      The following release notes apply to Toolbox build 25.1.1107.641. Subassembly Prompt Fixes A pair of issues were reportedly occurring when attempting to work with subassembly prompts in the Edit Design Data interface. Subassemblies copied to the ...
    • Microvellum Foundation Library Release Notes | Build 25.1024

      The following release notes apply to the Microvellum Foundation Library build 25.1024. Additions Added Face Profile Options to the Door Wizard for enhanced design flexibility. Users can now apply decorative visual profiles to doors, drawer fronts, ...