CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    24

    What is the best way to print a crystal report



    I am trying to print a report designed in crystal reports to print the contents of a database. I use the code


    Private Sub cmdPrint_Click()

    crReport.Action = crRunReport

    End Sub


    given in a book, but I get an error. Where am I going wrong and how do I rectify it

  2. #2
    Join Date
    Apr 1999
    Posts
    2

    Re: What is the best way to print a crystal report

    You must specify the filename of the report file
    (.rpt) you want to print.

    With crReport
    .Connect = CrystalReportConnectionString
    .Destination = crptToPrinter
    .ReportFileName = c:\reportname.rpt
    .Action = 1
    End With

    P.S. Connect property is for user name, password, database name, server name, odbc source etc.
    You must fill in the required info for the specific type of database you are connecting to.


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

Featured