Printing parameterised crystal reports direct to network printer
Posted on 2008-10-24
I have a VB.net windows app written in VS 2005. I have a viewer page with a report on it, and it works great, users click on a datagrid print icon and the report pops up.
This is my code for that:
Private Sub cvwPatients_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cvwPatients.Load
Dim PR As New PatientReferraldb
Dim dt As DataTable = PR.SelectForPrint(valReferrL_ID) 'send in report id
.ReportSource = rdPatients
.ShowTextSearchButton = False
.ShowExportButton = False
.DisplayGroupTree = False
.ShowGroupTreeButton = False
What I need to be able to do is go to my database to get a list of records not printed, and loop through and print them without a print dialog popping up.
Any ideas on how I might do this, I've googled PrintToPrinter, and guess this is what I must be using, but I cant find any examples of selecting a network printer, or how to pass parameters similar to the way I've done it to display the report.