GrapeCity.ActiveReports.v12 アセンブリ > GrapeCity.ActiveReports 名前空間 > SectionReport クラス : ReportStart イベント |
このイベントは、レポートの実行中に必要なオブジェクトや変数を初期化するために使用できます。
注意:プリンタの値は、ReportStartイベント発生後に設定されます。このため、Printerオブジェクトに適用されるPageSettingsオブジェクトの値を変更するには、ReportStartイベントで行ってください。
private void rptUnbound_ReportStart(object sender, System.EventArgs eArgs) { string m_cnnString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\ActiveReportsNET12\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(); }
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\ActiveReportsNET12\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