Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

n-up & visible expression

Status
Not open for further replies.

bendep

Programmer
Jul 16, 2001
3
BE
when you make a new dw, style n-up, and use a visible expression to show/hide a column based on the value of a another column, the first control's visible expression is used for all the following columns on that level. eg: when rows_per_detail is 3 and the first visible expression results in true, the 2nd & 3rd row_per_detail will also be shown, regardless of their corresponding value for the visible
expression.

Can somebody confirm me that this is a bug? Or else, what am i overlooking in the documentation?

Thanks,

Ben
 
Guys (and girls),

i cannot believe this.. i found a solution but it's really weird.. haven't found anything about it in the docs. thank god for google..

in short: using an expression with n-up does not work in the usual way.

suppose you have 2 columns:
- col1 = long
- editcol1 = string(20)

setting an expression on e.g. editcol1.visible will result in the expression being evaluated once (value for first row per detail) for all rows_per_detail, regardless of their different values for that column.

Solution (thanks to It turns out that you need to treat the repeated columns as zero-based arrays.

the expression would become:

"If(col1[0] = 1, 1, 0)" --> for the first detail_per_row
"If(col1[1] = 1, 1, 0)" --> for the second detail_per_row
"If(col1[2] = 1, 1, 0)" --> for the third detail_per_row
...

Note that the index of the first element is 0, while powerbuilder arrays start with index 1! (smells like C++ spirit, doesn't it?)

Talk about consistency!! (maybe that would be a nice topic for futures discussion)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top