...remember... we were using Visual Basic 4.0 when we upgraded from Crystal 6 to 8.
This is how we're creating the text file...
'(frmMain.RPTGeneral = the Crystal Control)
'call sub (below) to initialize the report
InitializeReport "EFT1PCS.rpt", "Electronic File Transfer", 2, False
frmMain.RPTGeneral.ParameterFields(0) = "ReportNo;" & sReportNumber & "; True"
frmMain.RPTGeneral.ParameterFields(1) = "ProfitCtrCd;" & msProfitCtrCd & "; True"
frmMain.RPTGeneral.PrintFileName = lblFileLocation & "\" & sFileName
frmMain.RPTGeneral.PrintFileType = 2
ireturnval = frmMain.RPTGeneral.PrintReport
Sub InitializeReport(sReport As String, sTitle As String, _
iDest As Integer, bProgress As Boolean)
'****************************************************
'*** Purpose: Reset the Crystal Reports control in
'*** preparation for printing a report.
'*** This is necessary since we don't know
'*** how many parameters were passed to the
'*** previous report and residual parameters
'*** cause an 'Invalid parameter' error.
'***
'*** Parameters:
'*** sReport - name of report being printed
'*** sTitle - title of report window
'*** iDest - destination of report
'*** 0=Window; 1=Printer; 2=File
'*** bProgress - boolean to turn on or off Crystal's
'*** progress panel
'***-------------------------------------------------
'****************************************************
On Error GoTo ERR_Section
' reset the control
frmMain.RPTGeneral.Reset
' set the database connection
frmMain.RPTGeneral.Connect = "DSN = " & gsDSN
frmMain.RPTGeneral.Connect = frmMain.RPTGeneral.Connect & ";UID = " & gsUID
frmMain.RPTGeneral.Connect = frmMain.RPTGeneral.Connect & ";PWD = " & gsPWD
' set the report
frmMain.RPTGeneral.ReportFileName = gsReportPath & sReport
frmMain.RPTGeneral.WindowTitle = sTitle
' set the destination
frmMain.RPTGeneral.Destination = iDest
' set the progress panel
frmMain.RPTGeneral.ProgressDialog = bProgress
' set the report to maximize the window
frmMain.RPTGeneral.WindowState = 2
Exit Sub
ERR_Section:
frmError.DisplayError Err.Number, Err.Description, frmMain, _
"InitializeReport", ""
End Sub