Results 1 to 5 of 5

Thread: printing in crystal reports

  1. #1
    Guest

    Unhappy

    how can i use the print command dialog box available in VB 6.0 to print crystal reports ??

    i want the flexibity at run time to change the printer and also send reports via fax or e-mail them . or is there any other way out to do the same

  2. #2
    Guest
    make your own with a listbox using this code to help you

    Code:
        ' Load all printers into the listbox of printers.
        ' Select in the listbox the current default printer.
        For Each Prntr In Printers
            ListBox1.AddItem Prntr.DeviceName
            If Prntr.DeviceName = Printer.DeviceName _
                Then ListBox1.Selected(ListBox1.ListCount - 1) = True
        Next
            
    
        ' Find the printer selected by the user in the list of all
        ' printers, and select that printer.
        For Each Prntr In Printers
            If Prntr.DeviceName = ListBox1.List(SubSP) Then
                Set Printer = Prntr
                Exit For
            End If
        Next

  3. #3
    Lively Member
    Join Date
    Jul 2000
    Location
    Brunei
    Posts
    100
    Originally posted by larryn
    make your own with a listbox using this code to help you

    Code:
        ' Load all printers into the listbox of printers.
        ' Select in the listbox the current default printer.
        For Each Prntr In Printers
            ListBox1.AddItem Prntr.DeviceName
            If Prntr.DeviceName = Printer.DeviceName _
                Then ListBox1.Selected(ListBox1.ListCount - 1) = True
        Next
            
    
        ' Find the printer selected by the user in the list of all
        ' printers, and select that printer.
        For Each Prntr In Printers
            If Prntr.DeviceName = ListBox1.List(SubSP) Then
                Set Printer = Prntr
                Exit For
            End If
        Next
    Hi there,

    As a crystal report expert, I think you could help me.

    I want to open the crystal report in the crystal report program, when the user clicks a command button.

    Very simple, but don't know.

    Your help would be greatly appreciated.

    Thank you.

    Rathi

  4. #4
    Guest
    add the crystal report control to your form
    and right click on the control.
    choose properties and on the general tab
    make sure that To Window is the option chosen.

    name the control crpt or whatever you like..

    and attach this code to a command button

    Use_ReportsPath is the path to my reports folder

    Code:
            'print report
            crpt.ReportFileName = Use_ReportsPath & "MyReport.rpt"
            crpt.PrintReport
    at this time the report will print on screen


    hope this helps you out


  5. #5
    Lively Member
    Join Date
    Jul 2000
    Location
    Brunei
    Posts
    100
    Originally posted by larryn
    add the crystal report control to your form
    and right click on the control.
    choose properties and on the general tab
    make sure that To Window is the option chosen.

    name the control crpt or whatever you like..

    and attach this code to a command button

    Use_ReportsPath is the path to my reports folder

    Code:
            'print report
            crpt.ReportFileName = Use_ReportsPath & "MyReport.rpt"
            crpt.PrintReport
    at this time the report will print on screen


    HI there,

    Thanks for your valuable time and support.

    I opened the Crystal report in the crystal report program, using the shell function.

    Thanks again.

    Rathi


    hope this helps you out


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