Glossary Item Box
This walkthrough is split up into the following activities:
To write the code in Visual Basic
To write the code in C#
The following example shows what the code for the method looks like.
' Visual Basic
Private Sub mnuPrintPreview_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles mnuPrintPreview.Click
Dim rpt As New DataDynamics.ActiveReports.ActiveReport()
Dim m_stream As New System.IO.MemoryStream()
Me.Designer1.Report.SaveLayout(m_stream)
m_stream.Position = 0
rpt.LoadLayout(m_stream)
m_stream.Close()
Dim frm As New frmViewer()
frm.SetReport(rpt)
frm.ShowDialog(Me)
End Sub
//C#
private void mnuPrintPreview_Click(object sender, System.EventArgs e)
{
DataDynamics.ActiveReports.ActiveReport rpt = new DataDynamics.ActiveReports .ActiveReport();
System.IO.MemoryStream m_stream = new System.IO.MemoryStream();
this.designer1.Report.SaveLayout(m_stream);
m_stream.Position = 0;
rpt.LoadLayout(m_stream);
m_stream.Close();
frmViewer frm = new frmViewer();
frm.SetReport(rpt);
frm.ShowDialog(this);
}
To write the code in Visual Basic
To write the code in C#
The following example shows what the code for the method looks like.
' Visual Basic
Private Sub mnuLoadLayout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles mnuLoadLayout.Click
Me.Designer1.ExecuteAction(DesignerAction.FileOpen)
End Sub
//C#
private void mnuLoadLayout_Click(object sender, System.EventArgs e)
{
this.designer1.ExecuteAction(DataDynamics.ActiveReports.Design.DesignerAction .FileOpen);
}
To write the code in Visual Basic
To write the code in C#
The following example shows what the code for the method looks like.
' Visual Basic
Private Sub mnuSaveLayout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles mnuSaveLayout.Click
Me.Designer1.ExecuteAction(DesignerAction.FileSave)
End Sub
//C#
private void mnuSaveLayout_Click(object sender, System.EventArgs e)
{
this.designer1.ExecuteAction(DataDynamics.ActiveReports.Design.DesignerAction .FileSave);
}
To write the code in Visual Basic
To write the code in C#
The following example shows what the code for the method looks like.
' Visual Basic
Private Sub mnuPageSetup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles mnuPageSetup.Click
Me.Designer1.ExecuteAction(DesignerAction.ReportSettings)
End Sub
//C#
private void mnuPageSetup_Click(object sender, System.EventArgs e)
{
this.designer1.ExecuteAction(DataDynamics.ActiveReports.Design.DesignerAction .ReportSettings);
}
To write the code in Visual Basic
To write the code in C#
The following example shows what the code for the method looks like.
' Visual Basic
Private Sub mnuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles mnuExit.Click
Me.Close()
End Sub
//C#
private void mnuExit_Click(object sender, System.EventArgs e)
{
this.Close();
}
See Also |
Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.