Crystal Report - 此字段名称未知错误。请帮忙 [英] Crystal Report - This field name is not known error. Please Help
问题描述
我的水晶报告有问题。该报告在我的计算机上完美显示,但不适用于任何其他计算机。显示报告时,它会显示一条很长的错误消息。遗憾的是,我无法粘贴整个错误消息,因为我从另一台计算机发送此消息。然而。该错误表示我的某个公式字段中存在错误,并且字段名称未知。但它在我的电脑上工作正常。此外,该错误也说明了临时报告文件。
Hi, I'm having a problem with my crystal report. The report displays perfectly on my computer but does not work on any other computers. When displaying the report it gives a long error message. Sadly, I can't paste the whole error message because I'm sending this message from a different computer. However. The error says that something is wrong in one of my formula fields and also the field name is not known. But it works fine in my computer. Also, the error says something about a temporary report file as well.
推荐答案
您好obhasha07,
我遇到了同样的问题。
我的报告在我设计它的数据库源中运行良好。然后我们决定使用不同的数据库名称。我通过配置文件提供了数据库名称,一旦我更改了这个数据库名称,我开始得到你提到的相同错误。
我通过设置数据库位置来解决这个问题正如我们在执行它时所要求的那样。
为那个打开你的报告,选择Database Expert,然后选择SetLocation选项然后创建新连接并选择你在执行时期望的数据库报告。
看看这对你有用.........
http://www.tek-tips.com/viewthread.cfm?qid=493919 [ ^ ]
Hi obhasha07,
I have faced the same issue.
My report was working fine with the database source in which I have designed it. Then we decided to use different database name. I was providing the database name through config file, once I changed this database name I started getting the same error as you mentioned.
I resolved this by setting the database location as we required while executing it.
for that open ur report, select Database Expert, then select SetLocation option then create new connection and choose the database you are expecting while executing the report.
See if this works for you.........
http://www.tek-tips.com/viewthread.cfm?qid=493919[^]
>
您好
尝试此解决方案
Private Sub btnPrint_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)处理btnIN.Click
Dim strSQL As String =DataPrinter
myCom =新的SqlCommand(strSQL,conn)
myCom.CommandType = CommandType.StoredProcedure
myCom.Parameters.Clear()
< br $>
myCom.Parameters.AddWithValue(@ FROMDMY,CDate(mskFROMDMY.Text))
myCom.Parameters.AddWithValue(@ TODMY,CDate(mskTODMY.Text) )
Dim da As New SqlDataAdapter
da = New SqlDataAdapter(myCom)
Dim dt As New DataTable
da.Fill(dt)
Dim objRep As New ReportDocument
objRep = New rptReport
objRep.SetDataSource(dt)
Dim objX As ReportObject
For each objX in objRep.ReportDefinition.ReportObjects
如果TypeOf(objX)是TextObject那么
如果objX.Name =txtTHEHEAD那么
Dim objText As TextObject = CType(objX,TextObjec t)
'objText.Text = ToWordVND(dt2.Rows(0).Item(SumAmount))
objText.Text = lblTHEHEAD.Text
结束如果
结束如果
下一页
Dim f As new frm_Report
f.CrystalReportViewer1.ReportSource = objRep
f.CrystalReportViewer1.Refresh()
f.CrystalReportViewer1.DisplayGroupTree = False
f.WindowState = FormWindowState.Maximized
f.Refresh()
f.Show()
Me.Cursor = Cursors.Arrow
End Sub
/ ****
SQL SERVER中的STORE PROC:
CREATE PROC DataPrinter
@FROMDMY datetime,
@TODMY datetime
AS
SELECT DATE_RECEIPT,MACT,SOCT,ONGBA,DIEN GIAI,TKNO,TKCO,金额,MON,RECKEY
来自DataStorage
WHERE DATE_RECEIPT> = @ FROMDMY和DATE_RECEIPT< = @ TODMY
订单BY DATE_RECEIPT,MACT,SOCT
GO
Hi
try this solution
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnIN.Click
Dim strSQL As String = "DataPrinter"
myCom = New SqlCommand(strSQL, conn)
myCom.CommandType = CommandType.StoredProcedure
myCom.Parameters.Clear()
myCom.Parameters.AddWithValue("@FROMDMY", CDate(mskFROMDMY.Text))
myCom.Parameters.AddWithValue("@TODMY", CDate(mskTODMY.Text))
Dim da As New SqlDataAdapter
da = New SqlDataAdapter(myCom)
Dim dt As New DataTable
da.Fill(dt)
Dim objRep As New ReportDocument
objRep = New rptReport
objRep.SetDataSource(dt)
Dim objX As ReportObject
For Each objX In objRep.ReportDefinition.ReportObjects
If TypeOf (objX) Is TextObject Then
If objX.Name = "txtTHEHEAD" Then
Dim objText As TextObject = CType(objX, TextObject)
'objText.Text = ToWordVND(dt2.Rows(0).Item("SumAmount"))
objText.Text = lblTHEHEAD.Text
End If
End If
Next
Dim f As New frm_Report
f.CrystalReportViewer1.ReportSource = objRep
f.CrystalReportViewer1.Refresh()
f.CrystalReportViewer1.DisplayGroupTree = False
f.WindowState = FormWindowState.Maximized
f.Refresh()
f.Show()
Me.Cursor = Cursors.Arrow
End Sub
/****
STORE PROC IN SQL SERVER :
CREATE PROC DataPrinter
@FROMDMY datetime,
@TODMY datetime
AS
SELECT DATE_RECEIPT, MACT, SOCT, ONGBA, DIENGIAI, TKNO, TKCO, amount, MON, RECKEY
FROM DataStorage
WHERE DATE_RECEIPT>=@FROMDMY AND DATE_RECEIPT<=@TODMY
ORDER BY DATE_RECEIPT, MACT, SOCT
GO
我有同样的问题,我注意到当我将元素从一个子报告复制并粘贴到另一个子报告时会发生此错误。
希望这可以解决问题
i had the same problem and i notice that this error happens when i copy and paste elements from one subreport to another.
Hope this solve the problem
这篇关于Crystal Report - 此字段名称未知错误。请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!