|
-
Nov 8th, 2000, 01:18 PM
#1
Thread Starter
Lively Member
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?
-
Nov 8th, 2000, 01:47 PM
#2
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.
-
Nov 8th, 2000, 02:05 PM
#3
Thread Starter
Lively Member
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)
-
Nov 8th, 2000, 02:54 PM
#4
Lively Member
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
-
Nov 8th, 2000, 04:37 PM
#5
Thread Starter
Lively Member
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.
-
Nov 8th, 2000, 06:23 PM
#6
i believe you will have to set the location
of the database again through crystal reports
which version are you using?
-
Nov 8th, 2000, 08:01 PM
#7
Thread Starter
Lively Member
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.
-
Nov 8th, 2000, 11:00 PM
#8
Thread Starter
Lively Member
-
Nov 9th, 2000, 07:05 AM
#9
Fanatic Member
Re: anyone?
Try This
To check which printer is attached use this code
before your CR action.
CommonDialog1.ShowPrinter
Cheers
Ray
-
Nov 9th, 2000, 12:25 PM
#10
Thread Starter
Lively Member
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
-
Nov 9th, 2000, 02:21 PM
#11
Fanatic Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|