[英]SSRS Error - "Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate
[英]Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope
嗨,我是SQL Services Reporting的新手,
我遇到了這個錯誤。
因此,我將其放在一個單元格中。 我添加了另一個參數GetBarcodeAddress函數,稱為servername,它來自另一個或不同的數據集。
<CellContents>
<Image Name="imgBarCode2">
<Source>External</Source>
<Value>=Code.GetBarcodeAddress(Fields!ORDER_SUPPORT_NO.Value, Fields!SERVERNAME.Value )</Value>
<MIMEType>image/bmp</MIMEType>
<Sizing>Fit</Sizing>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Image>
</CellContents>
然后我遇到了這個錯誤。
圖像“ imgBarCode2”的值表達式引用字段“ SERVERNAME”。 報表項表達式只能引用當前數據集范圍內的字段,或者如果引用了集合,則引用指定的數據集范圍內的字段。 字段名稱中的字母必須使用正確的大小寫。 (rsFieldReference)
如何解決這個問題? 根據我的理解,我不能在一次表達式中使用兩個不同的數據集結果。
得到了答案..
改為放置以下行:First(Fields!SERVERNAME.Value,“ GetServerName”)
GetServerName是用於獲取服務器名稱的數據集的名稱
<CellContents>
<Image Name="imgBarCode2">
<Source>External</Source>
<Value>=Code.GetBarcodeAddress(Fields!ORDER_SUPPORT_NO.Value, First(Fields!SERVERNAME.Value, "GetServerName") )</Value>
<MIMEType>image/bmp</MIMEType>
<Sizing>Fit</Sizing>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Image>
</CellContents>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.