Skip to Content
0
Former Member
Mar 02, 2011 at 07:00 PM

.NET WS SDK - Scheduling Reports

37 Views

I am looking through the WS SDK Developers Guide, and it has a section on scheduling reports. It says to get the report, create a schedule, and then use the BIPlatform to schedule it. It even gives the follow code segment:

ResponseHolder rh = bipService.Get("path://InfoObjects/Root Folder/Report Samples/Feature Examples/Alerting Report", null);
InfoObjects reports = rh.InfoObjects;
if (reports == null) 
{
	return;
}
BusinessObjects.DSWS.BIPlatform.Desktop.CrystalReport myReport = (BusinessObjects.DSWS.BIPlatform.Desktop.CrystalReport)reports.InfoObject[0];
SchedulingInfo schedulingInfo = myReport.SchedulingInfo;
if (schedulingInfo == null) 
{
	schedulingInfo = new SchedulingInfo();
	
}
schedulingInfo.RightNow = true;
schedulingInfo.ScheduleType = ScheduleTypeEnum.ONCE;
BusinessObjects.DSWS.BIPlatform.Desktop.ReportProcessingInfo reportProcessingInfo = new ReportProcessingInfo;
BusinessObjects.DSWS.BIPlatform.Desktop.CrystalReportFormatOptions
crystalReportFormatOptions = new CrystalReportFormatOptions();
crystalReportFormatOptions.Format =  ReportFormatEnum.CRYSTAL_REPORT;
crystalReportFormatOptions.FormatSpecified = true;
reportProcessingInfo.ReportFormatOptions = crystalReportFormatOptions;
myReport.PluginProcessingInterface = reportProcessingInfo;
myReport.SchedulingInfo = schedulingInfo;
reports.InfoObject[0] = myReport;
bipService.Schedule(reports);

Looking at that code, it seems to me to be getting a single report, and scheduling that single report.

What I want is slightly different. I want to get all reports in a folder and schedule them to run now.

My current code:

ResponseHolder biprsp = boxi_bip.Get("path://InfoObjects/Root Folder/My Reports/*/", null);
InfoObjects boxi_rpts = biprsp.InfoObjects;
InfoObject iobject = boxi_rpts.InfoObject[0];
Webi rpt = (Webi)iobject;
rpt.SchedulingInfo = sch_info;
boxi_bip.Schedule(boxi_rpts);

From what I can tell by my above code, it should only schedule the first report object that I return, since I only ever get the first element out of the collection. However, it is actually scheduling and running all of the reports.

Can someone explain that to me?

Thanks