Melinda
Melinda

Reputation: 1531

SSRS report error generated but don't know why - BC30311 value of type error cannot be converted to String

I have a stored procedure that I'm executing to create a drill-down report in SSRS. In my expression where this error is getting generated I have the following defined for a specific column value:

=IIF(ISNOTHING(Fields!RN) AND Fields!TermType = "New", Fields!WrittenPremium.Value, 0)

The Fields!WrittenPremium.Value is a MONEY datatype from SQL Server 2017 and the error shows the following:

The Value expression for the textrun "WrittenPremium.Paragraphs[0].TextRuns[0]' contains an error: [BC30311] Value of type 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field' cannot be converted to 'String'. 

I'm not sure why this conversion error is being generated and could use any help/direction. Thanks.

Upvotes: 0

Views: 2937

Answers (1)

Alan Schofield
Alan Schofield

Reputation: 21703

You need to specify the value property, not just the field. So a simple change to ....

=IIF(ISNOTHING(Fields!RN.Value) AND Fields!TermType.Value = "New", Fields!WrittenPremium.Value, 0)

... should work.

Upvotes: 4

Related Questions