Skip to Content
Sep 18, 2014 at 04:08 PM

Providing values to formulas from


I'm developing my first report (developed with Report Designer) to be fired from I'm running into a problem providing a value to a formula from VB code. The report was running correctly before I tried to supply the formula value from VB.

The report contains a formula called ShopSuppliesAmount that looks like this at design time:


The a report footer section contains the following suppress condition:


The VB code that fires the report looks like this (I'm including code that provides a stored procedure property value, just in case that has anything to do with the problem):

Dim crParameterField As New ParameterField

Dim crParameterFields As New ParameterFields

Dim crParameterDiscreteValue As New ParameterDiscreteValue

Dim lrptInvoice As New rptInvoice

lrptInvoice.DataDefinition.FormulaFields("ShopSuppliesAmount").Text = Chr(39) & mdecShopSuppliesAmount & Chr(39)

(Note that the variable mdecShopSuppliesAmount is Decimal, and I'm testing with a value of 0.)

crParameterField.Name = "@RepairOrderNumber"

crParameterDiscreteValue.Value = miRepairOrderNumber



crvReport.ParameterFieldInfo = crParameterFields

crvReport.ReportSource = lrptInvoice

When I fire the report, I'm getting the following error:

A string is required here.

Details: errorKind

Error in File temp_(etc...).rpt

Error in formula Section_Visibility:


A string is required here.

Details: errorKind

Can someone tell me what I'm doing wrong? Thanks!