Training Partner Graphic Report–Conditional Field

A common requirement in a report is to have a conditional field. What is a conditional field? Display one value if a condition is true, else display another.

An example would be Payment Method in an invoice. If the Payment Method is a credit card, then display the credit card type, otherwise display the payment method such as Cash or Check. This will be the example used below.

  1. Open the Graphic Report you wish to edit.

    OpenReport

  2. Click on the Report Designer icon ReportDesignerIcon
  3. This opens the Editing Report window

    EditReport

  4. To have a conditional field on the report, we must use a variable. Click the Variable icon variableicon
  5. Click on the report where you would like the variable field to appear.

    variablefield

  6. You can choose what type of date (data type) the variable will display by using the String dropdown.

    variabledatatype

    Note that String is the most common data type. We will be using String in our example.

  7. Right click the variable field and select Calculations…

    calculations

  8. The Calculations dialog will appear.

    calculationsdialog

    You enter your calculation above. The information on the right-hand side are the fields you selected in the report. They can be dragged and dropped to the left-hand side to create your calculation .

  9. Below is a sample calculation from our example. 

    paymenttypeif

    Notice the semi-colon at the end.

  10. You must compile your formula to ensure it is correct by right clicking in the calculation and selecting Compile.

    compileformula

  11. Click OK on the Calculations dialog to save your change.
  12. Click the Preview tab to verify the calculation works.

    preview

Clearly, there is a lot of functionality and complexity that comes with calculations.

You can check out the System Administrator’s Guide under Graphical Reports. Specifically, look in the Code Environment section.

OSG Consulting Inc. is available for report customization.

Contact us at rfage@osgconsulting.net.

This entry was posted in Training Partner and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
*