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!

Conditional Printing? 1

Status
Not open for further replies.

wesw

MIS
Jan 16, 2002
31
US
I want to print a text control in different postions within a group. I assume I'll have to create some code like this after making them both invisible.

If table.columnvalue = "This" then
textcontrol.visible = true
else
textcontrol1.visible = true
End if

Am I on the right track?

TIA

W.
 
Are you only wanting a control to be visible AND printed if a condition is met? You can instantiate the control if the condition is met, and not instantiate it if it is not. The control to be instantiated then could have it's "ShowWhenPrinting" property set to TRUE.

 
Being new to actuate , I am actually looking for a means to position the output based on the value of another table column. My assumption is that I would have to have two controls text and text1 in two different positions and only one would be visible based on the value of that table column.
For example tablecolumn.xyz = 'SC'
print tablecolumn.qrs in center
tablecolumn.xyz = 'MM'
print tablecolumn.qrs far right

etc.

Thx
 
As with most things in Actuate, this could be handled several different ways. One way to accomplish this is to just create one control, and put it in the location you expect it to be most often. In the Finish( ) method of that control, check the value of your other controls (remember to have this control created last!) as stated previously.

Adjust the control's position accordingly:

Sub Finish( )
If column_XYZ = "SC" then
Me.position.x = 'place the desired x coordinate here
Me. position.y = 'place your y coordinate here
End if

Super::Finish( )
End Sub


To determine the x and y coordinates, place the control where you want it to be "If...", open the properties, and check the Position properties.

You could also create two controls (txtColumn1, txtConditionalVar2) placed at either location, and create an additional variable on the DataRow (column1 would be the variable originally tied to the column, and ConditionalVar2 - the created variable); by adding another variable to the datarow you could then check the Datarow's OnRead( ) method for your condition and populate the correct control. Since the opposite control would be empty, it would show up as empty space on the report:

Sub OnRead( )
Super::OnRead( )
If column_XYZ = "SC" then
ConditionalVar2 = column1
Column1 = ""
End If
End Sub

This way, Column1 will always be populated from the DataRow with the default value, and you will only change if the Condition is met. In your Content frame, you would have two variables at their respective locations: txtColumn1 and txtConditionalVar2.

If this isn't clear, let me know and I will see about sending some kind of example, OK?!

Good Luck!

Bill
 
Thanks so much for the help, but unfortuantely the only consistent output I get from Actuate are errors. In addition, if I haven't done any "coding" just have used the tools there doesn't appear to be anyway to isolate the errors. It just tells you there is one or more.

So far I am more frustrated than impressed. The learning curve must be a very long one, I hope I have the patience to learn this beast.

Thx

W
 
Well I have some code working to conditionally control postion etc. for "normal" controls. It appears that a dynamic text control doesn't recognize datavalue variable.

What am I missing now?

This is much more difficult than Crystal, at least to format output.


Thx
W
 
I figured it out, you have to use or so I believe gettext.
e.g. Variable = gettext(1,20) etc. within the dynamictextcontrol. I put this in sub finish() method.

W
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top