1 Reply Latest reply on Sep 4, 2010 3:10 AM by LaRetta_1

    How to display one of two fields in report?

    HugoLidia

      Title

      How to display one of two fields in report?

      Post

      FMP v11.02 Using XP & SP3

      I have a layout that displays one line of data of each client's policy, but I want the house details to be displayed if the policy type is "house" and the Car registration to be displayed if the policy type is "Motor". 

      All the database fields can be accessed by the report, due to the DB links/defined relationships.

       

      How do I do this?

       

       

        • 1. Re: How to display one of two fields in report?
          LaRetta_1

          If you have prior to vs. 11 then you will need a calculation.  Calculation approach would be:

          Case ( PolicyType = "House" ; housedetailsField ; carregistrationField )

          If you have vs. 11, then don't create a needless calculation which only clutters your field definitions and uses needless resources, instead use layout variables (see demo file):

          http://www.4shared.com/file/Tbf9N8xe/LayoutVariable.html

          You can use Let() within a conditional format object (see 'I declare variables' on layout).  Be sure it is sent to the back in stacking order (Arrange > Send to Back).  This technique has replaced many of my calculations.  If used for display when data-entering then triggers or refresh are needed but it is well worth it.  And for simple reporting such as this, the method simply rocks because you can actually write the calculations right on the layout - complex calcs which you would never need in your solution otherwise.