Planning Analytics with Watson

Expand all | Collapse all

PAX API

  • 1.  PAX API

    Posted Fri July 16, 2021 12:45 PM
    Hi,

    I was following the YouTube tutorial to set up PAX and to use the exploration. I followed the steps to setup in PAx API
    Ibm remove preview
    PAx API
    Using an application programming interface (API), you can automate the refreshing or publishing of content. You can use the API to create a scheduled batch program to refresh content on a daily, weekly, or monthly basis so that, as your period data changes, the affected files are kept up-to-date.
    View this on Ibm >

    I then followed the youtube tutorial in the user guide Add and execute IBM Cognos automation API functions
    YouTube remove preview
    Add and execute IBM Cognos automation API functions
    In this video, you'll learn how to add and execute IBM Cognos automation API functions in IBM Planning Analytics for Microsoft Excel.
    View this on YouTube >
    However when I tried to run the Macro, I received "The given key was not present in the dictionary." error and the details "

    System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

    at Cognos.Office.Framework.Automation.AutomationServer.Application(String plugin, String version)"

    THe line of code I had was:
    Public Sub Create()
    Reporting.Explorations.Create ["http://test.tech", "24Retail","Revenue", "Compare"]
    End Sub

    Thanks for your help



    ------------------------------
    Siew Ho
    ------------------------------


  • 2.  RE: PAX API

    Posted Mon July 19, 2021 09:17 AM
    Siew,

    Please make sure you have followed the "Necessary IBM Cognos automation API references" documentation which can be found below.

    https://ibm.github.io/paxapi/#log-automation-activities-and-errors

    Specifically, you need to make sure the following VBA code block exists in order to reference the COM object correctly.

    Dim m_oCAFE As Object
    
    Private m_oCOAutomation As Object
    
        'Returns the instance of the Cognos Office Automation Object.
        Public Property Get CognosOfficeAutomationObject()
        On Error GoTo Handler:
    
            'Fetch the object if we don't have it yet.
            If m_oCOAutomation Is Nothing Then
                Set m_oCOAutomation = Application.COMAddIns("CognosOffice12.Connect").Object.AutomationServer
            End If
    
            Set CognosOfficeAutomationObject = m_oCOAutomation
    
            Exit Property
        Handler:
            '<Place error handling here.  Remember you may not want to display a message box if you are running in a scheduled task>
        End Property
    
        'Returns the instance of the Cognos Office Automation Object.
        Public Property Get Reporting()
        On Error GoTo Handler:
    
           'Fetch the object if we don't have it yet.
           If m_oCAFE Is Nothing Then
               Set m_oCAFE = CognosOfficeAutomationObject.Application("COR", "1.1")
           End If
    
           Set Reporting = m_oCAFE
    
           Exit Property
        Handler:
           MsgBox "Error"
           '<Place error handling here.  Remember you may not want to display a message box if you are running in a scheduled task>
        End Property​


    ------------------------------
    Matt Hopkins
    Senior Software Engineer
    QueBIT Consulting
    ------------------------------



  • 3.  RE: PAX API

    Posted Mon July 19, 2021 08:23 PM
      |   view attached
    Hi Matt,

    Thank you for your response. I have ensured the codes was copied into the CognosOfficeAutomationExample.bas previously as seen in image. I have followed the instructions quite closely and cannot work out what is missing.

    ------------------------------
    Siew Ho
    ------------------------------



  • 4.  RE: PAX API

    Posted Thu July 22, 2021 12:06 PM

    I know not related to the subject, but is there an IBM network outage ?

     

    I can't get through to the IBM servers, or onto the PA help/support portal.

     

    regards

     

     

    Phil Lidstone

    Finance Systems Technician

    UK Finance – 1st Floor, 3000b Parkway, Fareham

    ( Direct:  Internal: 7605 1732, External: +44 (0) 1489 561732

    ( Mobile:  +44 (0) 7825 396931 (Emergency/BRP use only)
    *
    Mail:  phillip.lidstone@uk.zurich.com

     

     






  • 5.  RE: PAX API

    Posted Thu July 22, 2021 12:07 PM

    Yes, we have the same issue.

     

    Paul

     






  • 6.  RE: PAX API

    Posted Thu July 22, 2021 12:09 PM

    As long as its not just me... really inconvenient time as we were running some UAT on a new application.

     

    regards

     

     

    Phil Lidstone

    Finance Systems Technician

    UK Finance – 1st Floor, 3000b Parkway, Fareham

    ( Direct:  Internal: 7605 1732, External: +44 (0) 1489 561732

    ( Mobile:  +44 (0) 7825 396931 (Emergency/BRP use only)
    *
    Mail:  phillip.lidstone@uk.zurich.com

     

     

    ******************* PLEASE NOTE ******************* This message, along with any attachments, may be confidential or legally privileged. It is intended only for the named person(s), who is/are the only authorized recipients. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Thank you for your help.
    -------------------------------------------------

    All of the companies listed below are part of a group of companies of which the ultimate parent company is Zurich Insurance Group Ltd, a company registered in Switzerland No. CH-020.3.023.083-6/a. Zurich is a trading name of this group of companies.

    Zurich Insurance plc is a public limited company incorporated in Ireland Registration No.13460. Registered office: Zurich House, Ballsbridge Park, Dublin 4, Ireland.

    The UK Branch of Zurich Insurance plc is registered in England and Wales No.BR7985. Registered office: The Zurich Centre, 3000 Parkway, Whiteley, Fareham, Hampshire PO15 7JZ.

    Zurich Insurance plc is authorised and regulated by the Central Bank of Ireland. Authorised by the Prudential Regulation Authority and with deemed variation of permission. Subject to regulation by the Financial Conduct Authority and limited regulation by the Prudential Regulation Authority. Details of the Temporary Permissions Regime, which allows EEA-based firms to operate in the UK for a limited period while seeking full authorisation, are available on the Financial Conduct Authority’s website. Our FCA Firm Reference Number is 203093.

    Each of the following companies has its registered office at The Grange, Bishops Cleeve, Cheltenham GL52 8XX.

    Zurich Financial Services (UKISA) Limited is registered in England and Wales No. 01860680.

    Zurich Assurance Ltd is registered in England and Wales No.02456671. Zurich Assurance Ltd is authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority. Zurich is used as a trading name of Zurich Assurance Ltd.

    Zurich Intermediary Group Limited is registered in England and Wales No. 01909111 and is authorised and regulated by the Financial Conduct Authority.

    Any views or opinions expressed in this email are those of the author only. Communications may be monitored to improve our service and for security and regulatory purposes.

    The information contained in this message is confidential and may be legally privileged. This message is intended for the addressee(s) only. If you are not the intended recipient, please do not read, copy or otherwise use it and do not disclose it to anyone else. Please notify the sender of the delivery error and then delete the message from your system. Thank you for your assistance.





  • 7.  RE: PAX API

    Posted Thu July 22, 2021 12:13 PM

    I've emailed our rep, given we can't raise a ticket as we can't log on...there's never a good time!

     






  • 8.  RE: PAX API

    Posted Fri July 23, 2021 09:10 AM
    Siew,

    Can you try and remove the hard brackets from the create call? Also, do you have "http://test.tech" system configured as a connection in PAFE?

    Try the following instead.

    Public Sub Create()
    Reporting.Explorations.Create "http://test.tech", "24Retail","Revenue", "Compare"
    End Sub

    ------------------------------
    Matt Hopkins
    Senior Software Engineer
    QueBIT Consulting
    ------------------------------



  • 9.  RE: PAX API

    Posted Mon July 26, 2021 04:03 PM

    original failure here sounded like was not able to get the reporting object (as if PA for Excel was not installed/active)?

    not sure where things stand now, can you also describe the runtime environment? (using both Cognos for MS Office and PA for Excel, which versions, etc)

    Thanks,


    --
    Ted



    ------------------------------
    Ted Phillips
    ------------------------------



  • 10.  RE: PAX API

    Posted Tue July 27, 2021 02:42 AM
    Hi, Sorry it took a while, I have tried removing the brackets, the error persist. 

    I installed IBM_PAfE_x86_2.0.65.11

    Thanks for your assistance

    ------------------------------
    Siew Ho
    ------------------------------



  • 11.  RE: PAX API

    Posted Fri August 20, 2021 02:35 AM
    Edited by George Tonkin 30 days ago
    HI Siew,

    Did you previously enable the IBM Framework for Office as a COM add-in as well?
    Without this you will get various errors as oCOAutomation objects will always be "nothing".

    With PAfE 2.0.65 onwards, make sure that all PAfE and the IBM framework have been uninstalled.
    I had an issue where my installation was not showing in Add or Remove Programs and I had to run the Uninstall from the folder in C:\Program Files\ibm\cognos\.  Once this was removed and I restarted Excel with PAfE, in my case 2.0.67, all worked as expected.

    ------------------------------
    George Tonkin
    ------------------------------