Friday, June 8, 2012

How to show or hide a block in Active Reports – a generic approach

There are many ways to show or hide a block; this document is intended to provide a generic way to realize such functionality in active reports. The approach can be used in many situations, such as drill through, drill up, drill down.
The idea is to define a generic block variable, and use this variable to control whether to show a block or not. The variable value predefined values, such as Block1, Block2 and Block3, which can be set by any control when needed as hardcoded data column.

Please download report specification or .mht file for review.



  1. Define a variable as varBlock
  2. Define a generic query as qBlock, containing column Block1, Block2 and Block3
  3. Define three decks as Deck – Block1, Deck – Block2 and Deck – Block3
  4. Specify each Deck to have Default card
  5. Specify each Deck to have only one card called “Visible”

  1. Specify ‘Block1’ in varBlock for Deck – Block1; ‘Block2’ in varBlock for Deck – Block2; ‘Block3’ in varBlock for Deck – Block3;
  2. In each visible card, define a singleton to show next block
  3. Drag data item to the singleton and specify variable value
  4. Run report, show block1, and Block 2 and 3 are hidden
             
Click show block2, 
then Block2 shows and Block1 and Block3 are hidde
           

Obviously, this idea can be used anywhere needed. You can set value for varBlock anywhere on any controls in real situation.

No comments:

Post a Comment