9 Replies Latest reply on Apr 23, 2012 12:10 PM by karendweaver

    Sliding Tab Controls

    christopherc

      I have a tab control on a report layout that has two tabs. One tab is blank and the other tab contains a label and a text field. I have a script the selects the proper tab upon record load, depending on whether data is present in the text field or not. I would like the tab control to 'slide' so that nothing appears if the empty tab is displayed, or if there is data the label and text box with the text box shrunk to the actual size of the data contained in it. Is this possible. What I really would like to accomplish is not to display a label if there is no associated data. I have already created two separate report layouts depending on whether there is data in a portal, and I would like to avoid having to create multiple layouts depending on what combination of data is present.

       

      I am also having a second problem on the same report layout using a merge field. I created a 'city state zip' merge field using data from a related table. Instead of displaying the related data, I am seeing the table name along with the current time displayed. If I create a merge field on the same layout using data from the primary table the merge field works fine. I saw a thread where someone else was having the similar problem, and the recommendation was to use a calculated field. Is there an issue with using fields from a related table in a merge field?

        • 1. Re: Sliding Tab Controls
          karendweaver

          Hi Christopher

           

          There isnt a native "slide" or "resize" for the field or the tab controls.  You can simulate some of what you want using conditional formatting.

           

          Place a text box on top of the information you want to hide ( a single space inside the text box, resize to any height and width ) and put conditional formatting on the text box where if there is no data in the field, there is a fill color matching the background of the items that you want to hide.

           

          As far as adjusting the size of the field according to data within - are you just displaying the data or do you need the user to interact with it?  (that is, enter data, perform finds, etc.)  If this is a printed report and you are just displaying data, then you can use a merge field with no background color.  Merge fields can slide in preview mode, but not in browse mode.

           

          The problem you are having with the merge field on the layout means that you have not properly formatted the merge field.  It must be formatted like <<mytable_myrelatedtable::myrelatedfield>> in order to display properly.  Since you are getting the timestamp error - you are probably either missing a carat <> on one or the other side of the merge field, or you do not have the proper field selected.  Clear the text box, choose insert merge field from the menu, and then pick the appropriate field from the field chooser instead of manually typing in the merge field.  That should work fine.

           

          Karen

          • 2. Re: Sliding Tab Controls
            christopherc

            Thanks Karen - the conditional formatting worked great and will come in really handy. I'm still not getting the merge fields to work correctly. I created a text box, inserted a merge field by selecting the field name from the inspector (City field), followed by a comma and a space, inserted a second merge field (State) in the text box using the inspector, followed by a space, and then inserted the third merge field (Zip). Nothing was 'hand typed'. Still getting time stamps. I tried creating a merge field using another related table and got the same result. Using the primary table for merge fields is working fine.

             

            When I get some more time I will try using a different layout just to see if there is something particular to the layout, and also a layout  different primary and related tables. For now, I have a calcualted field which is doing what I need.

             

            Thanks again,

            Christopher

            • 3. Re: Sliding Tab Controls
              DrewTenenholz

              Christopher --

               

              I concur with Karen about the text of your merge fields.  Somehow, you have a 'bare' double colon :: on the layout.  In fact, if you simply added this text on your layout, you should see that same time stamp as your 'improper' merge field is displaying.

               

              So, the questions is how is this happening?  Can you copy/paste the exact text which seems to be incorrectly formatted?  Can you include the exact result you see?  Maybe you have confused FileMaker with less-than-ideal field or table names.  And, as Karen pointed out, the double angle brackets << and >> are required around EACH merge field, not the entire set of text.

               

              Correct:

              <<People::CIty>>, <<People::State>> <<People::Zip>>

               

              Incorrect:

              <<People::CIty, People::State People::Zip>>

               

              Incorrect:

              <<People::CIty, State Zip>>

               

               

              -- Drew Tenenholz

              • 4. Re: Sliding Tab Controls
                beverly

                I agree with Karen and Drew, it could be an errant "::" (the insert time symbol) on the layout (as text). Also look at the NUMBER and/or DATE and TIME formatting of these fields. I've seen strange results in merge fields if the formatting is set to something I didn't plan on!

                 

                Set to format "as entered" and see it that does anything.

                Beverly

                 

                Christopher --

                I concur with Karen about the text of your merge fields.  Somehow, you have a 'bare' double colon :: on the layout.  In fact, if you simply added this text on your layout, you should see that same time stamp as your 'improper' merge field is displaying.

                 

                So, the questions is how is this happening?  Can you copy/paste the exact text which seems to be incorrectly formatted?  Can you include the exact result you see?  Maybe you have confused FileMaker with less-than-ideal field or table names.  And, as Karen pointed out, the double angle brackets << and >> are required around EACH merge field, not the entire set of text.

                 

                Correct:

                <<People::CIty>>, <<People::State>> <<People::Zip>>

                 

                Incorrect:

                <<People::CIty, People::State People::Zip>>

                 

                Incorrect:

                <<People::CIty, State Zip>>

                 

                -- Drew Tenenholz

                 

                • 5. Re: Sliding Tab Controls
                  christopherc

                  Here is an example of what I have been doing.

                   

                  The tables I have been using are "Job" and "Work Order" . I have an occurance of the Job table related to the Work Order table called Job:WO and an occurance of the table "Work Order" table related to "Job:WO"

                   

                  Job - Work Order:Job

                  and

                  Work Order - Job:WO

                   

                  In the first example I created a blank layout and selected "Job" for the layout. I created a merge field from "Job" with the fields city, state and zip and it worked fine. I created a second merge field from Work Order:Job' with the Work Order scheduled start and end dates. I got the timestamp as shown below.

                   

                   

                  Merge field with Table 'Job" defined in

                  layout and 'Work Order:job as related table

                   

                   

                  Orinda, CA 12345

                   

                  <<Work Order:Job8:25:54 AMWO Scheduled Start>> <<Work Order:Job8:25:54 AMWO Scheduled End>>

                   

                  In the example below I set 'Work Order' as the table for the layout and created the same two merge fields, this time using 'Job:WO' for the city state and zip and 'Work Order' for the dates. This time the Work Order dates displayed correctly, but the Job 'city state zip' merge field displayed the timestamp.

                   

                  Merge field with Table 'Work Order" defined in

                  layout and 'Job:WO" as related table

                   

                   

                  <<Job:WO9:00:42 AMJob City>>, <<Job:WO9:00:42 AMJob State>> <<Job:WO9:00:42 AMJob Zip>>

                  05/14/2012 05/18/2012

                  I don't think I am doing anything wrong as far as creating the merge fields go, unless I keep doing the same thing wrong. Could it have something to do with the relationships?

                   

                   

                   

                   

                   

                   

                  • 6. Re: Sliding Tab Controls
                    karendweaver

                    Christopher

                     

                    What is the literal name of the relationship you created from Work Order to Job?  It looks like you named it WO:Job - is that correct?

                     

                    You cannot use a colon in the name of a relationship.  Try WO_Job or just WOJob or something without a colon.

                     

                    Please provide a screen shot of the relationship you are trying to add merge fields from.

                     

                    Karen

                    • 7. Re: Sliding Tab Controls
                      Stephen Huston

                      If you are hand-coding the merge text rather than using the Insert menu > Merge Field... function, you may be mistyping the TO::fieldname in the brackets. If no match is found when you hand-code it, the double colons will be interpreted as a "insert time symbol" text marker.

                      • 8. Re: Sliding Tab Controls
                        christopherc

                        WOW -

                         

                        Karen, I changed the table name from Work Order:Job to Work Order_Job and the merge field worked!

                         

                        Everyone occurence of tables in my database (other than the original occurrence) uses a ":" in the name and everything else seemed to be working ujp to now so I never considered it might be a problem. I even think that I had seen the ":" used in a sample database and that's why I used it in mine.

                         

                        Thanks for clearing that up and saving me from future potential problems.

                         

                        Christopher

                        • 9. Re: Sliding Tab Controls
                          karendweaver

                          Glad it helped.  This might be a good time for you to review the FileMaker Help files on naming fields..  ;-)  When you try to name a field with a reserved name, FM will usually give you an error message, unfortunately, that does not always happen with layout names, script names, or relationship names as you have learned, because those names only cause problems in certain circumstances, such as merge fields.  However, it is best practice to avoid reserved names and characters in ALL of your naming, because you never know when it may cause a problem.  Generally, the same caveats/restrictions on field names MAY apply to naming relationships, layouts, or other objects in FileMaker.

                           

                          From the Help files: 

                          Field names must be unique, and can contain up to 100 characters. Follow these guidelines when naming fields:

                           

                          Do not use any of the following symbols and words in the field name:

                          ,(comma), +, -, *, /, ^, &, =, ≠, >, <, ( ), [ ], { }, ", ; (semicolon), : (colon), :: (relational indicator), $ (variable indicator)

                           

                          AND, OR, NOT, XOR, TRUE, FALSE, or the name of any FileMaker Pro function

                           

                          Don't begin a field name to be used in a calculation formula with a space, period (.), or number.

                           

                          Use _ (underscore) in place of a space to avoid restrictions in ODBC, exporting, web publishing, and other operations.

                           

                          If you're exchanging data with another application, check the field naming restrictions in the file formats supported by that application.

                          If you're using ODBC or JDBC to share FileMaker Pro data, avoid using SQL keywords in field names.

                           

                          Good Luck!!

                           

                          Karen