Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
OpenUtilities
  • Product Communities
  • More
OpenUtilities
OpenUtilities Wiki Control number precision on reports
    • Sign in
    • +OpenUtilities
    • +Bentley sisHYD Multi Utility
    • Design Features - promis.e Functionality - Promis.e Standard
    • +OpenUtilities Substation
    • Promis.e Paths
    • -Promis.e Wiki
      • +CONNECT Edition - Promis.e
      • About Promis.e
      • +Administration Features - Promis.e
      • +APIs_VBA - Promis.e
      • +Automation Features - Promis.e
      • +Component Features - Promis.e
      • +Component Management - Promis.e
      • +CONNECT Services - Promis.e
      • +Data Manager - Promis.e
      • +Database Platform Support - Promis.e
      • +Display - Promis.e
      • +Drawing Management - Promis.e
      • +Engineering Design Considerations - Promis.e
      • Error - Object reference...General
      • +Find_Replace - Promis.e
      • Finding the Tutorial
      • +Installation_Configuration - Promis.e
      • +Interoperability - Promis.e
      • +Licensing - Promis.e
      • +Maintenance Features - Promis.e
      • +Migration - Promis.e
      • +OS Support - Promis.e
      • +Panel Layout - Promis.e
      • +Performance - Promis.e
      • +PowerPlatform Support - Promis.e
      • +Print_Publish Features - Promis.e
      • +ProjectWise Integration - Promis.e
      • Promis.e Help file
      • +Reports_Output Features - Promis.e
      • -Template Management - Promis.e
        • +Graphical Plan Template Designer - Template Management - Promis.e
        • -Report Template Designer - Template Management - Promis.e
          • Add leading zeros to numbers on reports
          • Before Print scripts for report templates
          • Concatenating fields on report templates
          • Control number precision on reports
          • Desired Data Field Not Listed in Report Template Designer
          • Display current date and time on reports
          • Quantified BOM report with device IDs on a single line
          • Removing Terminal CP Text from Wire Lists
          • Replacing caret characters on reports
          • Report Page Number Format
          • Report Template Designer
          • Rounding up quantities on BOM reports
          • Sortable Quantified BOM Report
      • +Text Tools - Promis.e
      • Training FAQs
      • +Wire Numbering - Promis.e
      • +Wiring Features - Promis.e
      • +Project Management - Promis.e
      • Promis.e Title
      • Working from home with Promise.e
    • Replace Family - Find_Replace - Promis.e
    • SQL Server Login

     
     Questions about this article, topic, or product? Click here. 

    Control number precision on reports

      Product(s): Promis.e, Bentley Substation, Bentley Raceway and Cable Management
      Version(s): through 08.11.13.140
      Environment: N/A
      Area: Template Management
      Subarea: Report Template Designer

    Background

    This document describes how to the precision (decimal places) of numbers on reports.

    Steps to Accomplish

    Copy the following script and paste it as the contents of the BeforePrint script for the table cell or label that displays the number:


    double number;
    string value = (sender as XRLabel).Text;

    bool result = double.TryParse(value, out number);
    if (result)
    {
       (sender as XRLabel).Text = number.ToString("#.00");
    }
    else
    {
       (sender as XRLabel).Text = value;
    }


    Notes:

    The "#.00" argument in the script sets the number of digits to 2.  Add or remove zeros to match the desired number of decimal places.

      Original Author: Matt_P
    • Template Management
    • Report Designer
    • promis.e
    • Reports - Output Manager
    • how to
    • Report Template Designer
    • Bentley Substation
    • en
    • bentley raceway and cable management
    • Reporting
    • Share
    • History
    • More
    • Cancel
    • Matt_P Created by Communities MVP Matt_P
    • When: Mon, Dec 18 2017 1:06 PM
    • Satish Saptasagar Last revision by Bentley Colleague Satish Saptasagar
    • When: Fri, Apr 3 2020 9:48 AM
    • Revisions: 2
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2021 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies