代码之家  ›  专栏  ›  技术社区  ›  Elizabeth

SSRS报告生成错误,无详细信息

  •  0
  • Elizabeth  · 技术社区  · 7 年前

    这是我的小报的一个小节。

    enter image description here

    这些是不可见的列,我将把它们拉到文本框中,以便在其他地方引用。我必须引用的数据必须在主组行中,否则我会收到错误消息。

    这是A列中的代码

    =Sum(iif(Parameters!season.Value = Fields!season.Value, Fields!pkg_due_amt.Value, 0))
    

    这是B列中的代码,它会生成一个错误。

    =Sum(iif(Fields!inDateRange.Value = TRUE and Parameters!season.Value = Fields!season.Value, Fields!pkg_due_amt.Value, 0))
    

    如果我在B列中进行调整,我得到了以下代码:

    =Sum(iif(Fields!inDateRange.Value = TRUE and Parameters!season.Value = Fields!season.Value, 1, 0))
    

    上面两行之间的唯一区别是,我正在尝试求和一个字段 pkg_due_amt 而不是1。真字段中的1不会生成错误 普格尔杜埃姆 做。

    这是第一期。如你所见,在701947年的右边。是一个错误。

    repor

    第二个问题是,当生成/预览时,它会像这样出现。如果您查看上面的图像,第一个/常规标题行也会生成一个错误。这是最高的分组。当我试图替换 普格尔杜埃姆 对于1,它再次起作用,但这没有帮助。我需要的是这个领域的总结。

    编译错误如下:

    enter image description here

    Warning 1   [rsAggregateOfMixedDataTypes] The Value expression for the textrun ‘Textbox794.Paragraphs[0].TextRuns[0]’ uses an aggregate function on data of varying data types.  Aggregate functions other than First, Last, Previous, Count, and CountDistinct can only aggregate data of a single data type.  ... 0   0   
    
    Warning 2   [rsAggregateOfMixedDataTypes] The Value expression for the textrun ‘Textbox814.Paragraphs[0].TextRuns[0]’ uses an aggregate function on data of varying data types.  Aggregate functions other than First, Last, Previous, Count, and CountDistinct can only aggregate data of a single data type.  ... 0   0   
    
    Warning 3   [rsAggregateOfMixedDataTypes] The Value expression for the textrun ‘Textbox789.Paragraphs[0].TextRuns[0]’ uses an aggregate function on data of varying data types.  Aggregate functions other than First, Last, Previous, Count, and CountDistinct can only aggregate data of a single data type.  ... 0   0   
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Dale K    7 年前

    这意味着 pkg_due_amt 数据类型与 0 可能就跟一个人是 int 一个是 decimal -您可以使用强制转换函数来解决它,例如 CDec(Fields!pkg_due_amt.Value), CDec(0)