Link to home
Start Free TrialLog in
Avatar of Andy Green
Andy GreenFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Printing parameterised crystal reports direct to network printer

Hi Experts

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

        rdPatients.SetDataSource(dt)

        With cvwPatients
            .ReportSource = rdPatients
            .ShowTextSearchButton = False
            .ShowExportButton = False
            .DisplayGroupTree = False
            .ShowGroupTreeButton = False
        End With
    End Sub

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.

Andy
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial