Results 1 to 4 of 4

Thread: Crystal Report Print Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93

    Crystal Report Print Question

    Hi,

    So far I have everything working fine. I have a form that contains CrystalReportViewer1 which has it's report source set to the report I created in crystal. Currently while I'm still developing, I have: CrystalReportViewer1.Show()

    What I need to know is how to make this go directly to the printer like a batch print. Am I not suppose to use the crystalreportviewer?


    What I currently have:

    '==> Call barcode report
    Dim frmreport As New frmReport()
    frmreport.Show()


    Private Sub frmReport_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Report = New BarCode1()

    CrystalReportViewer1.ReportSource = Report
    CrystalReportViewer1.Show()

    End Sub

    I tried changing CrystalReportViewer1.Show() to CrystalReportViewer1.PrintReport() but it didn't work, nothing happened, no errors just nothing printed.

    Can anyone see what my problem might be?

    Thanks,
    Corinne

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    In fact CrystalReportViewer1.PrintReport() should bring up the print dialog box for you, the same as if you click on the print button in the report viwer. Check to see what happens if you click on print in the crystal reportviewer toolbar. I had such experience with a localized version of windows 98, in which the print dialogbox didnt appear. I did a through test and finally found out that the problem is with the illegal localization of that windows 98 and the core files that are changed, you know what I mean?

    By the way why dont you give the PrintToPrinter method of the report a try?
    Look at the syntax here:
    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033
    Last edited by Lunatic3; Oct 6th, 2003 at 03:45 PM.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93
    The reportviewer did bring up a box to select to print the report. I wanted the report to go directly ot the printer without viewing on screen. I did solve my problem. I removed the form with the report viewer and added these two lines:

    frmReport.PrintOptions.PrinterName = "My Printer Name"
    frmReport.PrintToPrinter(1, False, 0, 0)

    Now it works like a charm.

    Thanks,
    Corinne

  4. #4
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    i was adding that solution to my post
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width