Friday, February 17, 2012

Determining when to send the report based on information inside the report?!?

Hello

Here is a tricky problem to which I didn't find any "good" solution:

I have a report which should be sent to the subscriber only when there is something to report. Mostly the report will be empty, because it will only report emergency-type-of-stuff. Now I have implemented the report logic twice, once in the report and once in a data driven subscription which returns a fixed email address when the report data query returns data.

Ideal solution would be one where you can decide in the report generation is it sent or not. Has anyone any ideas / solutions conserning this problem? How could you decide during the report generation that is report sent or not? Any help is highly appreciated...

Thanks!

- rusi

Well, that seems a bit interesting...one problem I see is that the report generation could be performed anytime...i.e. on a schedule, or also anytime a user interactivelly requests to view the report. So, if for example you did include logic to email the report anytime the report generation included data, would you want to get multiple emails time after time if a user kept viewing the report every 10-15 minutes or something like that?

Seems to me that your best bet would be to encapsulate the data-portion of the report (i.e. the queries/data sets) within a stored procedure that you can call from multiple places, and if the sp returns any results, fire off an email from your automated systems when you would like under controlled circumstances.

As it is, I'm not entirely sure that you can even fire off an email based on report content...maybe someone else can chime in on this part...

|||Thanks for the answer!
That is true that the report is ran every time, in this case twice a day, and it sends a report of orders that have not been confirmed. But there is no need to send the report if there are no unconfirmed orders eg. nothing to report...
It is possible to solve this putting the logic in one sp, but still have to implement to logic somewhere else then in the report. I'm searching for the best solution in which the report includes all the logic.
|||This is a fairly common request. Your current solution is the best work around that we have right now. We are looking at the possibility of adding this feature in future versions.

No comments:

Post a Comment