Storing a conditional formatting formula in a variable

I have a conditional formatting formula that exceeds the 393 character limit for Word fields. I've placed the formula directly into the template table, and it works correctly. But now, of course, there are several hundred characters of formatting information in that cell, along with the data field. Not pretty.
Is there a way to store that long formula into a variable, and then refer to that variable as the conditional format? I'm getting stuck on the right-arrow tags (>). I can't figure out how to include those in the string and store them in the variable.
Here's a simplified example of what I'm trying to do:
<?xdoxslt:set_variable($_XDOCTX,'myvar',"<?if:number(Sales) gt 1000000?><?attribute@incontext:color;'red'?><?end if?>")?>
The inclusion of the right-arrow tags (>) in the string causes a failure when attempting to Preview. If I replace all of the right-arrow tags with something else, like the number 8 ...
<?xdoxslt:set_variable($_XDOCTX,'myvar',"<?if:number(Sales) gt 1000000?8<?attribute@incontext:color;'red'?8<?end if?8")?>
... the string is stored in the variable, and I can refer to it in the template table by using <?xdoxslt:get_variable($_XDOCTX,'myvar')?>. It's useless, of course, but it works correctly. The string is stored in the variable, and the contents of the variable appear in the template.
So how can I imbed the right-arrow tags in this text string? Use an escape character? Imbed the ASCII code? I'd do either of those in a heartbeat if I could figure out the right syntax.

Related information is available at:
Where to put xsl:variable definition

Similar Messages

  • Error while processing conditional formatting formula in crosstab

    This conditional formatting formula must return one of the following Color Constants: ' A number, currency amount, boolean, date, time, date-time, or string is expected here. Details: errorKind
    The above error is displayed on the the Business Objects Report Server when running my report.
    The XI server version information is as follows:
    BusinessObjects Enterprise XI Release 2
    Business Objects
    11.5.0.3135
    20060628
    Crystal Reports XI Release 2
    Business Objects
    11.5.0.31327
    20060628
    My IDE is Crystal Reports 2008.
    The error is being generated for the following conditional formatting formula which is in my crosstab:
    evaluateafter ({@concatAppTypeAppMethod});
    if CurrentRowIndex = 1 then
        color(0,153,153)   
    else if CurrentRowIndex = 2 then
        color(168,146,101)
    else if CurrentRowIndex = 3  then
        color(0,51,153)
    else if CurrentRowIndex = 4  then
        color(204,51,51)
    else
        color(153,153,153)
    This formula is applied via the Crosstab "Format Field>Font" tab.  In the report developer (Crystal 2008) the report runs without error.  When deployed to the server it fails with the above error.
    Heres the details of {@concatAppTypeAppMethod}:
    whileprintingrecords;
    "Designs filed " + {Command.APPLICATION_METHOD}
    The crosstab is structured as:
    Row = {@concatAppTypeAppMethod}
    Column = {@getMonth}
    Summary = Count of {@concatAppTypeAppMethod}
    Details for  {@getMonth}:
    right(totext(year({Command.ACN_COMPLETED_DATE}),"#"),2) + totext(month({Command.ACN_COMPLETED_DATE}),"0#")
    The above functions Row i.e. {@concatAppTypeAppMethod} and {@getMonth} use fields from the SQL command. 
    {@getMonth} parses the ACN_COMPLETED_DATE field, obtains the record month and year and concatenates these as a string which can be displayed as follows in the crosstab:
    May-08, Jun-08 etc.
    {@concatAppTypeAppMethod} parses the APPLICATION_METHOD field and obtains the application filing method i.e. Online or Internally and concatenates the pretext "Designs filed " to the filing method (also a string).
    I have tried various combinations of whilereadingrecords, whileprintingrecords and evaluateafter() with no success.  The problem occurs because the conditional formatting formula is being executed before the records being formatted are ready. 
    I believe this is a problem with the crystal reports software and/or XI server. 
    Please prove me wrong.

    Hi Raghavendra,
    Thanks for your prompt answer!  Can you confirm?  Is it because I'm using calculated members in the report and these are not support by the XI server specified in my error report above?
    If so, do you have any suggestions with regard to how I might be able to create a graph with the following attributes:
    Show summary (count) of records per month per application method (i.e. online or internal. this is a database field retruned by the SQL command).  In addition I need to add a series to the graph that shows the totals number of records per month irrespective of the relative application method (i.e. sum of online and internal) and finally I need to show the total number of online applications (i.e. application method = online) as a percentage of the total number of applications for the month.

  • Conditional formating based on excel formula

    Hi experts!
    I have a problem with BPC formatting. Under my EVDRE expansion, I inserted a column to validate some data before sending it. The value of this formula can be TRUE or FALSE and it validates each row of the expansion.
    Now, if the value is false, the row or at least some fields of it must turn red so the user knows were are the mistakes.
    I have defined under the format range an entry for the heading to evaluate in rows and in format I create the next conditional formatting:: =$I38 = FALSE ---> background red.
    When I push the refresh button, the format applies to al heading under the expansion, but the conditional format formula changes to =$I1064034 = FALSE
    If I lock the row number, it won't iterate for each row and the format will be based just on one cell instead of one cell per row.
    ¿Any ideas? ¿Other ways to achieve this? I've also tried to format the cell inside the expand and eliminate the entry on the format range but it doesn't expand to the rest of the cells...
    Thanks in advance

    Hi Nilanjan!
    Thanks for the answer, the individual conditional formatting is working fine!
    The reason why it wasn't working the first time was because it's incompatible to do individual conditional formatting with conditional formatting on format range.
    I gues I'll have to do all the formatting on individual cells...
    Thanks agains!

  • Conditional format in cross tab

    Post Author: RobotSlave
    CA Forum: Charts and Graphs
    Hello All
    Crystal 2008 12.0.0.549
    I have a crosstab report in that repeats in each GF1 that displays values for several variables over an eleven month span, for instance a shortened data set might look like this:
                           FEB     MAR      APR       MAY ....
    Claims             1233     876         666         888  ....
    sold                 987       987         7 7         8 888  ...
    etc...
    I want to display conditional formatting such that if a value in the claims row is over 800, make the font RED for that column only. When I use a conditional formatting formula in the format editor font dialog, it makes the whole row red, when the values clearly do not all meet the required "800". I have experimented with making certain my value is a number and not a string, and I'm stymied. Does anyone have any input?

    Post Author: rsvn
    CA Forum: Charts and Graphs
    use formula field. Write your condition in that formula field and in select the display string option of the column in the report.Make the display string output as the output of formula field.for eg. @formula -
      Formula Field if e>800 then   conditionelse    condition; Number -
    column in field. Display string option (at the bottom of the field format object --general tab) map the output of the formula field

  • Conditional Formatting - change color for matching cell

    I have two sheets, Sheet1 and Sheet2.
    Sheet1 contains the following data:
    abc
    def
    ghi
    jkl
    mno
    pqr
    stu
    vwx
    yz
    Sheet2 contains the following:
    abc
    ghi
    jkl
    mno
    pqr
    yz
    I want to apply conditional formatting in Sheet1 for matches in Sheet2, so that for each match, the cell's fill color is changed to, say green.
    I select the entire range in Sheet1 and as a New Formatting Rule, choose Cell Value equal to = Sheet2!$A$2:$A$6
    However, this throws the following error:
    "This type of reference cannot be used in a Conditional Formatting formula.
    Change the reference to a single cell, or use the reference with a worksheet function, such as =SUM(A1:E5)"
    Any help here is greatly appreciated. Thanks.

    Use the formula:
    =ISNUMBER(MATCH(A1,Sheet2!$A$1:$A$6,0))

  • Variable conditional formatting?

    I've set a rule in a cell and now want it to work on a column against a variable cell how do I do this?
    Selling price
    Price by time Average
    £5.00
    £3.50
    £5.00
    £3.50
    The background of the cell changes red more, green less, but how do I now copy this down the column and change thecell that it referances?

    /numbers does not have this functionality directly built in.  You can get a similar result by making a separate table that performs the shading and is placed BEHIND your existing table.  The existing table should be adjusted so it has not fill.
    The new table (Let's call it a shader table) has calculations that are used as the conditional format information.
    In this case... the shader table contains the formula:
    A1=Data :: A2-Data :: B2
    Here is  how it looks once the shader table is placed behind the transparent data table:

  • How to reset a count variable in a conditional format trigger

    I am using a conditional format trigger to eliminate sections of a report where there is no data. The trigger is automatically generated by reports (shown below). the condition is :com_count = '0' therefore no record, no display of section - if :com_count>0 then data present and display record.
    It works fine eliminating the sections - until actual data is found - and count is set to 1 and it displays the record. The problem is that once :com_count >0, then the section displays throughout the rest of the report whether there is actually data or not.
    It seems that :com_count needs to be reset to 0, but when I try to do that, it throws an error stating that :com_count is a read only variable.
    I am new to PL/SQL so can anyone suggest how I can reset the :com_count to 0 each time the trigger fires with :com_count = 1?
    Any help would be appreciated. Thanks,
    Glenn
    The conditional format trigger is:
    function M_G_COM_RANK_GRPFRFormatTrigge return boolean is
    begin
    -- Automatically Generated from Report Builder.
    if (:COM_COUNT = '0')
    then
    return (FALSE);
    end if;
    return (TRUE);
    end;
    The count
    It works perfectly

    wher is your COM_COUNT defined?
    If should be defined in the datamodel in the "mastergroup" of the "detailgroup" of which you want to count the records.
    If you do so, there is a property of the item "Reset at" ( which is by default set to "Report") and you then can change it to the name of the mastergroup. So every time a new record is "active" in the mstergroup, the count-item will be reset to 0.
    hope this helps

  • Using Session Variable with Conditional Formatting Filter

    Hi,
    I'm trying to add a condition to my report in order to flag all opportunities that have a close date that is in the past. The way I'm trying to do this is by adding a condition to say when close date is less than current_date, flag the column with an image.
    Issue I'm having is that the filter window within conditional format tab appears to not have the session variable option as you do when you create a filter on a column the normal way. A colleague told me to use an SQL expression, but again this option seems to be unavailable too within the conditional format tab.
    Can anybody assist please?
    Thanks

    Create a new column and write a CASE WHEN condition like case when close date < current_date then 'Y' ELSE 'N' END.
    Then on your actual date column, you can do conditional analysis based on the newly created column for values having Y then the image.
    finally, you can hide the newly created column.

  • Is there any way to use a formula or reference in conditional formatting

    I would like to use conditional formatting (or something similar) to change either the background color, or text color, of a cell. The conditional formatting in the inspector will allow you to do this using numbers or text as the condition.
    Is there any way to do the same thing using either a formula or cell reference? I have created a budget with two sheets, "Budget" and "Actual". Each sheet has two tables, "Income" and Expenses." In the "Actual :: Expenses" table I would like to be able to change the cell color depending on the difference between the Actual and the Budget corresponding cells.
    I know I can do this by making a new column "Difference" write the formula and enter conditional formatting for that particular cell, but I DON'T WANT TO!!
    Just for fun, is there any way to roll over a cell and have a info box "pop up" that could show me what the difference between the two corresponding cells is. Kind of similar to how when you roll the mouse pointer over a file the box expands to show you the entire name of the file. Not to optimistic about this one.
    Thanks

    PeterVogelpohl wrote:
    Is there any way to do the same thing using either a formula or cell reference?
    Yes, Peter. Purchase iWork 09. Numbers 09 offers conditional format vs. content of another cell.
    Jerry

  • How to get session variable value in conditional formatting

    I am trying to format my column according to value of a session variable. Normally when comparing to a static value I select value from add button and write the value. What I want is to be able to do this using a session variable. I select variable presentation and as the variable expression I tried MYDAY, NQ_SESSION.MYDAY, VALUEOF(NQ_SESSION.MYDAY), VALUEOF(MYDAY) but nothing works. By the way it is a date value, I don't know it makes any difference
    Any help would be appriciated

    I am surprised that it is not possible to select a session variable when you want to use conditional formatting. Apparently you can only base conditional formatting on presentation variable or values within a column.
    As a workaround you can create an extra column in your request and use a CASE WHEN statement, where you compare the value of the date with the session variable. Then you can base your conditional formatting on that column.
    Regards,
    Stijn
    Message was edited by:
    Stijn Gabriels

  • Is it possible to use repository variable in conditional formatting

    Is it possible to use repository variable in conditional formatting . if no then is there any workaround for implementing the same....
    Also i came across a sql of an init block.. which goes like 'exec OracleBi..procedure_name'
    Is 'OracleBi..' a keyword or something like that....

    Refer http://www.biblogs.com/2008/09/03/obiee-repository-variables-filtering-and-conditional-formatting/
    Init blk is calling any procedure here with name OracleBI here...no any specific significance.
    Hope this help
    Edited by: Deepak Gupta on Aug 12, 2011 8:27 AM

  • Can conditional formatting detect formulas?

    I have a spreadsheet for home accounts/debts etc, and I like to put forward calculations in columns so I can get an idea of how long it will take to pay off debts. These forward calculations are formulas based on APRs etc, and I manually format them in grey italics. When a bill comes in with the actual amount on it, that formula gets replaced with the bill amount, and I switch the format to black plain text so I can see it's an actual value.
    Is there any way, using conditional formatting or otherwise, I can automate this so that when I type in a real value it can detect it's not a formula and reformat the cell?
    Thanks!

    No.
    Conditional format rules depend on comparing the value contained in the cell, and pay no attention to how that value got there.
    That said, it might be possible to examine the value and determine whether it was entered directly or formula generated. If the value in the cell is NOT equal to the value in the cell rounded to two decimal places, then chances are the value was generated by a formula. Not perfect, as it will not detect generated values that are exact to zero, one or two decimal places (eg. 12.00000, 12.10000, 12,12000, etc), and won't find any values where the formula itself actually rounds (as opposed to 'displays') its result to two (or fewer) decimal places.
    Here's an example:
    As indicated in column A. the values in B2 and B3 are entered numbers, those in B4 and B5 are calculated. Column B is formatted to DISPLAY these numbers as Currency, with the usual two decimal places.
    Column C uses the formula =B to transfer the  actual values in column B. Formatting is set to automatic.
    Column D uses the formula =ROUND(B,2) which rounds the values in column B to two decimal places. Formatting is set to automatic, so what is shown is the actual value.
    The conditional formatting rule, shown for cell B5,  compares the actual value in column B with its rounded counterpart in column D. If they are the same, the assumption (wrong, in this case) is that the value was entered, and the rule applies bold style to the text and a light grey fill to the cell. If they are different, no change is made.
    Note that there's some tedium involved in setting this up, as the rule for each cell uses a different comparison cell, and these must be set (or reset) individually.
    Regards,
    Barry

  • Paste Conditional Format rule wipes out existing formula... & vice versa.

    As far as I can see there is no way to copy an already established conditional formatting rule onto a cell that already has a formula entered without wiping out the formula. And when you set the formatting rule first and then paste in the formula, it wipes out the conditional formatting rule.
    Surely this is not too much to ask -- or am I missing something here?

    Badunit, thank you for the info about Paste and Match Style. That works very nicely. Interestingly, I don't believe the specific use of the command for this purpose is documented in the manual, though it certainly should be.
    Yvan, I have read everything the manual has to say about conditional formatting three or four times over, and yes, I know that the function is available via the Inspector as well as under the Format menu.
    You are mistaken, however regarding copy and paste.
    Conditional formatting is indeed transferrable via copy and paste, as you will find if you try it, and as is mentioned in the manual at the bottom of page 82. And pasting a function into a cell with conditional formatting deletes that formatting. So Badunit's suggestion is the only solution to avoid having to re-enter either the formula (very large) or the formatting rules. In this instance there were 14 rules in force, and re-entering them was tedious.
    A little less rushing to judgement - and a little more courtesy, please.

  • Conditional formatting based on formula

    I would like to highlight values in a column that are the maximum. If using Excel, would do a conditional format such as Cell Value Is, equal to, =max(a:a)
    Has anyone made Numbers do this?

    Here is an example of one of the "cheesy" methods, it is a clever workaround:
    First image shows two overlapping tables. 2nd Image shows the underlaying table creating the highlights.
    Regards,

  • Excel 2013 Object Model - Conditional Formatting

    1) I'd like to understand the new Excel object model more thoroughly. Can anyone suggest a book?
    2) Are the formulas and/or format settings for conditional formatted cells stored in the object model or in the workbook?  I'm guessing the workbook.
    Thanks.
    Ross

    1) The object model for Excel 2013 is the same as that for earlier versions, with a few additions and omissions.
    See http://spreadsheetpage.com/index.php/books for lots of books about Excel, including programming.
    2) Conditional formatting is stored in the workbook, but you can manipulate it with VBA.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

Maybe you are looking for

  • Why isn't junk mail going into its folder

    I get a lot of spam and a few weeks ago, it went into my junk folder which pulled if off my iphone and ipad. Now the junk mail just stays in the inbox. What is causing that or this? Can I fix it?

  • Failed boot with flashing folder, but boots from USB

    Hi, I was recently running an app from the App Store, when my computer froze. I got the classic spinning beach ball on the app, so went to the dock to ctrl-click the dock application icon to force quit it. This then crashed my dock. After some time I

  • SSD in Mini-PCIe slot on mid-2009 MacBook Pro

    Hi all I've just bought a mid-2009 MacBook Pro (the one with a 2.8GHz Core 2 Duo and 9400M and 9600M GT). I want to add an SD to the current mechanical storage to install OS X and programs on. I don't want an Optibay as I would rather keep the optica

  • Double Page Load on call javascript method

    I have implemented a tree component(which I have the folders). When I clic on the tree I have to expand or close it, so I have implemented a javascript method on clic: <af:tree value="#{bindings.OpcionesPadreView1.treeModel}" var="node" rowSelection=

  • Vista will not start with 6 GB of ram (worked with 2GB)

    Hello, I recently upgraded from a P6n to a P7n and while I was at it, I purchased 4 more GB of ram, bringing my new total to 6GB of ram. I installed vista, it detected the ram, everything worked great the first night. The next day I tried to start up