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

Text Box Prompt validation - Urgent

Started by sg24, 25 Apr 2011 04:24:42 AM

Previous topic - Next topic

sg24

Hi Folks,

I need to validate a text box prompt which is optional in the report page. The user would be entering a emp code and if the entered emp code is not valid, it would result in displaying a message saying , " the emp is not in the manager's hierarchy"

Any help, please let me know as this is bit urgent.

Thanks,
Sg

melee

What criteria are you looking for? I covered this topic on my blog.

http://nicbertino.com/?p=57

Arsenal

I think what he is asking for is that whenever a value is entered by the user in the employee id text box prompt, it should validate against the values that exist on the DB(perhaps via a refresh button or maybe on hitting Finish, the JS is able to load back the prompt page with an alert saying "this id does not exist" or some such)...in other words, there is no way of knowing if the emp id exists or no without looking up the DB (as opposed to say, knowing that the inputted text should not be more than 100 chars, or should not contain special chars etc. which you can code into the JS to check for)

Am no JS expert, but I think the only way this can be done is to have a hidden value prompt load up all the emp id's, then on refresh/finish, the JS grabs the value from the text box, compares it against values on the hidden value prompt and unless it finds a match, it issues the alert and reloads the prompt page.

Might be a big performance problem if there is a very large number of emp id's.

I think in this case, a select and search prompt might be a better option because really, that exact functionality is what is being asked for, by way of a text box prompt...if I've understood the question correctly  ;)

Lynn

I have to agree with Arsenal on this one. A search and select prompt seems like a very simple solution to the problem. Just because a requirement is "possible" doesn't mean it is worth the time and effort when there are viable alternatives.

You mentioned previously that you are running Cognos 8.0  :o which complicates things for you even more. Whatever you implement may very well break when you upgrade (and you will need to upgrade at some point).

If the idea of a search and select prompt is not palatable for whatever reason, then the report could just run with whatever value the user supplies and present a "not found" message if they enter a bogus ID. Hopefully this would give the user a pretty big clue that he/she ought to re-run with some other criteria. Unless there are severe performance problems this could be another reasonable alternative.

Since you are still running 8.0, you don't have the "No Data" functionality that was introduced later. There is a real cost associated with implementing requirements that are not supported "out of the box". These costs are increased by running (seriously) older versions and missing out on all the improvements that have been incorporated along the way.

cognostechie

I agree too. No point re-inventing the wheel when the functionality already exists. In fact, it is quite possible that the Text Box prompt with a validation was asked for simply because they didn't know about the existance of Select & Search prompt and it's functionality.

Technically, it is possible what the OP is asking for thru JS. We have a report that has a button which on getting clicked refreshes the data in the DW by invoking a Stored procedure which in turn has the logic for refreshing the data from the Source system to the DW table. Afer the data is refreshed, it refreshes the prompt Page and displays the time when the data was refreshed (all with one click of the Button). That logic could be used here to validate the data but as mentioned, it will be too much maintenance, re-inventing the wheel and creating havoc during upgrades.

sg24

Hi Folks,

Thank you for your inputs and Suggestions.  Earlier i used the search and select prompt but the problem was of the " keywords " Type one more keywords separated by spaces, and also the options " , text that appears above and below the serach and select prompt.  The user was confused seeing the text that appeared and didn't want to. So asked me to use a noraml text box prompt and validate which is not possible.

Though i tried to use a java script to remove the text that appears above the search and select prompt but could not.

Finally used a normal value prompt which gives the emp code in the drop down  :) which makes the user easy to select rather than searching for the emp code.
Thanks,
Sg