Cognos Analytics

 View Only
  • 1.  RaaS - report as a service

    Posted Tue November 29, 2022 11:14 AM
    Hi 
    Is it possible to consume a cognos bi report as a web service(soap/rest)?

    Thanks

    Moises


    #CognosAnalyticswithWatson


  • 2.  RE: RaaS - report as a service

    Posted Wed November 30, 2022 03:37 AM
    Hi Moises, 

    Unfortunately, no. We have the same requirement as some of our customers wanted to use Cognos report data in power BI using api data source. We are creating a REST API using SDK that a) authenticates the user using the credentials passed to the API call b) takes the saved report output in xml format using the object ID passed to the api call c) converts it to json using a third party library d) and returns the json to the caller. I know this is cumbersome but this seems to be the only option at this point. I even asked about providing a JSON export for reports, which they say is being looked into (knowing the way enhancements are prioritized by IBM God knows for how long it will be looked into :-) ) that might at least eliminate some steps in this process. But nevertheless, there is no direct way. 

    Note that I mentioned saved output because reports might take long time to execute and api calls may time out in this process, so we set the report properties to View Most Recent Output and schedule the report to save xml output which will be used as the input to rest API. 

    Regards

    ------------------------------
    Kiran Passumarthi
    www.linkedin.com/in/kiranpassumarthi
    ------------------------------



  • 3.  RE: RaaS - report as a service

    IBM Champion
    Posted Wed November 30, 2022 06:54 AM
    Edited by System Fri January 20, 2023 04:13 PM

    Hi Moises,

    the Cognos Mashup Sevice (CMS) sounds like what you are looking for (In fact, the early internal working name for CMS was "RaaS - reports as a service". 😎). CMS is built into CA, so it's ready to be used (there are samples available as well).  CMS provides both a REST interface and a SOAP (doc/lit) interface to consume a Cognos report as a web service. CMS also allows you to choose the output format used in the response, to match your needs (for your usecase, you probably want to look at the DataSet, DataSetJSON, or the JSON output formats).


    Here's a link to the documentation on Cognos Mashup Service: https://www.ibm.com/docs/en/cognos-analytics/11.0.0?topic=guide-overview-mashup-service 

    The above documentation will show you the options on how to authenticate (including the CMS auth service option), how to send a request to the report web service, for the respective report (and specify the desired output format), and more advanced use cases (such as dealing with prompts and how to work with saved report output versions in the CMS API).

    jim



    ------------------------------
    Jim Boland
    LinkedIn: https://www.linkedin.com/in/jimboland
    ------------------------------



  • 4.  RE: RaaS - report as a service

    Posted Wed February 15, 2023 06:40 AM
    Edited by Anitha Royal Wed February 15, 2023 06:41 AM

    Hi , 

    I cant find the cms c# samples which was suppose to be there in installation_location/sdk/cms_samples/csharp/ path as mentioned in the documentation https://www.ibm.com/docs/en/cognos-analytics/11.2.0?topic=dmsausi-logging-logging-off 

    can somebody provide the correct path or else any sample cms C# sample code as im getting null report content using the getReportData command.

    I have tried the below code to get the ReportData using ReportDataService object (C# application). after successfull authentication accessed by adding  generic service WSDL file(http://webservername:portnumber/ibmcognos/bi/v1/disp/rds/wsdl)

                ReportDataService svc = new ReportDataService();
                svc.biBusHeaderValue = new Generic.biBusHeader();
                svc.biBusHeaderValue.Any = authService.biBusHeaderValue.Any;
                svc.Url = url;
                GetReportDataRequest request = new GetReportDataRequest();
                request.sourceID = StoreID;
                request.sourceType = SourceTypeEnum.report;
                request.format = "JSON";
                GetOutputResponse outputResponse = new GetOutputResponse();
                outputResponse = svc.getReportData(request);
                outputResponse.output.ToString();

     



    ------------------------------
    Anitha Royal
    ------------------------------



  • 5.  RE: RaaS - report as a service

    Posted Wed February 15, 2023 09:42 AM

    Hi Anitha, 

    As per request, the cms samples have been removed from the CA product release since CA 11.0.0 release. Right now only JavaScript cms samples are available to download from online.  Hope this helps.

    https://community.ibm.com/community/user/businessanalytics/blogs/steven-macko/2017/01/16/how-to-use-ibm-1022-cognos-mashup-service-cms-samples-in-ibm-cognos-analytics-11



    ------------------------------
    KELLY XIAO
    ------------------------------



  • 6.  RE: RaaS - report as a service

    Posted Wed May 10, 2023 05:09 AM
    Edited by Anitha Royal Wed May 10, 2023 11:01 AM

    Hello Jim, 
    Can we even get the saved report output versions of ReportViews (prompt values are set in properties) using Mashup REST API URLs . We tried with the below URL but when we are trying it is returning the error message object . This is happening only with a report with prompts filters but not with the report filters. 
    Can you please suggest to resolve this issue.


    http://ServerName/ibmcognos/bi/v1/disp/rds/auth/passthrough?xmlData=<credentials><credentialElements><name>CAMNamespace</name><label>myNameSpaceLabel</label><value><actualValue>myNameSpaceID</actualValue></value></credentialElements><credentialElements><name>CAMUsername</name><label>User ID:</label><value><actualValue>myUserID</actualValue></value></credentialElements><credentialElements><name>CAMPassword</name><label>Password:</label><value><actualValue>myPassWord</actualValue></value></credentialElements></credentials>&location=/bi/v1/disp/rds/reportData/report/iDC87148C4F6645CFAD593B60695A8297



    ------------------------------
    Anitha Royal
    ------------------------------



  • 7.  RE: RaaS - report as a service

    IBM Champion
    Posted Wed November 30, 2022 10:01 AM

    Cognos has a very rich REST API that exposes many of the elements in various formats.

    In addition to what Jim posted, here's a super quick cheat sheet:

    Construct the URL like this: https://SERVER/ibmcognos/bi/v1/disp/rds/reportData/searchPath/<SEARCHPATH>?fmt=datasetJSON&async=off&p_pYear=2022&p_pParameterWithSpecialCharacters=<![CDATA[aa%^&*a]]>

    In addition to JSON you can also have it return HTML or HTML fragments, it can even convert the report into images.

    I use CMS for a number of tools, including my Alerts system:


    In the background it's running a report, with data filters specific to the user, and then generating various types of alerts (showing Banner and Toast here)

    I've also used it to make a search prompt that doesn't require the report be submitted to see the results.

    Outside of Cognos I've used CMS to populate the screen of a CRM, and another time to embed data in an education website.

    In addition to the reports, you can also use the Cognos REST API to read and work with Cognos programmatically. https://www.ibm.com/docs/en/cognos-analytics/11.2.0?topic=api-rest-reference. This is security aware, so it won't show objects the user doesn't have access to. 



    ------------------------------
    Paul Mendelson
    ------------------------------



  • 8.  RE: RaaS - report as a service

    IBM Champion
    Posted Wed November 30, 2022 10:31 AM
    Hi Moises,

    REST API is fully supported and updated with new features in every release.
    Cognos Mashup Service (CMS) is a quite old technology, still supported (I believe). The CMS documentation is located within Cognos BI 10.2.2 documentation

    If you are starting to write something, it is a better idea to start with REST API.

    Best regards

    ------------------------------
    Patrick Neveu
    Positive Thinking Company
    ------------------------------



  • 9.  RE: RaaS - report as a service

    Posted Wed November 30, 2022 11:04 AM
    Thanks for the info!  I will take a look.

    Moises