on 2011 Mar 02 7:00 PM
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
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.