I am trying to pass some text to a formula field in a Crystal Report.
Formula field name is txtShopName
.
shopName
is a variable and it has the value of "TORCH-MINIMALL". I use VB.net to view the report and pass the parameter value as follows. However, I get an error when trying to view the report. (Image attached)
What could be the reason?. Is there any specific way which I have to create the formula field in the report?.
Dim crepBill As New repBill
crepBill.SetDatabaseLogon("sa", dbPwd)
crepBill.DataDefinition.FormulaFields.Item("txtShopName").Text = shopName
crepBill.RecordSelectionFormula = "{TB_SALES.bill_no} ='" & "B000002" & "'"
CrystalReportViewer1.ReportSource = crepBill
CrystalReportViewer1.Zoom(100)
CrystalReportViewer1.Refresh()
CrystalReportViewer1.RefreshReport()