简体   繁体   English

SSRS报告更改日期(基于订阅)

[英]SSRS report change date based on subscription

I'm trying to set two different dates for the same SSRS report. 我正在尝试为同一SSRS报告设置两个不同的日期。

What the report basically does is check a StartDate and EndDate these dates are default to yesterday. 该报告的主要作用是检查StartDateEndDate这些日期默认为昨天。 But I have to implement a new subscription which has to look to the beginning of the month. 但是我必须实施一个新订阅,该订阅必须要看月初。

I've been investigating and I couldn't see any configuration rather than change the default date, but this will break the first subscription. 我一直在调查中,除了更改默认日期外,我看不到任何配置,但这会中断第一个订阅。

I'm thinking to add a boolean flag saying "check from the first" and an if inside the SQL query. 我正在考虑添加一个布尔型标记,表示“从头开始检查”,以及在SQL查询中ifif

but I would like to know if there is any better approach rather than this "hardcoded" and ugly way, using the subscription if possible. 但是我想知道是否有比这种“硬编码”和丑陋方法更好的方法,如果可能的话使用订阅。

Thanks. 谢谢。

You can use a data-driven subscription to calculate the parameter values for the new subscription you want to create. 您可以使用数据驱动的订阅来计算要创建的新订阅的参数值。 Write a SQL query that gets the two date values you want to use. 编写一个SQL查询,获取要使用的两个日期值。 Then you can pass these in to override the defaults. 然后,您可以传递这些参数以覆盖默认值。 You don't even have to edit the report and it will be dynamic. 您甚至不必编辑报告,报告将是动态的。

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

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