I have a number of reports that I'm trying to export to PDF files from a VB6 front end. Everything is working with the exception of 3 of the reports. These contain multiple subreports which as far as I can tell are not connecting to the ODBC data source. My code goes something like this:
Option Explicit
Dim crxApplication As New CRAXDRT.Application
Dim crxReport As CRAXDRT.Report
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Public Sub Export()
Set crxReport = crxApplication.OpenReport(strReportPath & strReportName)
crxReport.DiscardSavedData
Set crxParameterField = crxReport.ParameterFields.item(1)
crxParameterField.AddCurrentValue strDepartments(i)
With crxReport
For Each crxDatabaseTable In .Database.Tables
crxDatabaseTable.SetLogOnInfo strServer, strDatabase, strUID, strPassword
Next crxDatabaseTable
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.DiskFileName = strExportPath & strDepartments(i) & " " & strExportName
.ExportOptions.FormatType = crEFTPortableDocFormat
.ExportOptions.PDFExportAllPages = True
.DisplayProgressDialog = False
.EnableParameterPrompting = False
.Export False
End With
Set crxParameterField = Nothing
Set crxReport = Nothing
End Sub
What am I missing here?
Thanks in advance for any help you can provide...
Brad Harris
james_harris@appliedcard.com
Option Explicit
Dim crxApplication As New CRAXDRT.Application
Dim crxReport As CRAXDRT.Report
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Public Sub Export()
Set crxReport = crxApplication.OpenReport(strReportPath & strReportName)
crxReport.DiscardSavedData
Set crxParameterField = crxReport.ParameterFields.item(1)
crxParameterField.AddCurrentValue strDepartments(i)
With crxReport
For Each crxDatabaseTable In .Database.Tables
crxDatabaseTable.SetLogOnInfo strServer, strDatabase, strUID, strPassword
Next crxDatabaseTable
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.DiskFileName = strExportPath & strDepartments(i) & " " & strExportName
.ExportOptions.FormatType = crEFTPortableDocFormat
.ExportOptions.PDFExportAllPages = True
.DisplayProgressDialog = False
.EnableParameterPrompting = False
.Export False
End With
Set crxParameterField = Nothing
Set crxReport = Nothing
End Sub
What am I missing here?
Thanks in advance for any help you can provide...
Brad Harris
james_harris@appliedcard.com