Method Community

 

Change report field format based on contents

Last post 04-08-2015 8:03 PM by ghawton. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-07-2015 8:29 PM

    Change report field format based on contents

    Is there a way to highlight a field, or change a font based on the field's contents?  It's easy to change background color or modify the font for an individual field, but what if I only want those changes to appear if the field contains a specific text?  I'd love to highlight certain exceptions on a field report if possible.

    Thanks!

  • 04-08-2015 11:38 AM In reply to

    Re: Change report field format based on contents

    Answer

    Hi ghawton,

    You can accomplish this using conditional formatting. I recommend that you watch the video at the bottom of the article so that you first understand what conditional formatting is and how to implement it. Once you have done this, you can create your own formatting rules that apply formatting when the condition is true.

    If the condition of the rule is based on data from a line item, you will need to make sure that you select the Data Member Invoice.InvoiceLine.Invoice in your rule. Then, if you want to check if the Item Name is ‘Consulting Service’ for example, you can use the condition editor to create the following rule:

    [Item] == 'Consulting Service'

    Give this a shot and let me know if you have any other questions.

    I hope this helps.

    -Audisho

    Audisho Sada
    Product Manager
    Method:CRM
    a.sada@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 04-08-2015 1:46 PM In reply to

    Re: Change report field format based on contents

    How can we do this in OnBeforePrint events?  I've got some complex formulas to use to change the background colors of certain derived (calculated) values.  The values of these "cells" are not tied to a table field, they are completely calculated within OnBeforePrint events.   I'm going to try using conditional formatting right now anyways.  I am sure there is something like: MyValue.text.forecolor in xtrareports that can be programmatically controlled.  Each of my cells in a summary band has a different formula for determining background color.  What is the vb syntax for changing the background color or, say, Class1Sum.text?   Class1Sum.text is calculated purely in VB code in OnBeforePrint events.

    Thanks.

  • 04-08-2015 8:03 PM In reply to

    Re: Change report field format based on contents

    Method_Audisho:

    If the condition of the rule is based on data from a line item, you will need to make sure that you select the Data Member Invoice.InvoiceLine.Invoice in your rule. Then, if you want to check if the Item Name is ‘Consulting Service’ for example, you can use the condition editor to create the following rule:

    [Item] == 'Consulting Service'


    Audisho--thank you!  This part was the part that I really needed to format the Work Orders as we need them.  I adapted what you said here to use ActivityJobItems.Activity as the Data Member and it works perfectly.

Page 1 of 1 (4 items)