简体   繁体   English

将表达式作为参数传递给SSRS中的数据集

[英]Pass expression as parameter to Dataset in SSRS

In FetchXml Query I have end date being passed as parameter but for Start Date the parameter is based on user selection. 在FetchXml查询中,我将结束日期作为参数传递,但是对于“开始日期”,该参数基于用户选择。 For example, a user can select as MTD, QTD and YTD as reporting time. 例如,用户可以选择MTD,QTD和YTD作为报告时间。 So if user select QTD as start date and End Date is select some date in February like 25th. 因此,如果用户选择QTD作为开始日期,而End Date是选择2月的某个日期(例如25日)。 So I need to pull records that were created from Start of the quarter to the selected date in end date. 因此,我需要将从季度开始创建的记录拉到结束日期中的选定日期。

What I can do I make parameter but its values are fixed in a sense what if the user is interested to select date form last year. 我可以做些什么,但是在一定程度上它的值是固定的,如果用户有兴趣选择去年的日期格式该怎么办。

The way around is to use textbox and get sorted the start date based and selected value and pass this new expression as parameter to dataset. 解决方法是使用文本框并根据开始日期和所选值对开始日期进行排序,然后将此新表达式作为参数传递给数据集。

These are just assumption, I would like to hear form gurus to get this query sorted out. 这些只是假设,我想听听表单专家来整理此查询。

Below is my FetchXml query: 以下是我的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>

You can use specific FetchXML Operators for each of your query types: 您可以为每种查询类型使用特定的FetchXML运算符

MTD: this-month MTD: this-month
QTD: this-fiscal-period QTD: this-fiscal-period
YTD: this-year 年初至今: this-year

For example: 例如:

<filter type="and" >
    <condition attribute="createdon" operator="this-month" />
</filter>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM