5 Replies Latest reply on Nov 21, 2011 2:55 PM by philmodjunk

    Evaluating Footer "//", "::", and Merge Fields from stored Text Fields…

    andrewggrant

      Title

      Evaluating Footer "//", "::", and Merge Fields from stored Text Fields…

      Post

      I would like to replace the standard footer Text field at the bottom of my reports with text stored in a Global Text field so I can dynamically change all footers in my DB without having to edit each one.

       

      When I try to add the fields' text via a Merge Field, the text appears literally rather than being interpreted.

      I would like the text within the field to be evaluated just like it is in a standard text element on a layout. The "//" Currennt Date, "::" Current Time, and the "<<Globals::Account_Name>>" merge field are showing up as:

      "Printed on // at :: by <<Globals::Account_Name>>"

      rather than:

      "Printed on 12/24/2010 at 10:30 AM by andrew-grant"

       

      Any thoughts on how to get this to work?

        • 1. Re: Evaluating Footer "//", "::", and Merge Fields from stored Text Fields…
          philmodjunk

          Don't see why that din't work for you.

          I copied the text from your post to the footer of one of my DB's, using Insert | Merge Field to add a field from the actual database instead of your field and it worked. I got both date, time and the contents of the specified field to appear. Even enclosing this text in quotes did not change that.

          • 2. Re: Evaluating Footer "//", "::", and Merge Fields from stored Text Fields…
            andrewggrant

            I can see where the confusion is. I am not trying to append the text of a field (merge field) to existing text... rather I want all of the text that would normally be put into the footer to be inserted from the Global Text Field and still have the special characters (//, ::, and Merge Fields) be interpreted as though the Global's Text was manually added to the Text Field in the footer at the time the layout was created.

             

            The intent is to make the Footer dynamic on all 200+ layouts by having the text stored in a Text field. When I add the field's text to the layout as a merge field, the special characters stored within the Global Text field are not interpreted but displayed as literal text.

             

            The text above, "Printed on // at :: by <<Globals::Account_Name>>", is all coming from the global text field, literally as displayed in the quotes.

             

            Is there a way of having the contents of a merged Global Text field interpreted rather than displayed? I have tried using the "Evaluate" function, but that doesn't work. I want the "::" to display the time that the report was printed at the bottom of the page rather than the time that the global field was populated at DB startup.

            • 3. Re: Evaluating Footer "//", "::", and Merge Fields from stored Text Fields…
              philmodjunk

              That explains it.

              You can't use a global field for this in the format that you used. The //, :: and <<mergefieldbrackets>> are symbols that are only processed as you expect when entered as actual layout text on the layout. You can copy and paste this text from one layout to the other as a way to get consistent footers on your layout--not what you wnated but an option to consider as it's easier to control the date and time formats when you use a block of layout text like this.

              You'll need to use a calculation field:

              A simplistic approach would be:

              "Printed on " & Get ( CurrentDate ) & " at " & Get ( CurrentTime ) & " by " & globals::Account_Name

              Any calculation that references a global field will be unstored and this is a requirement anyway to get the Get ( CurrentDate ) and Get ( CurrentTime ) function calls to update correctly anyway.

              There are more sophisticated approaches.

              Define 2 global text fields as Globals::FirstFooterTerm, and Globals::SecondFooterTerm.

              Then put this layout text in your footer:

              <<Globals::FirstFooterTerm>> // at :: <<Globals::SecondFooterTerm>>

              You control what text appears in the beginning and end of this layout text, but leave the layout symbol text for current date and time as layout text. This option is much easier in terms of specifying a desired date and time format, but you have to copy and paste the text from layout to layout to keep it all consistent.

              This calculation can also be used:

              Substitute ( globals::FooterText ; ["//" ; Get ( CurrentDate ) ]; [ "::" ; Get (CurrentTime ) ] )

              This allows you to use // and :: as placeholders to be replaced with the current date and time anywhere you choose to use them inside the FooterText field.

              Hmmm, I wonder if that substitute functions will work as I wrote it here... If you get large integers in place of the date and time, but the Get functions inside GetAsText functions.

              • 4. Re: Evaluating Footer "//", "::", and Merge Fields from stored Text Fields…
                andrewggrant

                Thank you for the verificaiton that it won't work. I was spinning my wheels trying to figure it out.

                 

                I wanted to overlay three transparent background text fields in the footer, each with a merge field, one left justified, one centered, and one right justified. I was then going to have the global field contain the static text and "Dynamic" data for date and time using symbols.

                 

                This would allow me to dynamically update all of my footers at any time. The effect would be that the text would seem to be updated on the left, right, and center of my footers as the needs arose.

                 

                I can still do this, but I am not able to get the dynamic Date and Time by use of "//" and "::" symbols.

                 

                Thank you again for helping me put this to rest.

                • 5. Re: Evaluating Footer "//", "::", and Merge Fields from stored Text Fields…
                  philmodjunk

                  I can still do this, but I am not able to get the dynamic Date and Time by use of "//" and "::" symbols.

                  I gave you two optiosn for doing that in my last post.

                  You could also place all three sets of footer text in the footer as layout text, but then give them conditional formats that make the layout text disappear.

                  For the Left justified layout text, you might use this conditional format:

                  Globals::FooterJustify ≠ "Left"

                  and specify a font size of 500 to make the text invisible unless the footerjustify field is set to "left"

                  Do the same but check for "center" and "right" for the other two blocks of layout text.