Sie sind auf Seite 1von 6

Event setup E-mail Report Studio report to users

By Murali Sunkara, IBM India This technique uses Report Studio and Event Studio features to e-mail the output from a report attachment to users only if data is available. This technique was validated using IBM Cognos 8.4.1 using the GO Sales(query) package. The GO Sales (query) sample data was restored to a SQL Server database. Also, this technique uses the SQL Server getdate() function and will need to be modified if the sample data is restored to another database such as DB2. Since the GO Sales (query) sample data does not include dates up to todays date, in order to test this technique it is necessary to add a record to some of the tables in the GO Sales (query) sample data. 1. Add a record to the TIME_QUARTER LOOKUP table. Only theQUARTER_KEY column needs to be populated. For example, for October 2010 the column should have a value of 20104 since October is in the 4th quarter. 2. Add a record to the TIME_DIMENSION table. Only the DAY_KEY,DAY_DATE, CURRENT_YEAR, QUARTER_KEY and MONTH_KEY columns need to be populated. Adding these records will generate a blank report that will be emailed. If you want the report to contain data then some of the other tables will need to be updated. Scenario Report Studio report scheduled every day that e-mails report output attachments to users. Sometimes there is no data in the database for these reports but an e-mail with zero byte file attachments is still being delivered to users. Business Expectation If data is available for the report then send an e-mail with report output attachments, otherwise, do not send an email. Solution Create an event in Event Studio. If the condition is true, then run report as a task and send e-mail to users with report output. Create a Report Studio report The following report created to generate daily return quantities information. This report output will deliver to users, if return quantities exists. The query items are taken from the query subject Returned items (query).

Create a filter to show the returned items from today. The filter is: convert(varchar(10),[Returned items (query)].[Time dimension]. [Date],101)=convert(varchar(10),getdate(),101)

Save the report as Daily - Return Quantity. Create an event in Event Studio 1. Open GO Sales (query) model in Event Studio and specify an event condition as follows: convert (varchar(10), [Date] ,101)=convert (varchar(10),getdate(),101) In this instance, [Date] maps to the query item from [Returned items (query)]. [Time dimension]. [Date]

2. Validate the event condition. If this event condition is true, then run theDaily - Return Quantity report.

3.

Click Add a task > Run a report.

4.

Select the new report.

5. Select the options and override the default values. Select Format asPDF and select the Send the report by email check box. Add the email recipients. Click OK.

6. Select Manage the Task execution rules and select the New events check box and click OK.

7.

Select Schedule the agent and setup the desired scheduling.

8.

Save event as Daily Return Quantity Event.

Das könnte Ihnen auch gefallen