[英]Pass expression as parameter to Dataset in SSRS
在FetchXml查詢中,我將結束日期作為參數傳遞,但是對於“開始日期”,該參數基於用戶選擇。 例如,用戶可以選擇MTD,QTD和YTD作為報告時間。 因此,如果用戶選擇QTD作為開始日期,而End Date是選擇2月的某個日期(例如25日)。 因此,我需要將從季度開始創建的記錄拉到結束日期中的選定日期。
我可以做些什么,但是在一定程度上它的值是固定的,如果用戶有興趣選擇去年的日期格式該怎么辦。
解決方法是使用文本框並根據開始日期和所選值對開始日期進行排序,然后將此新表達式作為參數傳遞給數據集。
這些只是假設,我想聽聽表單專家來整理此查詢。
以下是我的FetchXml查詢:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
<entity name="account" >
<attribute name="name" />
<attribute name="address1_telephone1" />
<attribute name="fax" />
<attribute name="accountid" />
<order attribute="fullname" descending="false" />
<filter type="and" >
<condition attribute="createdon" operator="on-or-after" value="" />
<condition attribute="createdon" operator="on-or-before" value="" />
</filter>
</entity>
</fetch>
您可以為每種查詢類型使用特定的FetchXML運算符 :
MTD: this-month
QTD: this-fiscal-period
年初至今: this-year
例如:
<filter type="and" >
<condition attribute="createdon" operator="this-month" />
</filter>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.