Formatting expression

The format of the data is very important for the design and clarity of the report. All the values must be expressed in their proper format.

The date value in our current report is showing as M/D/YYYY 12:00:00AM. We may want to get rid of the time in our date; unless, of course, time is required in our report.

  1. Right-click on the [Date] cell and select Expression… to display the Expression Builder dialog box:
    Formatting expression
  2. The default expression for the Date is Fields!Date.Value. Change that to:
    =FormatDateTime(Fields!Date.Value,DateFormat.ShortDate)
    

    The FormatDateTime function, with its argument DateFormat.ShortDate, converts our date to short date format.

    Formatting expression
  3. You can also include literals in the expression. Let's add the literal "SO" prefix to SalesOrderID (that is, SO51061) like this:
    ="SO" & Fields!SalesOrderID.Value
    
  4. Let's also format the two Dollar amounts in the report; Unit Price and Line Total.
    =FormatCurrency(Fields!UnitPrice.Value)
    =FormatCurrency(Fields!LineTotal.Value)
    
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.90.182