2016-07-22 10 views
0

の種類の「オブジェクト」のために定義されていない私は、特有の問題を持っている:私は私のレポートを配布しようとしているとき、私は次のエラーを取得する:SSRS:演算子「は - 」展開

Error 1 An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC30452] Operator '-' is not defined for types 'Object' and 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field'.’. 0 0

しかし、ときに私レポートをビルドして実行(またはプレビュー)してもエ​​ラーは発生せず、動作します。

私の質問は です。1.これは何が原因でしたか? 2. Visual Studio環境で動作するので、エラーをトレースする方法は?

ありがとうございました。

答えて

0

2種類のオブジェクトを比較しようとしているようです。具体的には、文字列オブジェクトまたは数値以外のオブジェクトに対して-を使用しようとしています。あなたの表現、特にマイナス記号を持つものを見てみましょう。あなたはカッコがいくつか欠けているだけかもしれません。たとえば、次のように

=Fields!Total.Value *10/(Fields!Other_Total) 
--should be-- 
=(Fields!Total.Value *10)/(Fields!Other_Total) 

You have attempted to use a unary operator (+, -, or Not) on a type, such as a String, for which it is not defined

https://msdn.microsoft.com/en-us/library/cb4637x6.aspx