4 Replies Latest reply on Jun 26, 2013 3:16 PM by jwsmall

    IWP with text formatting functions, unstored container calculations

    jwsmall

      Summary

      IWP with text formatting functions, unstored container calculations

      Product

      FileMaker Pro

      Version

      12.0v4

      Operating system version

      OS X 10.8.4

      Description of the issue

      In Filemaker Pro, I can see the text formatting of an unstored number calculation field in a related table, and an unstored container calculation field from the same table (to get around Instant Web Publishing not supporting conditional formatting, I'm trying to get button color, and text formatting, by calculations).  But in Instant Web Publishing, the same layout only shows the number from the calculation field (no text formatting), and won't show the container calculation at all.

      Steps to reproduce the problem

      Table A:
      - Field 1: An unstored calculation field, returning a number, formatted a specific way for different values
      - Field 2: An unstored calculation field, returning a different container for different values of the first calculation

      Table B:
      Relates to Table A.  A layout based on Table B shows the two calculation fields in Table A.

      Expected result

      The layout based on Table B should look the same in Filemaker Pro and Instant Web Publishing

      Actual result

      In Instant Web Publishing, in the layout based on Table B, Table A::Field 1 only shows the number, with no formatting.  Table A::Field 2 doesn't show any image

        • 1. Re: IWP with text formatting functions, unstored container calculations
          philmodjunk

               Make field 1 a calculation that returns TEXT, not number as the formatting probably is adding text (currency symbols maybe?) to the result.

               If you check the layouts from FileMaker instead of a web browser, does the calculation with a container type result work?

          • 2. Re: IWP with text formatting functions, unstored container calculations
            jwsmall

            I'm sorry, I should have clarified.  Field 1 is an unstored calculation field, and is set up to return text.  It is defined as: 

                 If ( Get ( FoundCount ) > 0 ;

                 TextColor ( 

                 TextStyleAdd ( Get ( FoundCount ) ; Bold )

                 ; RGB ( 169 ; 0 ; 25 ) ) 

                 ; Get ( FoundCount ) )

                 Field 2 is also an unstored calculation field, returning a container.  It is defined as:

                 If ( Get ( FoundCount ) > 0 ; Globals::Red ;

                 Globals::Gray )

                 //Globals::Red is a global container field containing an image of the shade of red I want to show as a button color.

                 //similarly, Globals::Gray is the shade of gray I want as a button color

                 These fields do appear correctly in their layouts when viewed from FileMaker.  But from the web, Field 1 just returns the found count, with no formatting, and Field 2 returns a 'broken image' icon.

                 Please let me know if there's anything else that would help with troubleshooting (details of relationship from Table A to Table B, file structure, etc).

            • 3. Re: IWP with text formatting functions, unstored container calculations
              philmodjunk

                   Do "Globals::Red" and "Globals::Grey" have global storage specified?              

                   Have you checked from a CLIENT fileMaker pro system to make sure that they have the expected values? (When hosted, changes made to a global field on a client are not retained when the client closes the file nor are the changes visible to other clients.)

              • 4. Re: IWP with text formatting functions, unstored container calculations
                jwsmall

                     Yes, they're both specified as global storage.  And I can't check from a client FM Pro system, but from FM Go on my iPad (accessing the file my laptop is hosting), both Field 1 and Field 2 are rendering correctly in the layout.  Besides, the hosted UI file (I'm using a data separation model, where the file containing all the records is also hosted, but all layouts are in the hosted UI file) doesn't have any layouts to even see the Globals::Red or Globals::Gray fields, so they're definitely not changing them.

                     I just discovered an interesting thing about Field 1 - a button on a layout whose text is a merge field of Field 1 will only show the found count, without any formatting, when viewed in IWP.  However, a merge field of Field 1 by itself shows the proper formatting when viewed in IWP.  Is that a documented bug?