Changing Unmanged Disk Location - VBA Code

Have a lot of reports already scheduled with Default Job Server location and required to change into the Unmanaged Destination, then set Folder & File format.
Looking for the VBA code.

Thanks and Appreciated


kumarusha_k (BOB member since 2006-09-28)

Don’t know if this will help or not but here is what I use in VB .NET 2005:

Dim mySchedulingInfo As SchedulingInfo
mySchedulingInfo = myreport.SchedulingInfo
mySchedulingInfo.RightNow = True
mySchedulingInfo.Type = CeScheduleType.ceScheduleTypeOnce

Dim rfo As ReportFormatOptions = myreport.ReportFormatOptions
rfo.Format = CeReportFormat.ceFormatPDF
rfo.PDFFormat.ExportAllPages = True

query = "SELECT SI_DEST_SCHEDULEOPTIONS, SI_PROGID FROM CI_SYSTEMOBJECTS " & _
            "WHERE SI_PARENTID=29 AND SI_NAME='CrystalEnterprise.DiskUnmanaged'"
Dim destinationInfoObjects As InfoObjects = myInfoStore.Query(query)
myInfoObject = destinationInfoObjects(1)
Dim destinationPlugIn As DestinationPlugin = CType(myInfoObject, DestinationPlugin)
Dim diskUnmanaged As DiskUnmanaged = CType(destinationPlugIn, DiskUnmanaged)
Dim destinationOptions As DestinationOptions = diskUnmanaged.ScheduleOptions
Dim diskUnmanagedOptions As New DiskUnmanagedOptions(destinationOptions)
Dim strDeptName As String = txtRH2.Text
  
Dim intPos As Integer = InStr(strDeptName, "-")
strDeptName = strDeptName.Substring(intPos + 1)
strDeptName = Replace(strDeptName, "/", "-")
Dim strFile As String = "E:\BOBJ Reports\" & Environment.UserName.ToString & "\"
strFile = strFile & strDeptName & ".pdf"
diskUnmanagedOptions.DestinationFiles.Add(strFile)
mySchedulingInfo.Destination.SetFromPlugin(diskUnmanaged)

myInfoStore.Schedule(myInfoObjects)

conwa02976 (BOB member since 2009-04-20)