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

Auto suggest text prompt Javascript implementation

Started by A_Cognos19, 27 Nov 2018 04:19:49 AM

Previous topic - Next topic

A_Cognos19

Hi all,

i'm new on Cognos , and i'm using cognos 11, Using interactive mode.

I have a data item ( for example Pos) with a big values list . i want to implement a text box prompt on which while typing a word or letters, the text box prompt suggest me only values of the (Pos ) item that contain  the word or letters that i typed.

For example the data item (Pos) has these values : 
1-distributeur de frein pann de frien bogie 1 motrice impaire, 
2-distributeur de frein pann de frien bogie 2 remorque 1 ,
3-distributeur de frein pann de frien bogie 2 remorque 2 ,
4-centrale, coupleur, bougie,
5-reducteur,
6-relais distributeur xa, ...etc.

->if i type in the text box prompt : "Distr", i want that the prompt suggest me ONLY values  contain the word "Distr" so these values :
1-distributeur de frein pann de frien bogie 1 motrice impaire, 
2-distributeur de frein pann de frien bogie 2 remorque 1 ,
3-distributeur de frein pann de frien bogie 2 remorque 2 , 
6-relais distributeur xa.

Thank you for your help.

CognosPaul

I have a solution that does exactly what you're asking for.
The attached zip contains the libraries, css, and a report XML showing how to use it.

You'll need to change the SearchPrompt.js to point to the correct location of your sol.js and sol.css. You can use an absolute path or a relative, like this. The report will also need to be modified to point to the correct SearchPrompt.js location.

A_Cognos19

Hi Paul,
thank you for your help  :).


Can you tell me steps to implement this solution. i'm a new user of cognos ( only 1  week).


thank you in advance for all

CognosPaul

You will need to put the js and css files in the zip onto a webserver somewhere. It could be in the cognos webcontents, but somewhere you can easily access.

You need to be able to call them with http://servername/folder/SearchPrompt.js
Remember to modify the links to the css and sol.js inside searchprompt.js

Once you get that working open the report I included in the zip. You can right click "Report" on the left pane and "open report from clipboard". In the custom control, replace url so it points to your js file and hopefully it should work great.

pankkish

#4
Hi Paul,

Actually the requirement is to autocomplete Cognos value/text prompt with auto submit with custom control. I had used your script which is implemented using inline JavaScript which is working fine but unable to convert  this inline code into custom control unable for more scalability.

Could you please advice me .
Your help will be highly appreciable.

radid8460

Hi Paul,
thanks a lot, I am able to use your script in interactive mode but if I want to use it without interactive mode ..!!! is it possible ...!!! if so, could you please help me out with this. gonna be so helpful . thanks

CognosPaul

Hi Radid, I wish there was a way. Unfortunately controls like this only work in interactive mode.