Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report not printing even from CRViewer

Status
Not open for further replies.

lhatwwp

Technical User
Oct 23, 2007
79
US
Hello,

I am using CR8 in GE Fanuc iFix (VBA). Within my application
I have a report that previews fine in the CRVeiwer however doesn't print when I press the print button. When I press the print button the printer dialog box opens, I press print... and that's where the wheels fall off. No print job.

Can anyone suggest a reason for this strange behaviour?

Here is my code
Code:
Private Sub cmdPrintDaily_Click()
    Dim crApp As CRAXDDRT.Application
    Dim rpt As CRAXDDRT.Report
    Dim srpt As CRAXDDRT.Report
    Dim strSQL As String
    
    Set crApp = New CRAXDRT.Application
    Set rpt = crApp.OpenReport("C:\Program Files\GE Fanuc\Proficy iFIX\Reports\Daily.rpt")
    Set srpt = crApp.OpenReport("C:\Program Files\GE Fanuc\Proficy iFIX\Reports\srptDailyCal.rpt")
    rpt.Database.Tables(1).SetLogOnInfo "DNS_NAME", "DB", "UID", "PWD"
    srpt.Database.Tables(1).SetLogOnInfo "********", "**", "***", "***"
    rpt.DiscardSavedData
    srpt.DiscardSavedData
    strSQL = "{viewHourlyWithBias.DateAndTime} = Date(" & Format(cboDailyReportDate, "YYYY,MM,DD") & ")"
    rpt.RecordSelectionFormula = strSQL
    rpt.VerifyOnEveryPrint = True
        
    frmReport.CRViewer1.ReportSource = rpt
    frmReport.CRViewer1.EnableRefreshButton = True
    frmReport.CRViewer1.EnableSelectExpertButton = True
    frmReport.CRViewer1.DisplayGroupTree = False
    frmReport.CRViewer1.ViewReport
    frmReport.Show
End Sub

Thanks,
Lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top