Kbase 17428: How to use a control in the page layout in Actuate
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
How to use a control in the page layout in Actuate
This is a work around which allows one to use a control which will
always appear in the same location on the page of a report.
Assumptions: We have a report of orders for each customer with the
order items for each order and a total for each order. We never
have more than one order on a page and some orders will be on
multiple pages.
Objective: To have a currency control which appears in the same place
on each page that contains the end of an order group which displays
the total for that order.
Note: It is possible in Actuate to solve this problem by
programatically altering the height of the group after frame.
However, it is a great deal more complex to code which means more
time to implement, and I suspect will also slow performance.
Steps:
1. Create a Global object reference variable that we will use as a
handle to our currency control. Add a Basic source file to your
report by selecting File - New Basic File from the menu. ( note: if
you are trying to re-open your source file select File - Open and
change the Files of type: drop down to Basic Source(*.bas). ) Enter
the following code:
Declare
' Declare an object reference variable.
Global hTotal as AcCurrencyControl
End Declare
2. Add an initialization subroutine. Below our Global declaration
enter the following code:
Sub AssignHandle(Total as AcCurrencyControl)
' Set the reference variable equal to the
' passed object reference.
set hTotal=Total
End Sub
We are now finished with our source file. Close the code window and
save the report.
3. Drag a currency control into the PageStyle component. Right click
the PageStyle component and select Edit Layout. Size the currency
control and place it where you would like it to appear on the page
( In this example in the bottom right hand corner. )
4. Assign a reference to our new currency control to our Global
reference variable. Override the Sub Build() method of the new
currency control so it reads as follows:
Sub Build( )
Super::Build( )
' Initialize Global variable.
AssignHandle(me)
End Sub
This will send a reference to our currency control to our
AssignHandle routine which will stuff it into our Global variable.
5. Turn the currency control off to start the group. Override the
Sub Build() method of the order group section ( Or the before frame )
so it reads as follows:
Sub Build( )
Super::Build( )
' Make the currency control invisible.
hTotal.Font.Color=White
End Sub
6. Turn the currency control back on at the end of the group and
display the total for the order. Override the Sub Finish() method
of the currency control in the after frame of the order group which
currently displays the order total. Enter the following code:
Sub Finish( )
Super::Finish( )
' Set the total for the currency control
' at the bottom of the page and display it.
hTotal.DataValue=me.DataValue
hTotal.Font.color=Black
End Sub
7. Now hide the after frame by setting it's height to 0
What have we done?
We created a currency control in the page layout to hold our order
totals when we need to. We made a Global object reference file in
a Basic source file as well as a subroutine to initialize it. We
changed the font color to white to hide the currency control to start
off the group, and we displayed it by changing the font color back
to black and set the DataValue to the same as the currency control in
the group after section.
Progress Software Technical Support Note # 17428