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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unknown Field Error when VB6 exporting Crystal Report 10 in pdf format

Status
Not open for further replies.

pamelarj

Programmer
Sep 8, 2005
14
US
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.


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

 
Try selecting Database->Verify Database from within crystal and then save the report.

-k
 
Thank you for your suggestion; however, that didn't seem to work. Anymore ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top