3 Replies Latest reply on Dec 16, 2010 5:50 PM by SFX

    Dynamic Reporting

    SFX

      Title

      Dynamic Reporting

      Post

      Hello everyone, 

      I'm having a hard time trying to figurate how to make a report of sales, where we want to know the sales of one salesman during a time period, both parameters must be set by the user.

      The date of sale, the name of the salesman and the sold item is store within the same table.

      I have tried to do it with a saved find but I cannot change the value of the find, I also tried to do a report using the assistant but I cannot make it to work because of the dates... anyone have an idea, I'm using FM Pro 11 Advance, with a Mac.

      Thanks in advance.

        • 1. Re: Dynamic Reporting
          davidanders

          From a Google Search


          If the Search_Day_Start and Search_Day_End fields are date fields,  I am pretty sure (I am not at my Filemaker machine right now to test  this) that you could simplify this substantially:

          # Script to search for date range
          Go To Layout["MySearchLayout"]
          Enter Find Mode[]
          Insert Calculated Result["TheDateField"; Search_Date_Start & "..." & Search_Date_End]
          Perform Find[]

          • 2. Re: Dynamic Reporting
            philmodjunk

            Set up some global fields on a layout.

            gDate_Start, gDate_End (both must be global date fields)
            gSalesMan

            Put a button with these fields to perform the following search:

            Go To Layout [//your report layout]
            Enter Find Mode[]
            Set Field [Yourtable::YourDateField ; gDate_Start & "..." & gDate_End]
            Set Field [YourTable::YourSalesmanField ; gSaleMan ]
            Set Error Capture [on] //keep "no records match" dialog from interrupting the script if no records are found.
            Perform Find[]
            Sort Records [No Dialog ; Restore]//optional, but you usally need your found records to be sorted

            If you want to get fancy, you can even use the New Window script step to pop the search layout up in a small floating window.

            • 3. Re: Dynamic Reporting
              SFX

              Thanks Phil, I wasn't able to tried it but I did it today and all went OK

              Thanks 

              Greetings