I am able to generate a custom report to printer via Button Click using the following code
dim CRApp
dim Rept
dim RptFile
RptFile = "<ReportPath>"
Set CRApp = CreateObject("CrystalRunTime.Application")
Set Rept = CRApp.OpenReport(RptFile)
With Rept
.ParameterFields.GetItemByName("WorkOrderNo").AddCurrentValue Form.Controls("txtWorkOrderNo").text
.ParameterFields.GetItemByName("CompanyID").AddCurrentValue Session.CompanyID
.Printout(TRUE)
End With
However, I am looking for a method to Preview it on the Screen instead.
Using Sage 500 2021 with built in Crystal Reports 11. Unable to get Viewer to Launch.