Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009


    Sorry bout the double empty post. The site just 'hung' while I was trying to post the message....

    Here is what I was trying to post:

    What I'm trying to do is this:

    NumberVar PriceLevelUpperArrayBound := UBound({?Price Level});
    Local NumberVar x := 1;
    While x < (PriceLevelUpperArrayBound + 1) Do (
    StringVar "FilterDescription" & (x) := {?Price Level}[x]
    x := x + 1

    The idea is to build descriptors for each filter option picked by a user on the parameters screen and then display the in the report header as "Grouped by xxx and filtered on xxx, xxx, xxx ad xxx" etc.

    I don't know how to write the "FilterDescription" & (x) bit to create the var name.

    Is this even possible in Crystal 2008?



  2. #2
    Join Date
    Nov 2007

    This Does The Trick

    NumberVar PriceLevelUpperArrayBound := UBound({?Price Level});
    StringVar PriceLevelStringVarName :="";
    Local NumberVar x := 1; //array index variable
    //Strip out Filter names from Price Level parameter and assign them to individual string variables
    While x < (PriceLevelUpperArrayBound + 1) Do (  //loop through the array elements
      PriceLevelStringVarName := "FilterDescription" & ToText((x+1)); //Assign dynamically created variable name to a temporary holding variable
      StringVar PriceLevelStringVarName := {?Price Level}[x]; // Create a new StringVar based on the nname just created and assign the current parameter arrays value to it
      x := x + 1; //Increase array index variable

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts