Using Crystal 10 and VB6 I've added a new datasource to my Crytal Report and placed one field from that datasource on the footer of the report.
The VB6 application (see code below) has been running fine until I added the field. Today was the first day the application has been run with the new field in the Crystal Report and now I get a 'The field name is not known' error when it attempts to execute the 'crptAdvice.Export False' line.
I've since removed the new datasource as well as the new field from the footer of the report and still get the 'The field name is not known' error.
The VB6 application (see code below) has been running fine until I added the field. Today was the first day the application has been run with the new field in the Crystal Report and now I get a 'The field name is not known' error when it attempts to execute the 'crptAdvice.Export False' line.
I've since removed the new datasource as well as the new field from the footer of the report and still get the 'The field name is not known' error.
Code:
Dim rstAdvice As ADODB.Recordset
Set rstAdvice = gcnnPrimary.Execute("KIDS_RPT_SDOH_ADVICE " & gPlanID)
Dim strPDF_Path As String
Dim fsoPDF
Set fsoPDF = CreateObject("Scripting.FileSystemObject")
strPDF_Path = "C:\Test\"
Set appl = New CRAXDRT.Application
Set crptAdvice = New CRAXDRT.Report
Set crptAdvice = appl.OpenReport("c:\test\Reports\AdviceFileReport.rpt")
crptAdvice.DiscardSavedData 'Refresh
crptAdvice.Database.SetDataSource rstAdvice
With crptAdvice.ExportOptions
.DestinationType = crEDTDiskFile
.FormatType = crEFTPortableDocFormat
.DiskFileName = strPDF_Path & strPDF_FileName
End With
[b]crptAdvice.Export False[/b]
rstAdvice.Close