|
I have written a VB script that I am going to put on a server running Crystal Reports 11 reports - it allows parameters to be passed and creates a PDF of the report. It runs perfectly on my development PC but I need to know what components I need to put on the server and how to register them so I can get my script to run, currently it errors with "ActiveX component can't create object: 'CrystalRunTime.Application'"
Here is my script:
dim rptfile, exportfile dim RetValue dim strDate dim objCRRpt dim objCRApp dim fp
'fp = ework.SelectSQL("select evalue from eattribute where eusername = 'config' and eattribute = 'EDM path'") RetValue = ""
'rptfile = UCase(line) rptfile ="c:\OutsideEmploymentRequest.rpt" exportfile ="c:\crystalExport.pdf" 'exportfile = fp & ework.FolderID & ".PDF"
Set objCRApp = CreateObject("CrystalRunTime.Application") set objCRRpt = objCRApp.openreport( rptfile )
If objCRRpt.HasSavedData Then objCRRpt.DiscardSavedData With objCRRpt .Database.Tables.Item(1).SetLogOnInfo "wsprod", "", "ework", "password" With .exportoptions .formattype = 31 'crEFTPortableDocFormat .PDFExportAllPages = true .diskfilename = exportfile .destinationtype = 1 'CrEDTDiskFile .UseReportDateFormat = True .UseReportNumberFormat = True End With
objCRRpt.ParameterFields.GetItemByName("FolderID").AddCurrentValue "0002103200000000000000000021032"
.export(False) RetValue = exportfile End With ExportRPT = RetValue Set objCRApp = Nothing set objCRRpt = Nothing
|