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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic positioning

Status
Not open for further replies.

wesw

MIS
Jan 16, 2002
31
US
within a frame I want to dynamically position a label and a text control. If a field is not null or a variable or whatever is not empty, print the label and value and move everything below it down a line. If is is null print normally.
It looks like each contol has an X value of 0 zero so how do I accomplish this?

Thx

Wes
 
There are several ways to accomplish something like this, and it really depends on a few things which way would be best. If you have several controls that would need to be 'moved' to the next row down, then I might consider using a Conditional Section.

In your Then section (If Not IsNull(somevalue...), use a frame that has the controls below, Else have a frame with all the controls on one line.


Bill
 
Thx
I have one frame with controls. ctrl 3 is on top of 2 and has a height of 0.

1
3
4
5
6
..

In and earlier section I use onrow to check and populate a variable.
htp = row.GetValue("wo12")
If Isnull(htp) then
Htpnewpos = 0
else
Htpnewpos = 360
end if
Now in each control except 1 I have the following
Sub Finish( )
Super::Finish( )
' Insert your code here
Position.y = me.Position.y + htpnewpos
End Sub

For the hidden control
if htpnewpos = 360 then
me.size.height =360
end if

So everything moves down one position and the information is displayed just fine

This seems cumbersome but it works. I find my self using lots of global variables is this common to do in actuate?
In addition, there doesn't seem to be an option explicit is this correct?



Wes
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top