2017-01-16 6 views
0

私は、異なる結晶レポートを持っているvb.netアプリを持っています。これらのレポートをレポートビューアで開かずにプリンタに印刷したいのですが、私は2台のプリンタでこれらのレポートを印刷したいのですが、そのうち1台はUSBケーブルでPCにインストールし、もう1台はネットワークプリンタにインストールします。ネットワークプリンタの場合、必要であれば、私は、アプリケーションにIPまたは任意のローカルネットワークアドレスを定義することができます。..複数のプリンタでcrystal reportを印刷する方法は?

答えて

0

こんにちは最初にあなたがこれらのプリンタに

 strSQL = "your select statement" 
     Dim crptDV As New ReportDocument() 
     Dim da As New SqlDataAdapter(strSQL, SqlCon) 
     Dim ds As New DataSet 
     da.Fill(ds) 
     If ds.Tables(0).Rows.Count = 0 Then 
      Exit Sub 
     End If 
     Dim path As String //Report Path 
     crptDV.Load(path & "\reports\ReportName.rpt") 
     End If 

     crptDV.PrintOptions.PrinterName = PrinterName1 
     crptDV.PrintToPrinter(1, True, 0, 0) 

     crptDV.PrintOptions.PrinterName = PrinterName2 
     crptDV.PrintToPrinter(1, True, 0, 0) 
     crptDV.Close() 
     crptDV.Dispose() 
に名前を付ける必要があります
関連する問題