In SQL 2005 Reporting Services, on the page that you use to set a schedule
for a subscription, there is an option to run a report once. Is there a way
through the web service interface to invoke this specific schedule? Do you
use the NoRecurrence object?
(The options are: Hour, Day, Weekly, Monthly, Once)The quick answer is YES, everything that is done in the ReportManager
uses the web service interface. I would check the BOL for the specific
details.
"Steven Molen" <StevenMolen@.discussions.microsoft.com> wrote in message
news:7B87FBF2-5CE0-4298-8DD7-7FA9A586FD9D@.microsoft.com:
> In SQL 2005 Reporting Services, on the page that you use to set a schedule
> for a subscription, there is an option to run a report once. Is there a way
> through the web service interface to invoke this specific schedule? Do you
> use the NoRecurrence object?
> (The options are: Hour, Day, Weekly, Monthly, Once)
Bret Updegraff, MCAD,MCSD,MCDBA
Microsoft MVP - SQL Server
Crowe Chizek and Company LLC
President - Indianapolis Professional Association for SQL Server
Join our SQL Server Community http;//www.IndyPASS.org
317.208.2538 - FAX (317.706.2660) -BUpdegraff@.CroweChizek.com|||Excuse the ignorance. Whats the BOL? If you means sql books online then I
have already checked there and I couldn't find it...I wanted to look in the
source for the SubscriptionsProperties.aspx page but it is compiled and I
haven't bothered to run reflector against it.
"Bret Updegraff" wrote:
> The quick answer is YES, everything that is done in the ReportManager
> uses the web service interface. I would check the BOL for the specific
> details.
>
> "Steven Molen" <StevenMolen@.discussions.microsoft.com> wrote in message
> news:7B87FBF2-5CE0-4298-8DD7-7FA9A586FD9D@.microsoft.com:
> > In SQL 2005 Reporting Services, on the page that you use to set a schedule
> > for a subscription, there is an option to run a report once. Is there a way
> > through the web service interface to invoke this specific schedule? Do you
> > use the NoRecurrence object?
> >
> > (The options are: Hour, Day, Weekly, Monthly, Once)
>
> --
> Bret Updegraff, MCAD,MCSD,MCDBA
> Microsoft MVP - SQL Server
> Crowe Chizek and Company LLC
> President - Indianapolis Professional Association for SQL Server
> Join our SQL Server Community http;//www.IndyPASS.org
> 317.208.2538 - FAX (317.706.2660) -BUpdegraff@.CroweChizek.com
>|||OK. The answer wasn't in the BOL. Pfft. The SQL BOL is very light when it
comes to the web service and what it can and can't do.
I got "unlazy" and pulled out my reflector and deconstructed the
SubscriptionProperties page (All the report services pages are compiled
pages). Needless to say, my answer I was looking for wasn't on that page but
in a custom class that they were using to construct the schedule portion of
the subscription.
(Specifically Microsoft.ReportingServices.UI.ScheduleControl within the
ReportingServicesWebUserInterface.dll)
The method that most caught my interest was TaskToScheduleDefinition() since
I was using the scheduledefinition object inherently. The short answer is:
DO NOT set the Schedule.Item and to leave it null. Only set the
StartDateTime on the schedule object.
I tested this theory that I picked up from looking at the disassembled code
and my Subscriber object worked perfectly with the schedule object set as
described above.
Here is the code from the reporting services assembly if your interested.
This is from SQL 2005 of course and only has to do with setting the schedule
object and not the rest of the code needed to set up a full subscription:
internal static ScheduleDefinition TaskToScheduleDefinition(Task task)
{
ScheduleDefinition definition1 = new ScheduleDefinition();
definition1.StartDateTime = task.StartDateTime;
definition1.EndDate = task.EndDate;
definition1.EndDateSpecified = false;
if (task.EndDate != DateTime.MinValue)
{
definition1.EndDateSpecified = true;
}
switch (task.Trigger.RecurrenceType)
{
case RecurrenceType.Once:
{
return definition1;
}
case RecurrenceType.Minutes:
{
MinuteRecurrence recurrence1 = new MinuteRecurrence();
recurrence1.MinutesInterval = ((Minutes)
task.Trigger.TriggerData).MinutesInterval;
definition1.Item = recurrence1;
return definition1;
}
case RecurrenceType.Daily:
{
DailyRecurrence recurrence2 = new DailyRecurrence();
recurrence2.DaysInterval = (int) ((Daily)
task.Trigger.TriggerData).DaysInterval;
definition1.Item = recurrence2;
return definition1;
}
case RecurrenceType.Weekly:
{
WeeklyRecurrence recurrence3 = new WeeklyRecurrence();
Weekly weekly1 = (Weekly) task.Trigger.TriggerData;
recurrence3.DaysOfWeek =ScheduleControl.UintToDaysOfWeek(weekly1.DaysOfWeek);
recurrence3.WeeksInterval = (int) weekly1.WeeksInterval;
recurrence3.WeeksIntervalSpecified = true;
definition1.Item = recurrence3;
return definition1;
}
case RecurrenceType.MonthlyDate:
{
MonthlyRecurrence recurrence4 = new MonthlyRecurrence();
Monthly monthly1 = (Monthly) task.Trigger.TriggerData;
recurrence4.Days =Monthly.GetDayRange(monthly1.DaysOfMonth);
recurrence4.MonthsOfYear =ScheduleControl.UintToMonthsOfYear(monthly1.Months);
definition1.Item = recurrence4;
return definition1;
}
case RecurrenceType.MonthlyDOW:
{
MonthlyDOWRecurrence recurrence5 = new
MonthlyDOWRecurrence();
MonthlyDOW ydow1 = (MonthlyDOW) task.Trigger.TriggerData;
recurrence5.DaysOfWeek =ScheduleControl.UintToDaysOfWeek(ydow1.DaysOfWeek);
recurrence5.MonthsOfYear =ScheduleControl.UintToMonthsOfYear(ydow1.Months);
recurrence5.WhichWeek =ScheduleControl.UintToWhichWeek(ydow1.Week);
recurrence5.WhichWeekSpecified = true;
definition1.Item = recurrence5;
return definition1;
}
}
return definition1;
}
"Steven Molen" wrote:
> Excuse the ignorance. Whats the BOL? If you means sql books online then I
> have already checked there and I couldn't find it...I wanted to look in the
> source for the SubscriptionsProperties.aspx page but it is compiled and I
> haven't bothered to run reflector against it.
> "Bret Updegraff" wrote:
> > The quick answer is YES, everything that is done in the ReportManager
> > uses the web service interface. I would check the BOL for the specific
> > details.
> >
> >
> > "Steven Molen" <StevenMolen@.discussions.microsoft.com> wrote in message
> > news:7B87FBF2-5CE0-4298-8DD7-7FA9A586FD9D@.microsoft.com:
> >
> > > In SQL 2005 Reporting Services, on the page that you use to set a schedule
> > > for a subscription, there is an option to run a report once. Is there a way
> > > through the web service interface to invoke this specific schedule? Do you
> > > use the NoRecurrence object?
> > >
> > > (The options are: Hour, Day, Weekly, Monthly, Once)
> >
> >
> > --
> > Bret Updegraff, MCAD,MCSD,MCDBA
> > Microsoft MVP - SQL Server
> > Crowe Chizek and Company LLC
> > President - Indianapolis Professional Association for SQL Server
> > Join our SQL Server Community http;//www.IndyPASS.org
> > 317.208.2538 - FAX (317.706.2660) -BUpdegraff@.CroweChizek.com
> >
> >
No comments:
Post a Comment