2 Replies Latest reply on Aug 9, 2012 11:50 AM by richardsrussell

    Report generating button/script


      I am looking to develop a button that when clicked runs a script that creates a report.


      I have data that was inputted monthly (e.g. Jan 2009, Feb 2009...., Jan 2010, Feb 2010...etc) into the database that shows the number of a certain part that was used in that month at a certain site.


      I want to be able to click a button to generate a report, i will then be prompted to enter the criteria that i want to be used to create my graph (e.g. the month January 2009) which will be used to create my graph using a graph design i have earlier created (this graph will show part usage quantlty on the y axis and then date used along the x axis possibly.


      Can anyone help me on how to do this??

      Any help would be greatly appreciated.


      Thank you

        • 1. Re: Report generating button/script

          First, are you able to do this manually in FileMaker by stepping through selecting the layout, Finding the records you want, sorting them, and viewing them in a graph?  Once you know all the steps you need to go through to create this report, then you are ready to create a script because all a script does is step through sequentially all of those steps you did manually.  When you write a script, you are just thinking about duplicating the steps you went through to manually create the report. 


          I'm not sure, but have you created all of the layouts and graphs you need?  If so, you are ready to tackle the script.  If not, then you need to finish getting your layouts set up properly for your report. 


          Basically, you will have a script that says:


               Go to Layout (report layout)

               Enter Find Mode

               Set Fields you want to search on

               Perform Find



          Once you have the script, create a button in the layout and attach the script to that button and you are good to go!


          FYI, I usually put the graph in the Title Footer of my report layout, but you could put it in another layout if you wish. 

          1 of 1 people found this helpful
          • 2. Re: Report generating button/script

            Perhaps the most challenging part of your requirements is providing the user with a convenient way to enter the necessary data. As you're constructing your script, insert the step "Show Custom Dialog":


            Show Custom Dialog.jpg

            Double-click on the step itself within the script and select the "Input Fields" tab, then check "Show input field #1" OR click on "Specify..." next to it and indicate what field you need data for. Then indicate, by text or calculation, what KIND of data:


            Show Input Field #1.jpg

            The result when you run the script will look like this:


            Specify Report Range.jpg

            1 of 1 people found this helpful