我正在尝试通过Web服务在BI Publisher中安排报告。我希望我的报告每月自动安排一次。 我正在使用重复间隔来传递我的频率。但问题是它接受以毫秒为单位的值。因此,对于这个月,我无法传递如此大的价值。有没有其他方法可以解决它?
有些人可以帮助我摆脱它。谢谢你。我在下面附上了我的代码。
package BIP;
import BIPschedule.ArrayOfEMailDeliveryOption;
import BIPschedule.DeliveryChannels;
import BIPschedule.EMailDeliveryOption;
import BIPschedule.ReportRequest;
import BIPschedule.ScheduleRequest;
public class ScheduleServiceClient
{
public static void main(String [] args) throws Exception
{
try
{
ScheduleService_Service scheduleService_Service = new ScheduleService_Service();
ScheduleService scheduleService = scheduleService_Service.getScheduleService();
// Testing runReport
System.out.println("Testing runReport Service");
ReportRequest req = new ReportRequest();
req.setAttributeCalendar("Gregorian");
req.setAttributeTimezone("GMT+5:30");
req.setAttributeFormat("pdf"); //type of the report
req.setAttributeLocale("en-US"); //Language
req.setAttributeTemplate("Simple"); //Template type
req.setReportAbsolutePath("/~weblogic/Customer Details.xdo"); //Absolute path of the report from BIP Catalog.
req.setSizeOfDataChunkDownload(-1); //to download all
ScheduleRequest sreq = new ScheduleRequest();
sreq.setReportRequest(req); //Set ReportRequest
sreq.setSaveDataOption(true);
sreq.setDataModelUrl("/~weblogic/Customer_details.xdm");
sreq.setBookBindingOutputOption(false);
sreq.setJobTZ("GMT+5:30");
sreq.setStartDate("2017-12-18T14:01:00");
sreq.setEndDate("2017-12-18T14:30:01");
sreq.setSaveOutputOption(true);
sreq.setMergeOutputOption(true);
sreq.setNotifyWhenFailed(false);
sreq.setNotifyWhenSuccess(false);
sreq.setNotifyWhenWarning(false);
sreq.setRepeatCount(5);
sreq.setUseUTF8Option(true);
sreq.setScheduleBurstringOption(false);
sreq.setSchedulePublicOption(true);
sreq.setUserJobName("Month");
sreq.setRepeatInterval("3600000");
String job_id = scheduleService.scheduleReport(sreq,"weblogic","weblogic123");
System.out.println("job_id:"+ job_id);
}catch (Exception ex){
ex.printStackTrace();
}
}
}
答案 0 :(得分:0)
使用cron表达式编写重复表达式。如果您有支持标识符,Oracle有一个支持文档示例。 Oracle支持文档1537293.1(如何使用BI Publisher Web Service ScheduleService WSDL安排重复作业)
另请参阅:https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm