6 Replies Latest reply on Jun 9, 2010 12:51 PM by Bonnerbl

    User selected report fields

    Bonnerbl

      Title

      User selected report fields

      Post

      I have a report layout with six column headings and six associated fields (column1 thru column6, and field1 thru field6). And, each of the column headings has an associate value list. I want the user to be able to decide what information will appear in each column of the report. The user does this by selecting a value in each of the column headings.

       

      So my script steps should say something like if the value in column header 1 is "Account Number" then put the field name for account number in field 1. If the value in column header 2 is "Balance" then put the field name for the customer's balance in field 2.

       

      I tried

      Set Field By Name [Customer::field1; If (Customer::column1="Account Number";Customer::Account;"")]

      and also

      Set Field [Customer::field1; If (Customer::column1="Account Number";Customer::Account;"")]

       

      I think I am missing some basic understanding of how to change dynamically the field names in the body of a report.

       

       

        • 1. Re: User selected report fields
          aammondd

          As long as this is simply report values you can handle it this way

          You can add some select fields and change these columnfields to calculation resulting in text 

          The calculation can be set to

           

          Case [Colunm1Select = "Account" ; AccountField;

                    Column1Select = "Name"; Namefield;

                   etc ...;""]

           

           

           

          • 2. Re: User selected report fields
            Bonnerbl

            Let me back up a little. I have a job table and an item table. There are many items per job.

             

            The job table has these global fields - column1, column2, column3. Those fields also correspond to the column headings in the report. The user selects a value from a value list for each column.

             

            The item table has these fields - field1, field2, field3 corresponding to the column fields in the job table.

             

            The report has a header with the columns in it and the body has the field1 etc in it.

             

            The user selects a value for each column from a value list.

             

            When I used the CASE statement in the field definition for field1 etc. it worked fine -BUT- the values were inserted only if the item record itself was modified. I need those values to be inserted whenever the column1 etc are changed.

             

            What I'm expecting to happen is the user selects the fields to be used for each column. FileMaker then creates a report with those fields.  Your solution would work if the item fields were filled in whenever the job/column fields were changed.

             

            What am I missing?

             

             

            • 3. Re: User selected report fields
              philmodjunk

              "Your solution would work if the item fields were filled in whenever the job/column fields were changed."

               

              If your column header fields are global and you put the suggested case function as the definition of a calculated field. That's exactly what should happen. A change to the global field will automatically update the values seen in the corresponding calculation field. (You'll need one such calculation field for each column of your report.)

              • 4. Re: User selected report fields
                Bonnerbl

                I made a dumb mistake in my definition of the column fields. Is partially working. I need to think about it overnight. <grin>.

                Thanks.

                • 6. Re: User selected report fields
                  Bonnerbl

                  Thank you