See Also

ActiveReport Class  | ActiveReport Members  | FetchData Event  | Fields Property  | DataSource Property  | Walkthrough: Unbound Reports  | Firing Sequence of Events  | Restart Method

Language

Visual Basic

C#

Show All

See Also Languages ActiveReports Send feedback to Data Dynamics

DataInitialize Event

Raised after the ReportStart event to allow the addition of custom fields to the report's fields collection.

[Visual Basic]
Public Event DataInitialize() As EventHandler
[C#]
public event EventHandler DataInitialize();

Remarks

Custom fields can be added to a bound report (one that uses the built-in data source to retrieve records) or an unbound report (one that does not depend on the data source to get its records).

In a bound report, the report's data source is initialized, opened and its fields are added to the Fields collection before the DataInitialize event is raised.

The DataInitialize event is raised only once unless you call the Restart() method.

Note:  Do not reference the Fields collection outside the DataInitialize and FetchData events.

Example

[C#] 

private void rptUnbound_DataInitialize(object sender, System.EventArgs eArgs) 

    Fields.Add("CategoryName"); 
    Fields.Add("ProductName");     
    Fields.Add("UnitsInStock");         
    Fields.Add("Description"); 
}

[Visual Basic] 

Private Sub rptUnbound_DataInitialize(ByVal sender As Object, ByVal e As _
    System.EventArgs) Handles MyBase.DataInitialize
    Fields.Add("CategoryName")
    Fields.Add("ProductName")
    Fields.Add("UnitsInStock")
    Fields.Add("Description")
End Sub

See Also

ActiveReport Class  | ActiveReport Members  | FetchData Event  | Fields Property  | DataSource Property  | Walkthrough: Unbound Reports  | Firing Sequence of Events  | Restart Method

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.