Solved

Crystal PrintDocument object help

Posted on 2011-09-07
2
382 Views
Last Modified: 2012-06-27
Hi,
I was wondering if someone is able to help. I need to be able to create a PrintDocument object from a generated crystal report within vb.net. I have previously used the following for printing a document (please see attached code). The requirement has now changed to the user now needing a .PDF copy. I am using novaPdf which I am able to call but I need to pass through a PrintDocument object in order to get it to work.

Regards,

Ross

Dim objReport As clsReport
        Dim objFrmReport As New frmreport
        Dim objUD17 As clsUD17
        Dim myReport As PackSlip

        objOrder = New clsOrder ' Created for the connection
        objUD17 = New clsUD17(dtBatch, objOrder.getConnection) ' pass the connection
        '  objUD17.CheckBatch() ' Check the batch

        myReport = New PackSlip()
        objReport = New clsReport(dtBatch)
        objReport.ExtractReport()
        myReport.PrintOptions.PrinterName = "HP LaserJet 1100 (MS)"

        myReport.PrintToPrinter(1, True, 1, 0)


        'objFrmReport.Show()
        ' dtBatch = objUD17.getDt ' return the datatable as this could have items that have been removed due to them being scanned.

        'objUD17.CheckBatch() ' Check the batch
        objUD17.createNewBatch() 'Create the new batch


        objReport = Nothing
        objFrmReport = Nothing
        objOrder = Nothing
        MsgBox("Complete")

Open in new window

0
Comment
Question by:ross13
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 36497182
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 36497364
Why not use the Crystal export to PDF capability?

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now