Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

cant seem to make 3 regions visible / hidden via a procedure - case statement ?

using reportbuilder12 we have 3 regions "layered over each other"

i want to create a procedure to show each region (address) depending on the result of a string field in my case country

region 3 is back layer (say UK), region 2 is middle layer (say EUROPE), region 1 is top layer (say US)

so i need

if address['country'] = 'US' then region1.visible :-true
if address['country'] = 'EUROPE' then region1.visible :-false
if address['country'] = 'UK' then region1.visible :-false AND region2.visible :-false

problem is that using an if statement then you cannot use an AND function

has anyone used the case statement to do something like this?

Comments

  • You need to bracket each condition separately in Delphi. But why don't you hide all three regions first - and then just turn the one on that you need based on the data?
  • region1.visible:=(address['country'] = 'US'); // Show region1 if country = US
    region2.visible:=(address['country'] = 'EUROPE'); // show region2 if country = EUROPE

    //region1.visible:=not (address['country'] = 'EUROPE'); // hide region1 if country=EUROPE

    // if country = UK then region1 is already hidden and region2 is also hidden, so we don't need to check for this line:
    // if address['country'] = 'UK' then region1.visible :-false AND region2.visible :-false
    Yusuf Zorlu
    MicrotronX - Speditionssoftware vom Profi
    https://www.microtronx.com
Sign In or Register to comment.