Printing using Crystal Reports' object.printout (CRAXDRT?)

Have a VB app that prints a report that has around 25 records in recordset rs. On several machines, it works fine (both development machines and true end-use machines). On a couple of machines, though, it acts as though it's going to print, and it even brings up the print dialog. The printer never activates, though. A 0 lenth job goes to the print queue, and then it disappears.

Using:
  rpt1.Database.SetDataSource rs, 3, 1
  rpt1.PrintOut

Any ideas?
pfluggAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Valliappan ANConnect With a Mentor Senior Tech ConsultantCommented:
I think for your report, you have linked to some db when designing the report, from one m/c. Since that db is there, it works for that m/c. Then you go to another m/c and try running the report, since that db is not there in the Win 2000 m/c, may be it is giving that error.

Just set the Crystal report's db path also, in runtime, if there is such an option in the report object.

I am not sure yet, if this is the problem.
0
 
trkcorpCommented:
Try monitoring for any error directly after your run command thusly:
If CrystalReport1.LastErrorNumber <> 0 Then MsgBox crystalreport1.LastErrorNumber & " " & crystalreport1.LastErrorString

Sometimes you get an error from the report engine and you will not know what it is unless you intercept it...
0
 
pfluggAuthor Commented:
I don't get a choice for lasterrornumber for my rpt object.

Dim rpt1 as new pcls.dsrLabels8160
(pcls is the project / dsrlabels8160 is the designer)

rpt1.database.setdatasource rs,3,1
rpt1.printout
rpt1. {this is where I assume lasterrornumber should go)

am I declaring something wrong?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Suat OzgurWeb / Application DeveloperCommented:
I think there is a record source problem here. Do you have any chance to open reports in original application (say in Crystal Reports) and preview there (at the machines that reports doesnot run)? Or did you try target as Window instead of Printer directly to see if records are retrieved or not for each computer?

suat
0
 
Valliappan ANSenior Tech ConsultantCommented:
Do you have diff. datasource for each machine, or you use the same datasource/database for all machines you tested? I mean the location.
0
 
pfluggAuthor Commented:
The datasource is actually a recordset in memory. I know it's building the recordset, but I'm still not getting any output. Code follows:

Private Sub cmdPrint_Click()

 Dim rs As New ADODB.Recordset
 Dim dblRollCounter As Double
 Dim dblExposureCounter As Double
 Dim rpt1 As New PCLS.dsrLabels8160
 Dim rpt2 As New PCLS.dsrLabels8161
 Dim rpt3 As New PCLS.dsrLabels8162
 
 On Error GoTo PROC_ERR

 If Val(txt_lngNumberOfRolls) <= 0 Or Val(txt_lngNumberOfExposuresPerRoll) <= 0 Or Val(txt_dblLastRoll)
<= 0 Then
   VBA.MsgBox "Number of Rolls, Exposures Per Roll and First Roll Number Must Be Valued", vbOKOnly,
"Error"
 Else
 
 'create the fields for the reporting rs
 
 With rs.Fields
    .Append "strLine1", adVarChar, 40
    .Append "strLine2", adVarChar, 40
    .Append "strLine3", adVarChar, 40
    .Append "strLine4", adVarChar, 40
    .Append "strLine5", adVarChar, 40
 End With
 
 rs.Open
   
 'populate the reporting rs
   
 For dblRollCounter = Val(txt_dblLastRoll) To Val(txt_dblLastRoll) + Val(txt_lngNumberOfRolls) - 1
   For dblExposureCounter = 1 To Val(txt_lngNumberOfExposuresPerRoll)
     rs.AddNew
     rs("strLine1") = "Copyright (c) " & Year(VBA.Date) & "By: "
     rs("strLine2") = Trim(Me.txt_strLabelLine2)
     rs("strLine3") = Trim(Me.txt_strLabelLine3)
     rs("strLine4") = Trim(Me.txt_strLabelLine4)
     rs("strLine5") = "(Negative #: " & dblRollCounter & " / " & dblExposureCounter
     If chk_PrintASuffix Then
       rs("strLine5") = rs("strLine5") & "A)"
     Else
       rs("strLine5") = rs("strLine5") & ")"
     End If
     rs.Update
   Next
 Next
 
 'print the report
   
  Select Case lngReportFormat
  Case 8160
      rpt1.Database.SetDataSource rs, 3, 1
      rpt1.PrintOut
  Case 8161
      rpt2.Database.SetDataSource rs, 3, 1
      rpt2.PrintOut
  Case 8162
      rpt3.Database.SetDataSource rs, 3, 1
      rpt3.PrintOut
  End Select
 
  Set rs = Nothing
  Set rpt1 = Nothing
  Set rpt2 = Nothing
  Set rpt3 = Nothing
 
  txt_dblLastRoll = Val(txt_dblLastRoll) + Val(txt_lngNumberOfRolls)
   
 End If
 
 Exit Sub

PROC_ERR:
 MsgBox "The following error occurred: " & Error$
 Resume Next

End Sub
0
 
Suat OzgurWeb / Application DeveloperCommented:
C a n  y o u  r e a d  s o u r c e  d a t a b a s e  f r o m  t h a t  c o m p u t e r  y o u  h a v e  t r o u b l e?


Because i think problem is accessing data file from those computers. If code runs for other machines then it means no problem in code.

Suat
0
 
pfluggAuthor Commented:
It's in memory so I'm not really reading it from a physical location.
0
 
Valliappan ANSenior Tech ConsultantCommented:
Did you try VerifyOnEveryPrint setting to true for the report?
0
 
pfluggAuthor Commented:
Did some error trapping. Get "PHYSICAL DATABASE NOT FOUND" message on the Win2000 machine, which is wild, since there's no physical database. The recordset is created and right before the report goes to print, if I display rs.recordcount, the appropriate number of records is shown. Any ideas?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.