Question Can any one tell me how to control printe to start/stop/pause?

m4mihir2004

New member
Joined
Jun 6, 2011
Messages
3
Location
Anand
Programming Experience
1-3
I have implemented school application in which I used crystal report to print fee receipt.
The size of receipt is smaller then A5 page size and I have to print receipt on Roll Paper.
When I try to print fee receipt the first page will be printed perfectly but the problem is after completion of 1st page printer ejects all the pages.
So,what I wants to do is that, after printing first fee receipt page it will be paused or stopped with second page in the printer.

I have used Report.Print to print the report.
Then after I checked with PrintDocument, but I can't find solution in it.
On internet at so any places, it is discussed about Printer.Pause, Printer.Start, Printer.Stop. but this are not working.



hey guys,
I hope you understood what I mean to say.....
If not then please write so that I can explain at my best.

In advance
Thank you
 
Last edited:
I have used Crystal Report
and looking to get print through crystal report.

here is some code

Public Function GetDataAdeptor(ByVal QueryString As String) As OleDbDataAdapter
Dim DataAdapter As New OleDbDataAdapter
Try
Dim NewConnection As OleDbConnection = OpenNewConnection()
DataAdapter = New OleDbDataAdapter(QueryString, NewConnection)
Return DataAdapter
Catch ex1 As OleDbException
Throw New Exception("Error Getting The Table", ex1)
Catch ex As Exception
Throw New Exception("Error Getting The DataAdapter", ex)
End Try
End Function
Public Function OpenNewConnection() As OleDbConnection
Try
OpenConnection(NewConnection)
Return NewConnection
Catch ex As Exception
Throw (ex)
End Try
End Function
Friend Sub ViewReport(ByVal ReportName As String, ByVal TableName() As String, ByVal QueryString() As String, Optional ByVal [Parameter] As String = "")
'Me.MdiParent = Form2
If Not UBound(TableName).Equals(UBound(QueryString)) Then
MessageBox.Show("Passed Variable Are Not Correct", "Message", _
MessageBoxButtons.OK, MessageBoxIcon.Information) : Exit Sub
End If
Dim Report As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim CrystalReportViewer As CrystalDecisions.Windows.Forms.CrystalReportViewer = New CrystalDecisions.Windows.Forms.CrystalReportViewer
CrystalReportViewer.ActiveViewIndex = 0
CrystalReportViewer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
CrystalReportViewer.DisplayGroupTree = False
CrystalReportViewer.Dock = System.Windows.Forms.DockStyle.Fill
CrystalReportViewer.Location = New System.Drawing.Point(0, 0)
CrystalReportViewer.Name = "CrystalReportViewer"
Dim Adapter As New OleDb.OleDbDataAdapter
Dim DataSet As New DataSet
For I As Integer = 0 To UBound(TableName)
Adapter = GetDataAdeptor(QueryString(I))
Adapter.Fill(DataSet, TableName(I))
Next
'Report In the report Folder
Report.Load(ReportPath & ReportName)
Report.SetDataSource(DataSet)
If Not [Parameter] = "" Then Report.SetParameterValue(0, [Parameter])
CrystalReportViewer.ReportSource = Report
Me.Panel1.Controls.Add(CrystalReportViewer)
Report.PrintOptions.PaperSize = [Shared].PaperSize.PaperA5
Report.PrintToPrinter(1, True, 1, 1) 'This line prints the paper. but after printing 1 paper since I am using roll paper, it will eject all the other papers as it is , i mean blank paper.
End Sub
 
Back
Top