COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: VCrothers1991 on 26 Feb 2018 08:06:29 AM

Title: Cognos Custom Controls
Post by: VCrothers1991 on 26 Feb 2018 08:06:29 AM
Hi All,

Hoping somebody can give me a hand with custom controls. I am trying to re-use some of the samples provided in CA11 but am not having any luck.

I seem to have all the Module Path and files installed correctly but the chart/controls are not redndering and instead i am getting string data like below. This example is the D3 Bar chart sample.

{"columns":[{"name":"Region","dataType":"string","values":["","NAM-GCB","Korea","EMEA","Asia Pacific","Japan","Mexico","Latin America","ICG"]},{"name":"Total Triggers","label":"Revenue","dataType":"number", "format": {
"type": "numberFormat"}
}],"rows":[[0,136380],[1,18210],[2,1296],[3,33474],[4,41544],[5,35628],[6,6948],[7,10548],[8,103770]]}


Has anyone any ideas on what i am doing wrong? Would be grateful if you could assist.

Thanks,
Viktor
Title: Re: Cognos Custom Controls
Post by: VCrothers1991 on 26 Feb 2018 09:19:51 AM
Forgot i had full interactivity to 'No'.

Changed this to yes but getting an error which looks like the report cannot find the js library.

Scriptable Report Error

Module: opt/Cog11/webcontent/samples/NewVisualization/C_NewVisualizationColumn.js

Description:
Failed to load modulke
script error
opt/Cog11/webcontent/samples/NewVisualization/C_NewVisualizationColumn.js


Any other ideas?
Title: Re: Cognos Custom Controls
Post by: dougp on 27 Feb 2018 11:20:59 AM
QuoteFailed to load module

...may mean it couldn't find it and may mean that your JavaScript is not compatible with RequireJs.  Read the blog post (https://www.ibm.com/communities/analytics/cognos-analytics-blog/javascript-support-in-interactive-viewer/) and docs (linked from the blog) regarding the module path.  Build a simple sample RequireJs app (not in Cognos) to become more comfortable with that coding paradigm.
Title: Re: Cognos Custom Controls
Post by: VCrothers1991 on 01 Mar 2018 02:49:06 AM
Not sure this is the case, it is a straight copy of the samples provided by IBM
Title: Re: Cognos Custom Controls
Post by: CognosPaul on 01 Mar 2018 08:04:37 AM
I think the problem is that you're referencing the webcontent folder. In general that is set as the path in the webserver, so you shouldn't need to reference it.

http://opt/Cog11/samples/NewVisualizatoin/C_NewVisualization.js

You also need to be careful when not using fully qualified domains. The path is different went running from report studio versus running from connection.

I opened an RFE trying to get them to allow users to upload controls to make this part easier. Consider voting for https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=102650