Leave feedback
  • Question

    StoryTellerSP5: Evaluate a cell or field value returns blank in script

Enter a new topic
  • Roberto Avalos Roberto Avalos StreamServe Employee
    0 likes 1513 views

    Hi,

    I am working on a Table in Story Teller in which I use a repeater row to display content. All content is being displayed correctly, however I am trying to modify the font dynamically based on the value of text that is displayed.

    The problem I am facing is that I am trying to evaluate the content of the cell or field and decide what font to use. However the cell value or field is blank. I know they are blank because I am logging the values. However data is displayed correctly on the table.

    In other words, if the cell or field content is equals to, for example: "Previous Bill", then I make the font bolder or I just use  a different font. Changing the font is not a problem if I add a modification variable to the Font Property. This variable would contain the font name ($font). My problem is the that the field name &DESCR1_2 is always blank no matter if I add this script to the row, individual cell or repeater (before and after)

    Log (1, "BeforeDESCR1_2=" +  &DESCR1_2);
    Switch (&DESCR1_2)
       {

            Case "Previous Bill":
            Case "Previous balance due immediately":
                       $font="Interstate-RegularCondensed";
                       break;
            default:
                     $font="Interstate-LightCondensed";
       }

        Log (1, " font =" +  $font);

     

    Thanks

    Roberto

    Thursday 10 February, 2011
  • Best Answer
    Roberto Avalos Roberto Avalos StreamServe Employee
    0 likes

    Replaced &DESCR1_2 for StEvalXpath("DESCR1_2") and  worked :)

    Thursday 10 February, 2011
  • Tsen-Tiam Chu Tsen-Tiam Chu StreamServe Employee
    0 likes

    Hey,

    Yes it is because in StoryTeller you cant use field references. You have to use Xpath values to get to the right field wanted. So to evaluate a Xpath expression StoryTeller uses the function StEvalXpath ().

    Best Regards,

    Tsen-Tiam

    Friday 11 February, 2011

 

Latest from the blogs

Read more