ActiveReports 6 Online Help
Escape Method
Example 

The escape code being entered.
Allows escape codes to be entered.
Syntax
'Declaration
 
Public Sub Escape( _
   ByVal code As String _
) 
public void Escape( 
   string code
)

Parameters

code
The escape code being entered.
Remarks
Escape codes are specific to the printer being used. For a list of escape codes, see the documentation for the printer.
Example
private void Form1_Load(object sender, System.EventArgs e)
{
    if((openFileDialog1.ShowDialog(this) == DialogResult.OK))
    {
        this.viewer1.Document.Password = "Test";
        viewer1.Document.Load(openFileDialog1.OpenFile());
        Escape("&1 OH"); //page eject code for certain printer (see manual for printer's sequences)
    }
}

public void Escape(string code)
{
    //code is the escape sequence from the printer's manual
    m_myARPrinter.StartJob("Test Printer");
    m_myARPrinter.Graphics.PageUnit = GraphicsUnit.Pixel;

    DataDynamics.ActiveReports.Document.Page aPage;
    int nCount;
    nCount = this.viewer1.Document.Pages.Count;
    RectangleF rcPage;
    rcPage = RectangleF.Empty;
    for (i = 0; i <= nCount - 1; i++)
    {
        m_myARPrinter.Escape(code);
        m_myARPrinter.StartPage();
        aPage = viewer1.Document.Pages[i];
        aPage.Units = DataDynamics.ActiveReports.Document.Units.Pixels;
        rcPage.Width = aPage.Width;
        rcPage.Height = aPage.Height;
        aPage.Draw(m_myARPrinter.Graphics, rcPage);
        m_myARPrinter.EndPage();
    }
    m_myARPrinter.EndJob();
}
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If (OpenFileDialog.ShowDialog(Me) = DialogResult.OK) Then
        Viewer1.Document.Password = "Test"
        Viewer1.Document.Load(OpenFileDialog.OpenFile())
        Escape("&l  0H") 'page eject code for certain printer (see manual for printer's sequences)
    End If
End Sub

Public Sub Escape(ByVal code As String) 'code is the escape sequence from the printer's manual
    m_myARPrinter.StartJob("Test Printer")
    m_myARPrinter.Graphics.PageUnit = GraphicsUnit.Pixel

    Dim aPage As DataDynamics.ActiveReports.Document.Page
    Dim nCount As Integer
    nCount = Viewer1.Document.Pages.Count
    Dim rcPage As RectangleF
    rcPage = RectangleF.Empty
    For i = 0 To nCount - 1
        m_myARPrinter.Escape(code)
        m_myARPrinter.StartPage()
        aPage = Viewer1.Document.Pages(i)
        aPage.Units = DataDynamics.ActiveReports.Document.Units.Pixels
        rcPage.Width = aPage.Width
        rcPage.Height = aPage.Height
        aPage.Draw(m_myARPrinter.Graphics, rcPage)
        m_myARPrinter.EndPage()
    Next
    m_myARPrinter.EndJob()
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SystemPrinter Class
SystemPrinter Members

Send Feedback