PowerTools ActiveReports for .NET 9.0J
Escape メソッド
使用例 

入力するエスケープコード。
エスケープコードの入力を許可します。
構文
'宣言
 
Public Sub Escape( _
   ByVal code As String _
) 
public void Escape( 
   string code
)

パラメータ

code
入力するエスケープコード。
解説
エスケープコードは使用されるプリンタに固有のものです。エスケープコードの一覧については、プリンタのマニュアルを参照してください。
使用例
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"); //ページは、特定のプリンタに対してコードを出します。(詳細は、プリンタのマニュアルを参照してください。)
    }
}

public void Escape(string code)
{
    //コードはプリンタのマニュアルからのエスケープシークエンスとなります。
    m_myARPrinter.StartJob("Test Printer");
    m_myARPrinter.Graphics.PageUnit = GraphicsUnit.Pixel;

    GrapeCity.ActiveReports.Document.Section.Page aPage;
    int nCount;
    nCount = this.viewer1.Document.Pages.Count;
    RectangleF rcPage;
    rcPage = RectangleF.Empty;
    for (int i = 0; i <= nCount - 1; i++)
    {
        m_myARPrinter.Escape(code);
        m_myARPrinter.StartPage();
        aPage = viewer1.Document.Pages[i];
        aPage.Units = GrapeCity.ActiveReports.Document.Section.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") 'ページは、特定のプリンタに対してコードを出します。(詳細は、プリンタのマニュアルを参照してください。)
    End If
End Sub

Public Sub Escape(ByVal code As String) 'コードはプリンタのマニュアルからのエスケープシークエンスとなります。
    m_myARPrinter.StartJob("Test Printer")
    m_myARPrinter.Graphics.PageUnit = GraphicsUnit.Pixel

    Dim aPage As GrapeCity.ActiveReports.Document.Section.Page
    Dim nCount As Integer
    nCount = Viewer1.Document.Pages.Count
    Dim rcPage As RectangleF
    rcPage = RectangleF.Empty
    For int i = 0 To nCount - 1
        m_myARPrinter.Escape(code)
        m_myARPrinter.StartPage()
        aPage = Viewer1.Document.Pages(i)
        aPage.Units = GrapeCity.ActiveReports.Document.Section.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
参照

関連項目

SystemPrinter クラス
SystemPrinter メンバ

 

 


©2003-2015 GrapeCity inc. All rights reserved.