1 Reply Latest reply on Dec 11, 2011 3:14 PM by LaRetta_1

    limiting reports

    RMckeown

      Title

      limiting reports

      Post

      Hi

      I'd like to limit a report depending on user input variables.

       

      For instance, a report where the "ready to collect" field is empty, and the "to be ready" field is tomorrow,

      A second set of selections could say, only consider records with a "saledate" from 01/12/2011 to 31/12/2011

      Is this possible?

      Any tutorials or samples available?

      Many thanks 

        • 1. Re: limiting reports
          LaRetta_1

           

          Hi RMckeown,

          What you need to do is perform a Find.  You can read up on it in your FM Help.  But is an example (in pseudo-script):

          1) a report where the "ready to collect" field is empty, and the "to be ready" field is tomorrow,

          Go to Layout [ layout based upon the table occurrence where those fields exist ]
          Enter Find Mode [ uncheck pause ]
          Set Field [ YourTable::ReadyToCollect ; "=" ]  // the equal signifies blank value
          Set Field [ YourTable::ToBeReady ; Get ( CurrentDate ) + 1 ]
          Set Error Capture [ On ]
          Perform Find[]
          If [ not Get ( FoundCount ) ] // no records found
          Show All Records l
          Go To Layout [ original layout]
          Else
          # records found so do whatever you wish with your records, such as to go the report, sort and go to preview mode
          End If

          If you wish to ask for dates from a User, switch them to a layout where you have placed two global date fields and let them enter their values.  This is always better than hard-coding the dates.  You can also create script to allow User to specify if they want 'this month', 'last month' etc