Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
   [Expand]Getting Started
   [Expand]RichEditControl Document
   [Collapse]Fields
    [Collapse]Field Codes
      AUTHOR
      COMMENTS
      CREATEDATE
      DATE
      DOCPROPERTY
      DOCVARIABLE
      HYPERLINK
      IF
      INCLUDEPICTURE
      KEYWORDS
      LASTSAVEDBY
      MERGEFIELD
      NUMPAGES
      PAGE
      PRINTDATE
      REVNUM
      SAVEDATE
      SEQ
      SUBJECT
      SYMBOL
      TC
      TIME
      TITLE
      TOC
    [Expand]Format Switches
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Printing
    Spell Checking
    AutoCorrect
    Mail Merge
    Restrictions and Protection
    Syntax Highlighting
    Traversing the Document
   [Expand]Visual Elements
    Services
    Events
    Commands
   [Expand]Member Tables
    Keyboard Shortcuts
    HTML Tag Interpretation
   [Expand]Examples
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

IF

IF

Mixed field

{ IF Value-1 Operator Value-2 field-argument-1 field-argument-2 }

Compares the values designated by Value-1 and Value-2, using the operator designated by Operator. Value-1 and Value-2 can be literals or merge fields. For example, the field code

{IF {MERGEFIELD Order} >= 100 "Thanks" "The minimum order is 100 units" }

specifies that if the customer order is greater than or equal to 100 units, the result is "Thanks"; but if the customer order is fewer than 100 units, the result is "The minimum order is 100 units".

You can use the IF field with MERGEFIELD fields. The following statement illustrates this. If the current data record contains different values in HomeAddress and CompanyAddress fields, RichEditControl prints the value of the PresidentName field that is the first set of text in quotation marks. Otherwise, it prints the second set of text in quotation marks that is the value of the OwnerName field.

{ IF {MERGEFIELD CompanyAddress} <> {MERGEFIELD HomeAddress} "{MERGEFIELD PresidentName}" "{MERGEFIELD OwnerName}" }

Important

Do not use the IF field in headers or footers if the condition is based on the PAGE and NUMPAGES field values. The field value can be incorrect due to limitations of the current layout calculation.

How would you rate this topic?​​​​​​​