Cognos : Persisting Checkbox state across Multiple Pages

Tag: checkbox , cognos Author: wangshuang6 Date: 2009-07-15

On the Cognos Report Results Page, we need to have a checkbox for each row. The checkbox is designed using HTMLITEM tag.

However, the problem we face is that the state of the checkbox (checked or unchecked) is not persisted when we go to the next page/previous page.

I am very new to Cognos and I need to know if there is a way to do this.

I am fairly good at JAVAScripting and JSP, but since we only have access to HTML elements and not JSP Tags (Cognos uses CGI anyways), I cannot get the request object. If there is some way to retrieve the request objects parameters of previous submit(previous page), that would help in solving the issue to a large extent, I feel.

Jonas

Other Answer1

There isn't really enough information on what your end goal is to be able to assist you with this properly. There are a few ways that spring to mind that would allow you to use JS on the report to remember previously checked items, but there may be a much better way to do this depending on your requirements.

Without having more details, the first thing that leaps to mind is simply having some JavaScript set and unset cookie values on check/uncheck on the checkbox.

Note, there could be a variety of other ways to work this, including upping the number of visible rows per page, etc...

Other Answer2

You can create a dataitem in a query where you can determine whether your checkbox should be checked or not. In the design of your list on the report page you can render a HTMLItem within the list, and base the HTMLItem on a DataItem. Your HTML must than be something like

<input type="checkbox" value="""+ [DataItemValueToPass] + """ " + [DataItemCheckedOrNot] ></input>