See Also

ActiveReport Class  | ActiveReport Members  | Walkthrough: Unbound Reports

Language

Visual Basic

C#

Show All

See Also Languages ActiveReports Send feedback to Data Dynamics

ReportStart Event

Raised before a report starts processing.

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

Remarks

This event can be used to initialize any objects or variables that are needed while running a report.

Note:  Printer values are set after this event fires.  The values that will be applied to the Printer object are in the PageSettings object.  ReportStart is the event in which you can modify these values in the PageSettings object before they are applied to the Printer object.

Example

[C#] 

private void rptUnbound_ReportStart(object sender, System.EventArgs eArgs) 
{     
    string m_cnnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\         
        Data Dynamics\ActiveReports.NET\Data\NWIND.MDB;Persist Security Info=False";     
    string sqlString = "SELECT * FROM categories INNER JOIN products ON categories.categoryid          
        = products.categoryid ORDER BY products.categoryid, products.productid";     
    m_cnn = new OleDbConnection(m_cnnString);     
    OleDbCommand m_Cmd = new OleDbCommand(sqlString,m_cnn);     
    if(m_cnn.State == ConnectionState.Closed)     
    {         
        m_cnn.Open();     
    }     
        m_reader = m_Cmd.ExecuteReader(); 
}

[Visual Basic] 

Dim m_cnnString As String
Dim sqlString As String
Dim m_reader As OleDbDataReader
Dim m_cnn As OleDbConnection
Private Sub rptUnbound_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) _
    Handles MyBase.ReportStart
    m_cnnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Data _
        Dynamics\ActiveReports.NET\Data\NWIND.MDB;Persist Security Info=False"
    sqlString = "Select * FROM categories INNER JOIN products On categories.categoryid _
        = products.categoryid ORDER BY products.categoryid, products.productid"
    m_cnn = New OleDb.OleDbConnection(m_cnnString)
    Dim m_Cmd As New OleDb.OleDbCommand(sqlString, m_cnn)
    If m_cnn.State = ConnectionState.Closed Then
        m_cnn.Open()
    End If
    m_reader = m_Cmd.ExecuteReader()
End Sub

See Also

ActiveReport Class  | ActiveReport Members  | Walkthrough: Unbound Reports

 

 


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