Private Sub ExportReportToPDF()
'To use this, create a report under Mail-->Forms-->Statements called "TestStatement"

Dim oServe As FE_Services
Set oServe = New FE_Services
oServe.Init FE_Application.SessionContext

Dim oReports As IBBReportInstances
Dim oReport As IBBReportInstance
Dim oRepMetaData As IBBReportMetaData
Set oReports = oServe.CreateServiceObject(bbsoReportInstances)
oReports.Init FE_Application.SessionContext, bbrep_SB_Statement

For Each oReport In oReports
If oReport.Property(REPORTPARAMETERNAMES_fld_NAME) = "TestStatement" Then
Set oRepMetaData = oReport
'Student: Ellis Armstrong, User ID: 0037, PK ID = 61
With oRepMetaData.PropertyDataObject(bbrep_Offset_Filters, bbrep_FilterParameter_FilterValues, valuenumber:=1, _

.Fields(FILTERS_fld_INCLUDEOPTION) = bbFilterIncludeOption_Selected
.Fields(FILTERS_fld_ACTION) = bbFilterAttributeActionType_Include
.Fields(FILTERS_fld_FROMID) = 121 'EA7RECORDSID of Ellis Armstrong

End With
Dim oCEO As IBBCrystalExportOptions
Set oCEO = oReport.ExportOptions

oCEO.ExportFileName = "C:\temp\SB_Test.PDF"
oCEO.ExportFormat = PDFFormat
oReport.ParametersFormat(35) = -1 '35 = "Print separate statement"
'Debug.Print oReport.ProcessSelected
Debug.Print oReport.Process(bbrep_ProcessOption_Preview)
Debug.Print oReport.Process(bbrep_ProcessOption_Export)
Exit For
End If
Set oReports = Nothing
Set oServe = Nothing
End Sub

Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Blackbaud Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.