Results 1 to 11 of 11

Thread: crystal report printing

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    118
    this code works at home, but not at work. I am not getting any errors, it just wont print. I can print the report from crystal reports, just not from my App.
    Code:
    Private Sub cmdLeaseReport_Click()
    On Error Resume Next
    dlgDialog.ShowPrinter
    If Err.Number = 32755 Then Exit Sub
    
    CrystalReport1.ReportFileName = App.Path & "\Lease1.rpt"
    CrystalReport1.Destination = crptToPrinter
    CrystalReport1.PrintReport
    
    End Sub
    Anyone see a problem?

    Kokopeli
    VB6 SP3

  2. #2
    Guest
    check in the properties of crystal
    that to printer is the chosen option...

    did you at home set your printer as a default
    for the report?
    is so, you may have to change that.




  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    118

    Huh

    I don't remember setting anything at home to my printer. If I open up the report in crystal reports, I can hit the printer icon and it will print to the right printer. If I try to print in my App,I don't even get the printer icon in the tray. Could it have something to do with I only have one priter at home and three at work? How do I return the printer name from crystal and do I have to or does the printer dialog do it for me. This is really frustrating(as usual)
    Kokopeli
    VB6 SP3

  4. #4
    Lively Member
    Join Date
    Jul 2000
    Location
    Lost in the Mojave Desert
    Posts
    82
    try removing the line "on error resume next" and "if err.number="" exit sub end if" to see if any errors come up
    then debug from there, hope this helps
    Don't go away mad, just go away.

    Bam-Bam

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    118

    NOTHING

    I commented out those lines and still nothing. The pointer turns to hourglass for about a second(if that means anything), but no printing.
    Kokopeli
    VB6 SP3

  6. #6
    Guest
    i believe you will have to set the location
    of the database again through crystal reports

    which version are you using?


  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    118

    version 4.6.1.0 for Visual Basic

    I have the version that ships with VB6. I have set the path using "Verify Database", is that what you mean. I am new to crystal reports so if I need to do something else can you tell me the steps.
    Kokopeli
    VB6 SP3

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    118

    anyone?

    anyone have a clue
    Kokopeli
    VB6 SP3

  9. #9
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Worldwide in the Sun
    Posts
    566

    Re: anyone?


    Try This

    To check which printer is attached use this code
    before your CR action.

    CommonDialog1.ShowPrinter

    Cheers
    Ray
    Ray

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    118

    Its already there

    I have that already, don't I? Is there a way to see where its supposed to print with a Debug.Print. Maybe that will show me something. If so, can you explain.
    Code:
    Private Sub cmdLeaseReport_Click()
    On Error Resume Next
    dlgDialog.ShowPrinter  ' here is the ShowPrinter
    If Err.Number = 32755 Then Exit Sub
    
    CrystalReport1.ReportFileName = App.Path & "\Lease1.rpt"
    CrystalReport1.Destination = crptToPrinter
    CrystalReport1.PrintReport
    
    End Sub
    Kokopeli
    VB6 SP3

  11. #11
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Worldwide in the Sun
    Posts
    566

    Re: Its already there

    [code]
    Private Sub cmdLeaseReport_Click()
    On Error Resume Next
    dlgDialog.ShowPrinter ' here is the ShowPrinter
    If Err.Number = 32755 Then Exit Sub

    CrystalReport1.ReportFileName = App.Path & "\Lease1.rpt"
    CrystalReport1.Destination = crptToPrinter
    CrystalReport1.PrintReport

    End Sub

    this is my code

    In the project components I have:

    Crystal Report Control
    Microsoft Common Dialog Control 6.0 (SP3)

    [code]

    Private Sub Print()

    Commondialog1.CancelError = True
    On Error GoTo Errorhandler
    Commondialog1.ShowPrinter
    frm_Printer.Show ' just a printer image form
    Start = Timer
    pause = 1
    Do While Timer < Start + pause
    DoEvents
    Loop

    ' Print report
    CrystalReport1.ReportFileName = report1

    CrystalReport1.Destination = crptToPrinter ' if standard in properties no need to put it here

    CrystalReport1.Action = 1 'starts printing

    Unload frm_Printer ' unload printer image form

    Errorhandler:
    'some text

    End Sub
    But as i mentioned, I'm using CR Vers. 7


    Good Luck

    Ray
    Ray

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