[英]Need to write expression in SSRS which need to filter my record based on the condition applied?
Booking
in my data set. Booking
的列。 TR-AFP
alone from my BOOKING
column. BOOKING
列中过滤仅从TR-AFP
开始的BOOKING
。 This is my Temporay data for your use case 这是我的Temporay数据供您使用
create parameter as below 创建如下参数
Now create row visibility expression as below 现在创建如下行可见性表达式
Note just for simplicity purpose I have made condition as if user selects TR-AFP then show records with only Category="electronics" and if user selects "ALL" then everything except category="electronics" 请注意,仅为了简单起见,我已经做出了这样的条件:用户选择TR-AFP然后显示仅带有Category =“ electronics”的记录,如果用户选择“ ALL”,则除category =“ electronics”之外的所有内容
You just have to adjust according to your column and it's Value 您只需要根据您的专栏进行调整即可,它的价值在于
=IIF(Parameters!ReportParameter1.Value=1 and Fields!category.Value<>"electronics",true,
IIF(Parameters!ReportParameter1.Value<>1 and Fields!category.Value="electronics",true,false))
Here is how it looks, Look for Right hand side, left hand one is just for your ref as database 这是它的外观,查找右侧,左侧仅是供您参考的数据库
You can try making a separate dataset just for the distinct booking entities. 您可以尝试仅针对不同的预订实体制作单独的数据集。 Declare that parameter in your original dataset, create temp table, join that temp table to the original table.
在原始数据集中声明该参数,创建临时表,然后将该临时表连接到原始表。 Hope this works for you
希望这对你有用
@booking Temp table SELECT CAST(VALUE AS VARCHAR) AS Booking --INTO #booking --FROM string_split(@booking,',') @booking临时表SELECT CAST(VALUE AS VARCHAR)AS预订--INTO #booking --FROM string_split(@booking,',')
select ....... from...... JOIN #booking B on originalDS.booking=B.booking 选择.......从......在原始DS.booking = B.booking上加入#booking B
in SSRS 在SSRS中
Original DS > Parameters > Expression > =Join(Parameters!booking.Value,",") 原始DS>参数>表达式> = Join(Parameters!booking.Value,“,”)
Regards, 问候,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.