If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Recent posts

#1
Reporting / Re: issues with casting a numb...
Last post by bus_pass_man - Yesterday at 05:25:47 AM
If you export it as a CSV and open the CSV in an editor such as notepad++  what does the data look like?

Quotebut now the values come through as scientific notation,
In Excel or Cognos?


#2
Reporting / issues with casting a number t...
Last post by hespora - Yesterday at 04:53:05 AM
Hi all,


i'm in the situation that I need to export an excel file from C11 that does not observe my system's settings for number formatting. I.e., my PC is setup in German, so decimal delimiter comma and thousands delimiter point, but I need to export a number column with decimal delimiter point and thousands delimiter none.

I know that I can pretty much forget plain data formatting within Cognos; if excel recognizes the column as number, it ignores whatever cognos formatting is there and applies its own. So I thought I can just cast the value as varchar(99), but now the values come through as scientific notation, e.g., 182.144 becomes 1.82144E+02.

Is there any way I can get what I need?

#3
SDK / Re: REST API users call
Last post by dougp - 11 Sep 2025 12:07:42 PM
Quote from: jackson.eyton on 16 Apr 2024 02:39:19 PMYou certainly can use the credentials method as specified for 11.2.4, ...

...(I'm forced to use powershell, please... someone help me...)...

I put my code between calls to these functions.  It asks for my user name and password when I run it.  Using a CA API key could improve this.  It should probably require the namespace name as a parameter rather than hard-coding it.  But I have only one namespace, so this works for me.

function start-CognosSession {<#
    .SYNOPSIS
    Start a Cognos REST API session.
 
    .DESCRIPTION
    docs at http://<cognos_analytics_server>:<port>/api/api-docs
    Asks for user name and password
    Exits on empty password

    .PARAMETER serverName
    Cognos server to use.
 
    .EXAMPLE
    start-CognosSession "CognosServer.company.com"
 
    #>
    [CmdletBinding()]
    param(
        [parameter(position=0, mandatory=$true)]
        [PSCustomObject]$serverName
    )
    # Write-Host "start-CognosSession start"
    $CognosSession = [PSCustomObject]@{}

    $protocol = "https"
    $port = "9300"
    $uriBase = "$protocol`://$serverName`:$port"
    $contentType = "application/json; charset=utf-8"

    $CognosSession | Add-Member -MemberType NoteProperty -Name 'protocol' -Value $protocol
    $CognosSession | Add-Member -MemberType NoteProperty -Name 'serverName' -Value $serverName
    $CognosSession | Add-Member -MemberType NoteProperty -Name 'port' -Value $port
    $CognosSession | Add-Member -MemberType NoteProperty -Name 'uriBase' -Value $uriBase
    $CognosSession | Add-Member -MemberType NoteProperty -Name 'contentType' -Value $contentType
   
    $userNamespace = "MyNamespaceName"
    $userName = Read-Host "User Name"
    $UserPwd = Read-Host "Password" -AsSecureString
   
    $err = $false

    try {
        $userPassword = ConvertFrom-SecureString -SecureString $UserPwd -AsPlainText
    }
    catch {
        Write-Host "Empty password.  Quitting."
        $err = $true
    }

    if (!$err) {
        $bdy = [PSCustomObject]@{}
        $paramarray = @()
        $param = [PSCustomObject]@{}
            $param | Add-Member -MemberType NoteProperty -Name 'name'  -Value "CAMNamespace"
            $param | Add-Member -MemberType NoteProperty -Name 'value' -Value $userNamespace
            $paramarray += $param
        $param = [PSCustomObject]@{}
            $param | Add-Member -MemberType NoteProperty -Name 'name'  -Value "CAMUsername"
            $param | Add-Member -MemberType NoteProperty -Name 'value' -Value $userName
            $paramarray += $param
        $param = [PSCustomObject]@{}
            $param | Add-Member -MemberType NoteProperty -Name 'name'  -Value "CAMPassword"
            $param | Add-Member -MemberType NoteProperty -Name 'value' -Value $userPassword
            $paramarray += $param
        $bdy | Add-Member -MemberType NoteProperty -Name 'parameters' -Value $paramarray
        $body = ConvertTo-Json $bdy
        $uri = "$uriBase/api/v1/session"
       
        $a = Invoke-RestMethod `
                -Uri $uri `
                -Method Put `
                -contentType $contentType `
                -SessionVariable "Session" `
                -Body $body
       
        # next line throws error, but retrieves a XSRF-Token cookie
        Write-Host "Ignore the next error.  The next line throws an error, but retrieves a XSRF-Token cookie."
        $a = Invoke-RestMethod -Uri $uri -Method Get -contentType $contentType -WebSession $Session
        $CognosSession | Add-Member -MemberType NoteProperty -Name 'Session' -Value $Session -TypeName 'Microsoft.PowerShell.Commands.WebRequestSession'
       
        $Cookies = $Session.Cookies.GetCookies($uri)
        $XSRFTOKEN = $Cookies["XSRF-TOKEN"].Value
       
        [System.Collections.IDictionary]$headers = @{
            'x-xsrf-token' = $XSRFTOKEN
            'accept' = 'application/json'
            'Cache-Control' = 'no-cache'
        }
       
        $CognosSession | Add-Member -MemberType NoteProperty -Name 'Headers' -Value $headers

        $CognosSession
    }
    else {
        $null
    }
    # Write-Host "start-CognosSession end"
}

function stop-CognosSession {<#
    .SYNOPSIS
    End a Cognos REST API session.
 
    .DESCRIPTION

    .PARAMETER CognosSession
    CognosSession object created by start-CognosSession
 
    .EXAMPLE
    end-CognosSession -CognosSession $CognosSession
 
    #>
    [CmdletBinding()]
    param(
        [parameter(position=0, mandatory=$true)]
        [PSCustomObject]$CognosSession
    )
    # Write-Host "stop-CognosSession start"
    # log out
    $uri = "$($CognosSession.uriBase)/api/v1/session"
    Invoke-RestMethod -Uri $uri -Method Delete -WebSession $CognosSession.Session
    # Write-Host "stop-CognosSession end"
}

start-CognosSession returns an object with environment parameters, so I can use that later, like this...

$CognosSession = start-CognosSession -serverName $serverName
$uriBase     = $CognosSession.uriBase
$protocol    = $CognosSession.protocol
$serverName  = $CognosSession.serverName
$port        = $CognosSession.port
$Session     = $CognosSession.Session
$headers     = $CognosSession.Headers
$contentType = $CognosSession.contentType
$uri = "$uriBase/api/v1/content"
$content = Invoke-RestMethod -Uri $uri -Method Get -Headers $headers -contentType $contentType -WebSession $Session
$content.content | Format-List
stop-CognosSession -CognosSession $CognosSession
#4
SDK / Re: REST API users call
Last post by dougp - 11 Sep 2025 11:58:23 AM
I somehow missed this thread.  Maybe could have helped speed my learning...

I can't get this working in 12.0.4 (didn't try in 11.2.4).  My problem is a timeout.  I am using an Active Directory external directory namespace with probably 14,000 users and many many groups.  I'd guess only users are being listed by this call because this seems to be about user profiles.  But 14,000 seems to be too much.  Although, I can get all 14,000 users and count them using Get-ADUser in PowerShell in about 12 seconds.  So I don't know where the slowdown is using the Cognos REST API.

If patternghost is still watching this thread...  How many users in the directory namespace where you had success?

I'm not seeing in the thin documentation IBM provides...  Is there an option to restrict the number of items returned per call, and iterate through to the next group of results?  Maybe something like:

$uriBase/api/v1/users?identifier=$namespace&top=$top&skip=$skip
I see in 12.0.x there is a new option under Accounts:  /namespace_folder/{id}/items

That looks promising.  I should be able to use...
$uriBase/api/v1/namespace_folder/$namespace/items?limit=$limit&offset=$offset...to limit my call to something of a reasonable size that should return in a reasonable time.

But...

id is required and is also labeled Folder id.  But nowhere is "Folder id" defined.  I tried using my namespace name (which has the appearance of a folder in the Security tab in Cognos Administration) and got:

Invalid id format.

Is anyone here aware of any actual documentation for the Cognos Analytics REST API?
#5
SDK / Re: REST API users call
Last post by jackson.eyton - 11 Sep 2025 09:51:55 AM
Quote from: patternghost on 27 May 2021 09:56:54 AMAfter trial and error, I found that if I send /users?identifier=<namespace> will return all users in the namespace.  I can work with that.


Can you confirm this still works? I cant seem to get this to work on 11.2.4
#6
General / Re: How Do You Usually Bring I...
Last post by cognostechie - 30 Aug 2025 06:48:52 PM
My idea is that you have to use all methods of marketing. One might be better than the other but all channels should be used. There are companies who sell information of which company uses which software. Dun & Bradstreet is one of them. Global Software Leads is another. YouTube and other media can also be used. Users forums also. 
#7
Reporting / Re: Cognos Images
Last post by dougp - 26 Aug 2025 10:27:41 AM
I would think that "../images/" leads to <CA Install>\images.  But that wouldn't work because images should be in <CA Install>\webcontent\bi\images.

I remember Cognos having trouble with images years ago.  I'm not 100% certain how (or if) I completely fixed it.  But it seems that presenting images in PDF and XLSX outputs is what the new Image Service is all about.  Have you tried that?
#8
Reporting / Re: Is it possible in a report...
Last post by dougp - 26 Aug 2025 10:11:03 AM
You can create a filter based on any data element available to the report.
#9
Reporting / Is it possible in a report to ...
Last post by jonathan.brotto@imperiald - 25 Aug 2025 03:48:42 PM
I have experience with other tools and was wondering how to filter a report by date.
#10
General / How Do You Usually Bring In Ne...
Last post by lukwiso - 19 Aug 2025 03:29:58 PM
I'm curious how people in different industries go about finding new leads. Do you mostly run ads, rely on word-of-mouth, attend events, use social media, or something else? I figure every niche has its own way of doing things, so I'd love to hear a mix of ideas.
For me, I've been experimenting with a few options this past year. One that worked well was BestMovingLeadsProviders.com, which is geared toward the moving industry. The leads I got were pretty solid, and I noticed both the number and quality of inquiries improved quite a bit.
Has anyone else here tried using a third-party lead provider? Did it end up being worth it, or did you find other strategies that delivered better results?