Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Subscription Logic

Author  Topic 

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2007-02-01 : 11:58:06
I need to use subscriptions to send a report on a daily basis. The report will be in PDF format. The issue is that the report will not be populated with data every single day and on the days that there is no data I would like the subject to have a different message. Is there a way to add some logic somewhere to change to subject of the message to indicate that there is no data and the PDF file does not need to be opened? I can make the report display a message, but they would have to open the attachment to read it.

tikus
Starting Member

31 Posts

Posted - 2007-02-01 : 13:30:12
You can use Data Driven-subscription. In Step 3, you can dynamically determine the Subject. See example below:


declare @Subject varchar(50)

If exists (select 1 from TableName)
set @Subject = 'With data'
else
set @Subject = 'No data'

select @subject as Subject


In Step 4, Use "Get the value from the database" for Subject parameter. Select the value from the dropdown.
Go to Top of Page
   

- Advertisement -