Format Decimal Point Precision

Before you begin

Connect to the OLE DB provider, and add the Historian database tables.

About this task

To format decimal point precision in your reports, you must convert Variant data types to Float data types in Crystal Reports. For instance, if retrieving the Value column from the ihRawData table, you must convert the values to Float. You need not perform these steps if you are working with strings.

Procedure

  1. Access Standard Report Expert, and then select Fields.
    The Fields section appears.
  2. Select Formula.
    The Formula Name window appears.
  3. Enter a name for the formula.
    The Formula Editor section appears.
    Tip: You can also access the Formula Editor section by selecting Insert > Field Object. Right-click the formula fields, and then select New.
  4. In the Formula field, enter the following text :
    if numerictext({ihRawData.Value}) then cdbl({ihRawData.Value}) else
                            0
  5. Select Save.
    You can now use the formula as a normal numeric column instead of the Value column in the report.