Skip to Content
0
Jul 15, 2020 at 09:18 AM

Error when passing text values to Crystal Report Formula field from VB.Net

323 Views Last edit Jul 15, 2020 at 09:20 AM 2 rev

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()

Attachments

err.png (7.6 kB)