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 24.1.1105.641

      The following release notes apply to Toolbox build 24.1.1105.641 Nesting Fix Fig. 1: The fatal error that would occur during processing. There was reportedly an issue that occurred when clients attempted to process a work order using the nesting ...
    • Microvellum Foundation Library Release Notes | Build 24.1025

      The following release notes apply to Microvellum Foundation Library build 24.1025. Additions Added new global variable “Remove Stop Dado On Bottom Edge” for wood drawer boxes. Check this option to run the dado through at the bottom of the sub front ...
    • Toolbox Release Notes | Build 24.1.1030.641

      The following release notes apply to Toolbox build 24.1.1030.641 Routing and Profile Fixes Several issues were found with routing and polyline paths: Fig. 1: Horizontal routes off of a part disappearing (left) and appearing correctly (right). When ...
    • Toolbox Release Notes | Build 24.1.1010.641

      The following release notes apply to Toolbox build 24.1.1010.641 Biesse Winstore Fix Several issues with the Biesse Winstore plugin have been resolved: There was an issue that would sometimes occur wherein materials that were intended to stack wound ...
    • Toolbox Release Notes | Build 24.1.1001.641

      The following release notes apply to Toolbox build 24.1.1001.641 HBore Toolfile Fix Fig. 1: The location in the Toolfile UI where the error would occur. There was an issue reported with the functionality of the Horizontal Boring Machine setting in ...