Blocking drill-down based on a condition

Friday 16 February 2018 @ 10:52 pm

Here is a new twist to an old trick. I wrote several years ago about preventing users from drilling down on a section by putting a text object over the other objects in the section. I was recently asked if there was a way to have this happen only on certain groups. My initial reaction was no because a text object is either there or it isn’t, but then I realized that more recent version of CR allow you to add to the width of an object with a condition formula. And, when you make the text grow based on a condition it still blocks the drill down for any objects that it grows to cover.

So say you want to allow drill-down on accounts that are open, but not on accounts that are closed. You could put a very narrow text object on the far left end of the group section for the account. Then you could go into “object size and position” and put the following formula into the width condition:

if {table.status} = "Closed"
then 1440 * 8.5 //1440 twips per inch
else 0

This formula calculates the number of twips to ADD to the existing width. There are 1440 twips in an inch, so I multiply the number of inches I want by 1440.  This makes it clear how much it will add and makes changing the value easier.

(For examples of my most popular formulas, please visit the FORMULAS page on my website.)

Leave a Reply

Recrystallize Pro

Crystal Reports Server