ThatRickGuy
Programmer
Hey, I'm having some problems running a crystal report (v9) in a VB.Net (2002) application.
The report is based off of a file dsn to a text file using the microsoft text driver. it runs fine in the CR developer.
When running the report in .Net w/ a Report Viewer control, I'm getting "Field Not Known" errors on any fields that are used in a formula. If I remove all of the formula's, the control loads, but w/ a blank report, as if there isn't any data.
The code I'm using to load the report in .Net is this:
using these lines:
I can see all of the field names. But as soon as I .show the form I get an error message about the field in formula is not known. The only difference I see is that the fields in the database object come out as "PATH", "FILE NAME", "SIZE", and "DATE" where as the formulas use "FileList_txt.PATH" and "FileList_txt.SIZE". The formulas are very simple, mostly there just for formating. Like the <SizeInMegs> formula:
which gives me this:
Anyone run into this before?
-Rick
----------------------
The report is based off of a file dsn to a text file using the microsoft text driver. it runs fine in the CR developer.
When running the report in .Net w/ a Report Viewer control, I'm getting "Field Not Known" errors on any fields that are used in a formula. If I remove all of the formula's, the control loads, but w/ a blank report, as if there isn't any data.
The code I'm using to load the report in .Net is this:
Code:
Dim cr As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
cr.Load(ReportPath & reportName)
cr.Refresh()
CrystalReportViewer1.ReportSource = cr
using these lines:
Code:
Debug.WriteLine(cr.Database.Tables.Item(0).Fields(0).Name())
Debug.WriteLine(cr.Database.Tables.Item(0).Fields(1).Name())
Debug.WriteLine(cr.Database.Tables.Item(0).Fields(2).Name())
Debug.WriteLine(cr.Database.Tables.Item(0).Fields(3).Name())
Code:
{FileList_txt.SIZE}/1000000
Error in File ...\Report1.rpt:
Error in formula <SizeInMegs>.
'{FileList_txt.SIZE}/1000000
'
This field name is not known.
Anyone run into this before?
-Rick
----------------------