Scheduled Report Delivery with Virtual Ticket 2011

This developer blog article was originally published on MetaCommunication’s website in May, 2011 and illustrates the use of Microsoft SQL Server Reporting Services (SSRS) and JavaScript (MetaScript) to deliver Virtual Ticket reports on a scheduled basis.

The original article is no longer accessible on MetaCommunication’s website, but the text has been preserved below.


In my last article, I touched on the new ability of Virtual Ticket 2011 to create Scheduled Tasks, which effectively are stored scripts that can be run automatically on a scheduled basis. In this article, I’ll illustrate how a Scheduled Task can be used to deliver reports via email on a customized schedule.

Scheduled Tasks in Virtual Ticket 2011

When I first explored the idea of delivering reports via email on a scheduled basis, there was admittedly a lot of setup and configuration involved to make it happen. This included configuring the Report Server for email delivery, subscribing to a report, making sure the report itself contained the appropriate credentials, assuring that the report parameters were defined appropriately to accept default values and more. In the end it’s a cool enough feature, but in truth it’s a lot of work. Virtual Ticket 2011’s scheduled tasks change this significantly, making it MUCH easier to setup and use.

Scheduling the Task

The first step to defining a scheduled task is to determine when and how often you want the report to run. In Virtual Ticket 2011, we’ve introduced an //@schedule directive which gets placed at the beginning of your stored script file. With this derivative, you can establish pretty much any schedule you want the script to run, for example: at certain intervals (every x hours or minutes), daily (or every few days), on certain days of the week and/or certain days of the month. A full list of the options, including their syntax, can be found in the current documentation.

Generating and Delivering the Report

In my example, I’ve chosen to generate the Resource Allocation report that is part of Virtual Ticket’s Advanced Workflow & Scheduling solution. This report gives a nice, graphical view of what everyone’s workload and availability is over a given time period. As part of the Scheduled Task (the stored script that is actually going to get executed), I use the Professional Services library to retrieve the email addresses of all members of the Traffic group, and tell the system to both generate the report and email it to them automatically every weekday morning at 8:00 am.

What I really like about this new Scheduled Task functionality is that the script itself can be anything. Like my example, it could be a script to generate and deliver a report, a script to look up information out of a third-party system or even a script to send Virtual Ticket information somewhere. Anything that you want to have run and executed automatically on a scheduled basis would be a prime candidate for a Scheduled Task.

What are some the processes you have in your own system? Which of these might benefit from being set up as a Scheduled Task? Let me know what you think, I’d love to hear about them!