cancel
Showing results for 
Search instead for 
Did you mean: 

.NET WS SDK - Scheduling Reports

Former Member
0 Kudos
72

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

Accepted Solutions (1)

Accepted Solutions (1)

Adam_Stone
Active Contributor
0 Kudos

You are calling the schedule method passing all the objects, the ones you haven't touched will be scheduled using the settings stored with the objects in Enterprise.

Former Member
0 Kudos

So, those reports most likely already have a scheduling object with the schedule time set to now, and therefore they run when I pass them back into the schedule method.

That makes sense.

Is there a way for me to check that in the InfoView UI? or some other UI, what their current schedule info is set to? Or is that something I only have access to through the API?

Adam_Stone
Active Contributor
0 Kudos

If you click schedule in infoview or cmc, the settings that you see are the settings that are being used if you don't set anything. Through the CMC you can change these values and save them.

Answers (0)