Last question answered first: Actuate does not support implicit declaration of variables, so when a variable is declared in Actuate, it is explicit.
Unfortunately, yes, using global variables does occur TOO often with developers in Actuate, whcih is not good OOP practice. Thanks for giving the report layout; I never thought about having the controls verticle instead of horizontal.
If you're not using libraries for your controls, then yes, you seem to have alot of code overhead. One solution that came immediately to mind is to create additional variables on your datarow: Position1, Position2...etc; then create your controls in your frame and in the ValueExp assign Position1, Position2, etc. I would do this for the minimum number of controls you will ever have, as you could dynamically instantiate the extra control(s) only when needed.
On your DataRow's OnRead( ) method, check for your NULL value, and based on the results populate your added variables from the datarow:
If IsNull(columnA) Then
Position1 = ColumnB
Position2 = ColumnC
Position3 = ColumnF
.
.
.
This would allow you to stack your controls in your frame like so:
txt1 ' w/ ValueExp = Position1, and so on down the line
txt2
txt3
txt4
txt5
And you could assign any values in any order needed:
txt1 'w/ DataValue ColmnA
txt2 'w/ DataValue ColumnB
.
.
.
-OR-
txt1 'w/ DataValue ColmnC
txt2 'w/ DataValue ColumnB
.
.
.
If this sounds acceptible, and you'd need help on dynamically instantiating additional controls, let me know and we can tackle that as a separate issue. Or, if this does not sound applicable, let me know and I'll offer another possible solution.
Best wishes,
Bill