Results 1 to 2 of 2

Thread: Print Preview

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2005
    Posts
    42

    Print Preview

    Is it possible to print preview a Crystal Report? I am using the following to print a crystal report...

    VB Code:
    1. PrintDialog1.Document = New System.Drawing.Printing.PrintDocument
    2.         If (PrintDialog1.ShowDialog() = DialogResult.OK) Then
    3.             Dim crReportDocument As ReportDocument
    4.             crReportDocument = New ReportDocument
    5.             crReportDocument = New CrystalReport1
    6.             crReportDocument.PrintOptions.PrinterName = PrintDialog1.PrinterSettings.PrinterName
    7.             crReportDocument.PrintOptions.PaperSource = CrystalDecisions.[Shared].PaperSource.Auto
    8.             crReportDocument.PrintToPrinter(1, True, 1, 1)
    9.         End If
    ...but I need to preview the document before I print it. I've tried to use something like...

    VB Code:
    1. dlgPrintPreview.Document = crReportDocument
    2.  dlgPrintPreview.WindowState = FormWindowState.Maximized
    3.  dlgPrintPreview.ShowDialog()
    ...but of course that doesn't work. Any advice would be very helpful!

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383

    Re: Print Preview

    you need to use the crystal report viewer control, you should find it in the toolbox (near the bottom I think)

    the printpreview control and printpreview dialog are for printdocument objects, and not crystal reports

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