ActiveReports 6 Online Help
StartJob Method
Example 

The job being printed.
Starts a SystemPrinter print job.
Syntax
'Declaration
 
Public Sub StartJob( _
   ByVal printJob As String _
) 
public void StartJob( 
   string printJob
)

Parameters

printJob
The job being printed.
Example
private void Form1_Load(object sender, System.EventArgs e)
{
    rpt = new ActiveReport1();
    this.viewer1.Document = rpt.Document;    
    rpt.Run();    
    arScale();
}
ActiveReport1 rpt;
DataDynamics.ActiveReports.Document.Page aPage;
private void arScale()
{
    aPage = new DataDynamics.ActiveReports.Document.Page();
    DataDynamics.ActiveReports.Interop.SystemPrinter m_myARPrinter = new DataDynamics.        
        ActiveReports.Interop.SystemPrinter();    
    m_myARPrinter.StartJob("Test Printer");    
    System.Drawing.RectangleF rec;    
    float xOffSet = m_myARPrinter.PhysicalOffsetX/m_myARPrinter.Graphics.DpiX;    
    float yOffSet = m_myARPrinter.PhysicalOffsetY/m_myARPrinter.Graphics.DpiY;    
    float adjustedWidth = (aPage.Width/3)-(xOffSet*2);    
    float xPos = 0;    
    int nCount = rpt.Document.Pages.Count;    
    m_myARPrinter.StartPage();    
    for(int i=0; i < nCount; i++)    
    {        
        aPage = rpt.Document.Pages[i];        
        m_myARPrinter.Graphics.PageUnit = System.Drawing.GraphicsUnit.Pixel;        
        rec = System.Drawing.RectangleF.FromLTRB(xOffSet+xPos, yOffSet,(xOffSet+xPos)+            
            adjustedWidth,yOffSet+adjustedWidth);        
        xPos = adjustedWidth + xPos;        
        aPage.Draw(m_myARPrinter.Graphics,rec);          
    }    
    m_myARPrinter.EndPage();    
    m_myARPrinter.EndJob();
}
Dim i As Integer
Dim rpt As New rptScale()
Dim m_myARPrinter As New DataDynamics.ActiveReports.Interop.SystemPrinter()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Viewer1.Document = rpt.Document    
    rpt.Run()    
    arScale()
End Sub
Private Sub arScale()
    m_myARPrinter.StartJob("Test Printer")    
    Dim aPage As New DataDynamics.ActiveReports.Document.Page()    
    Dim rec As New System.Drawing.RectangleF()    
    Dim xOffSet As Single    
    Dim yOffSet As Single    
    Dim adjustedWidth As Single    
    Dim xPos As Single        
    xOffSet = m_myARPrinter.PhysicalOffsetX / m_myARPrinter.Graphics.DpiX    
    yOffSet = m_myARPrinter.PhysicalOffsetY / m_myARPrinter.Graphics.DpiY    
    adjustedWidth = (aPage.Width / 3) - (xOffSet / 2)    
    xPos = 0    
    Dim nCount As Integer    
    nCount = rpt.Document.Pages.Count    
    m_myARPrinter.StartPage()    
    For i = 0 To nCount - 1
        aPage = rpt.Document.Pages(i)        
        m_myARPrinter.Graphics.PageUnit = GraphicsUnit.Pixel        
        rec = System.Drawing.RectangleF.FromLTRB(xOffSet + xPos, yOffSet, (xOffSet + xPos) + _
            adjustedWidth, yOffSet + adjustedWidth)
        xPos = adjustedWidth + xPos        
        aPage.Draw(m_myARPrinter.Graphics, rec)    
    Next
        m_myARPrinter.EndPage()    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