Без открытой печати документа прямая печать на принтере
Я отправляю прямую печать на принтер без открытия какого-либо печатного документа или каких-либо добавлений (так же, как POS), я применил это
Что я уже пробовал:
Dim ConnectionInfo As ConnectionInfo = New ConnectionInfo() Dim CashReceipt As New ReportDocument() CashReceipt.Load(Application.StartupPath & "\Reports\Sale Reports\CashReceipt.rpt") Dim MyTables As Tables = CashReceipt.Database.Tables For Each MyTable As CrystalDecisions.CrystalReports.Engine.Table In MyTables Dim MyTableLogonInfo As TableLogOnInfo = MyTable.LogOnInfo ConnectionInfo.ServerName = ".\SQLEXPRESS" ConnectionInfo.DatabaseName = ""Admin ConnectionInfo.UserID = "sa" ConnectionInfo.Password = "admin" ConnectionInfo.IntegratedSecurity = False MyTableLogonInfo.ConnectionInfo = ConnectionInfo MyTable.ApplyLogOnInfo(MyTableLogonInfo) Next RPTfrmCashReport.CrystalReportViewer1.ReportSource = CashReceipt Dim mySelectionFormula As String = "{Invoice_Master.Invoice_no} = '" & FrmSalebill.LblInvoiceno.Text & "'" CashReceipt.RecordSelectionFormula = mySelectionFormula CashReceipt.PrintToPrinter(1, False, 0, 0)