Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting multiple sub-reports to ODBC connection

Status
Not open for further replies.

jbradley

Programmer
Sep 7, 2001
248
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top