Actuateclub.com

 

  About Actuate   |   Forums   |   Message Board  |   FAQ   |   Jobs    |   Actuate 100   |   Guest Book  |   Feedback  |   Sitemap   |   Home

Techieindex

 
Creating a control dynamically
In this report we creating a control dynamically at run time bye using the method BuildFromRow( )
Description
We are creating now a control on the BuildFromRow( ) method which gets fired when data rows are to be passed to the controls. To do this :
create a report with frame content section and the SQL as select * from customers.

Then select the frame in content section and press F11 to get its property and select its method tab.

Select “Function BuildFromRow( row As AcDataRow ) As AcBuildStatus” and click Override button. 
Type the remaining lines to the function before “BuildFromRow = Super::BuildFromRow( row )”.

Dim loTextCtrl as AcTextControl

    Set loTextCtrl = New Persistent AcTextControl

      loTextCtrl.Position.X=100

      loTextCtrl.Position.Y=0

      loTextCtrl.Size.Width=1000

      loTextCtrl.Size.Height=250

      loTextCtrl.BackgroundColor=Cyan

      loTextCtrl.DataValue=row.GetValue 
                                     ("address_addrnumber")

      AddContent(loTextCtrl)

Dim starts the declaration section. loTextCtrl as AcTextControl states that loTextCtrl is of type AcTextControl. Set command sets loTextCtrl to just created AcTextControl by New Persistent AcTextControl. Persistent means they exist until the report file is deleted. All objects that appear in the report at view time are persistent, including data controls, graphical elements, section, and layout objects.The next 5 lines are setting its position size and color.loTextCtrl.DataValue=row.GetValue("AddrNumber") sets the DataValue of loTextCtrl which is displayed in the report. The data source creates a data row instance for each input record it retrieves. A data row is composed of variables, each corresponding to a single field or column of the input record. Data controls get their values from the data row. 

SetValue( ) method calls the data rows.

GetValue( ) method, passing it the column, variable name, or method name 
                   specified in the control’s ValueExp property.






 

 

 

 

 

 

Copyright © 2008 Techieindex