Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: crystal components Post Reply Post New Topic
Author Message
maryj
Newbie
Newbie


Joined: 23 Mar 2011
Location: United States
Online Status: Offline
Posts: 1
Quote maryj Replybullet Topic: crystal components
     Posted: 29 Mar 2011 at 4:42am
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
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum