3 Replies Latest reply on Dec 18, 2015 1:00 AM by alangodfrey

    Bug in Conditional Formatting of Text Colour?


      We have a report layout that shows the data for a patient.  It is convenient to have a printable data-collection sheet in exactly that same format.  Rather than create two layouts (one with the patient's data, and the other exactly the same, but blank) we only use one layout.  The print script has a ScriptParameter: if we want a blank report it is set to $BlankYesNo = "Yes".  The data fields are conditionally formatted to make their text colour white if the ScriptParameter is "Yes", so we have an easy way to generate a clean data-collection print-out.

      Or so we thought.  It seemed to work well, until one time we had spurious data appear in the 'blank' print.  I now understand that the conditional formatting rule over-rides the normal field setting of black text colour to white if the ScriptParameter is "Yes" - but if someone has re-formatted some of the entered text to be any other colour the conditional formatting is ignored - it prints all the data in the red or grey or whatever they have changed the data format to be.  The data-entered text colour has to be unmodified, or else the conditional formatting will not over-ride it.

      This has proved a trifle embarrassing.  Maybe I missed it, but I don't see any reference in 'Help' to suggest that the conditional format condition will not override user-specified options.

      Is this just me, or could I call that a 'Bug'?

        • 1. Re: Bug in Conditional Formatting of Text Colour?

          Hi Alan.  This is standard FM behaviour.  See this quote from:  Formatting text



          text that has a different format to existing text keeps its formatting. To change pasted text format to the existing text format, choose Edit menu > Undo Formatting immediately after pasting the text.



          There are ways to deal with this.  My favourite would be:

          Either through scripting or from the menu - show all records, then show omitted only.  This will leave you with zero records in your found set.  Then you can print the layout with no record data showing.


          You could also use script triggers on fields to run the TextFormatRemove function over data after it is entered - but this is more cumbersome because you have to apply it to all fields on the layout.



          • 2. Re: Bug in Conditional Formatting of Text Colour?

            Thanks, Chris - the 'show omitted' is a clever trick, and of course made me realise I was over-thinking it: I should have set the print options to print an empty record.  D'oh...  I'll try both.  I don't like using the TextRemove function as it seriously does remove the user's formatting - your 'Omit' idea is what I need.


            I read your 'Help' quote; I would never have linked that to conditional formatting being ignored.

            • 3. Re: Bug in Conditional Formatting of Text Colour?

              I tried the 'Show all -> Show omitted' trick, but unfortunately if there are no records found then the 'Print' menu option is greyed out.

              We use the print to collect patient's data over several visits, potentially.  The first time we want a blank sheet, as above (well, almost...  We want it to have the business name and details in the header), and after that when we go for a follow-up visit we want to print the form showing whatever info we collected at the previous visit so we can just chase up the missing data.

              If we print using the 'Blank form, showing fields' then we lose the business header information also.

              I tried using the 'vanishing text' trick of also setting the font size to be huge, and that works too - until someone changes the text's font size and then that conditional formatting characteristic is overlooked, too, just like the colour.

              It seems a real shame; I don't like removing the user's formatting (they will have good reason to have made the text red, or larger) so it looks like we have to duplicate the layout and manage them both independently.

              We're using FM11.  Presumably FM14 users would be able to exploit the 'Do not show object if...' function to suppress the fields.