I have downloaded the below SDK example:
SDK sample to schedule a report to run and create a report view.
I can run the example against our cognos server successfully to create a schedule, but instead of creating a report view, I would like the delivery of the report to be sent
to email recipients using the SDK.
If I go into the schedule page of the report using the Cognos Web Interface, I can set this information:
"Send a link to the report by email"
I can then configure the email recipients, set whether the report attachments and/or links should be set out with the email, the body
of the email and the subject.
I would also like to use the SDK to set the Prompt Values for report.
(see attached file -> SetEmailAndPromptValues.jpg)
Could anybody point me in the right direction using the SDK to:
Create a schedule with delivery email information set and override the default report prompt values.
Again the SDK sample that I have noted above works, but I cannot figure out what runoptions to use and the format of the runoptions
to properly set the email and override prompt info.
This topic has been locked.
1 reply Latest Post - 2012-07-18T06:33:17Z by murali999
Pinned topic Cognos SDK Create Schedule and then add Email Delivery and set Prompt Value
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-07-18T06:33:17Z at 2012-07-18T06:33:17Z by murali999
murali999 270004WRWN9 PostsACCEPTED ANSWER
Re: Cognos SDK Create Schedule and then add Email Delivery and set Prompt Value2012-07-18T06:33:17Z in response to SystemAdminHi Matt,
You can use the RunOptionBoolean to set the email Delivery , try the below code it will work
OptionArrayProp oap = new OptionArrayProp(); Option opt= new Option; //To set the email option to true RunOptionBoolean email= new RunOptionBoolean(); email.setName( "email"); email.setValue( "true"); //To set the email as attachment to true RunOptionBoolean emailattach= new RunOptionBoolean(); emailattach.setName( "emailAsAttachment"); emailattach.setValue( "true"); //To set the email as URL/Link to true RunOptionBoolean emailurl= new RunOptionBoolean(); emailurl.setName( "emailAsURL"); emailurl.setValue( "true"); //To set the Email Addresses DeliveryOptionAddressSMTPArray smtpArray= new DeliveryOptionAddressSMTPArray(); smtpArray.setName(DeliveryOptionEnum.toAddress); // To set the ToAddress AddressSMTP emailAddresses = new AddressSMTP; AddressSMTP emailAddress1 = new AddressSMTP(); emailAddress1.setValue( "firstname.lastname@example.org"); emailAddresses=emailAddress1; AddressSMTP emailAddress2 = new AddressSMTP(); emailAddress2.setValue( "email@example.com"); emailAddresses=emailAddress2; smtpArray.setValue(emailAddresses); // To set the delivery Option Array opt.setValu(email) opt.setValue(emailattach); opt.setValue(emailurl); opt.setValue(smtpArray); oap.setValu(opt); // to set the options array prop schede.setOptions(oap); // here schedule is Schedule object