开发者

Any way to have reporting services subscriptions email only when query returns results?

开发者 https://www.devze.com 2022-12-16 16:19 出处:网络
Users are only wanting emails when there are results from a 开发者_开发知识库query....is there anyway to get a SSRS subscription to do this?If you cause the report to fail to render you should be able

Users are only wanting emails when there are results from a 开发者_开发知识库query....is there anyway to get a SSRS subscription to do this?


If you cause the report to fail to render you should be able to cancel the subscription processing - taking that in mind you could run some code embedded in the report that checks to see if data exists and if none does then force the report to fail.

This is all a guess mind you - I have never tried it!


Yes but you have to throw an error when the row count is 0. This means that SSRS cannot render anymore the report and showing the error message. On the stored proc or inline select you have to do something like this:

SELECT 
    *
FROM 
     finalselect
IF @@rowcount = 0
    BEGIN
        RAISERROR('NO ROWS', 16, 1)
    END;
0

精彩评论

暂无评论...
验证码 换一张
取 消