Author Topic: Cognos SDK schedule object properties  (Read 5033 times)

Offline hnawaz

  • Associate
  • **
  • Join Date: Feb 2017
  • Posts: 4
  • Forum Citizenship: +0/-0
Cognos SDK schedule object properties
« on: 26 Feb 2017 09:13:42 pm »
Hey Folks, I'm working on a SDK .Net app for scheduling.  Based on the samples provided by IBM I'm able to schedule reports on daily basis.  But I want the extend this to week and month.  I'd really appreciate if someone can provide, or guide me on setting weekly and monthly nmtoken values.  Please let me know if you need more information. Thanks for your time.

Below code sets nmtokenProp for daily schedule.
// a few more sched options.
nmtokenProp tp = new nmtokenProp();
nmtokenProp dailyPeriod = new nmtokenProp();
active.value = true;
dailyPeriod.value = "minute";
frequency.value = "10";
startDate.value = DateTime.Now.Date;
tp.value = "daily";


Offline Andrew Weiss

  • Community Leader
  • *****
  • Join Date: Jun 2008
  • Posts: 89
  • Forum Citizenship: +5/-0
    • Avnet BSP Software
Re: Cognos SDK schedule object properties
« Reply #1 on: 27 Feb 2017 08:36:35 am »
Hnawaz,

This is pretty easy to accomplish with JavaScript using MetaManager's API over Cognos.  More details here:
http://www.bspsoftware.com/products/metamanager/API/

To help with the SDK approach you'll need to set the type to "weekly"

nmtokenProp tp = new nmtokenProp();
tp.value = "weekly";

Then set the boolean values for weeklyMonday through weeklySunday

Set the integer property everyNPeriods for the "Every n weeks" part

Thank You,
-Andy



MetaManager makes administering IBM Cognos a breeze.  http://www.bspsoftware.com/MetaManager

Offline hnawaz

  • Associate
  • **
  • Join Date: Feb 2017
  • Posts: 4
  • Forum Citizenship: +0/-0
Re: Cognos SDK schedule object properties
« Reply #2 on: 27 Feb 2017 07:21:31 pm »
Hi Andrew,

Thanks for the reply. It helped me figure out the weekly bit of the schedule. But I'm not having any luck with Monthly part.  I'm trying to set a schedule on day one of every month with below code and it's throwing a generic error. Am I missing a parameter for monthly schedule. Thanks.

          // sched options.
            active.value = true;
            day.value = "1";
            frequency.value = "1";
            startDate.value = DateTime.Now.Date;
            tp.value = "monthly";


            sched.active = active;
            sched.monthlyAbsoluteDay = day;
            sched.everyNPeriods = frequency;
            sched.type = tp;
            sched.startDate = startDate;



Offline hnawaz

  • Associate
  • **
  • Join Date: Feb 2017
  • Posts: 4
  • Forum Citizenship: +0/-0
Re: Cognos SDK schedule object properties
« Reply #3 on: 02 Mar 2017 09:41:19 pm »
For anyone pulling his/her hair on this; monthly type value is "monthlyAbsolute".  I guess IBM wants sdk to be a black box for .net folks at least.
« Last Edit: 02 Mar 2017 09:45:38 pm by hnawaz »