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

how to Save text prompt values in report for next run..

Started by Samrat, 12 May 2014 11:33:55 AM

Previous topic - Next topic

Samrat

Hi Friends,

In report studion report, I have 8 Text box prompts to input users comments in to report in prompt page.
My requirement is when when user enters comments in each text prompt,the commentary should be saved and when user runs the report next time, the earlier comments should be displayed..The only case when it should be reset is if the reset button is applied. 

Please suggest.

MFGF

Quote from: Samrat on 12 May 2014 11:33:55 AM
...the commentary should be saved...

Hi,

Saved where? The database? You might be able to achieve this if you are skilled at coding stored procedures, but the truth is you are trying to force the tool into doing things it's not designed for. Cognos 10 BI is a reporting tool - designed to read data and display it in whatever form you desire. It is not designed as a data entry and maintenance tool. I have seen posts from people who have coded stored procedures to write values back to a database and they have found weird and wonderful ways to trigger these from within reports, but it's messy, complicated and completely unsupported. Do you really want to be building something like this for your users?

If you need robust writeback, you should probably look at using technology such as TM1, and add a TM1 cube view into Cognos Workspace to provide the writeback capabilities.

Just my muppety old tuppence :)

MF.
Meep!

Samrat

Hi MF,

Thanks for your reply...
I have same opinion as you on cognos,its a tool which reads data and represents it in a meaningful way...

my requirement is providing user a text box prompt for commentary and when user first runs the report and enters the commentary,the commentary will be just displayed in the report pages(paramdisplay()).

when user runs report next time,the commentary which user entered at the first run has to be available as default option,
and there has to be reset botton and when user clicks reset botton,this comentary has to be reset.

simple way to do is providing comment at default option.. but this can be done at report design level.. I am looking for an option which should retain comment entered by user at his run...

Cheers
Sam..

MFGF

Quote from: Samrat on 12 May 2014 02:57:06 PM
my requirement is providing user a text box prompt for commentary and when user first runs the report and enters the commentary,the commentary will be just displayed in the report pages(paramdisplay()).

when user runs report next time,the commentary which user entered at the first run has to be available as default option,
and there has to be reset botton and when user clicks reset botton,this comentary has to be reset.

My advice is to just say no. It's not a part of the product set functionality. If the client needs this impementing they need to consider a supplementary technology such as TM1.

Tell your client they have bought a Ferrari and are demanding you figure out how to attach a plough to it to to turn their fields over...

MF.
Meep!

Samrat

 :) Thanks MF..

I will give them an option of setting defualt values in parameter..

Cheers
Sam..

navissar

I hate to disagree with the muppet, but I hate to turn down a requirement even more.
If I understand correctly, this default is user-specific. So, if we have 2 users - Jack and Jill - when Jack runs the report and sets the text box ("value1"), next time Jack runs the report he'll see "value1" as default for the text prompt. Jill, on the other hand, won't - she'll see her last inserted value. If I'm right, then on 10.2+ you could use the prompt API to create a cookie from the selected values. This isn't only supported, there is in fact an IBM sample for it: http://pic.dhe.ibm.com/infocenter/cbi/v10r2m0/index.jsp?topic=%2Fcom.ibm.swg.ba.cognos.ug_cr_rptstd.10.2.0.doc%2Fc_rs_smples_prompt_api.html

Samrat

Hi Nimrod,

Thanks for your involvement here..

So far we are going ahead with understanding of irespective user who runs the report the coments needs to be saved from last run.

Also we are using Cognos version 10.1.1

Your reply surely will  help me.

Cheers
Sam..


Samrat

I came across 2 more requirement with respect to same commentary text box prompt.

1.I have to specify/restrict number of characters user can enter for text box prompt

I tried setting up different text box prompt properties,still not finding a way.


2.If user enters comments in 2 paragraphs I need to diaply as it is.
By default if we use Paramdisplayvalue() function,we can display user commenst continuoesly with out line breaks even though if user enters commenst in 2 paragraphs.

Open to all for suggestions.

Cheers..
Sam..


navissar

If this should save the value for all users, then your best bet is to save it in the database.
You can use a stored procedure to achieve this. This'll also help you with your paragraphing.
My friend, mentor, all round genius and The Batman of All Things Cognos, AKA Paul, has a sample here http://cognospaul.com/2014/01/02/creating-data-entry-page-cognos/

Samrat

Hi Nimrod,

Fantastic,I can see your stored precedure approach gives me flexibility to contyrol number of characters also..

Let me try..

Cheers..
Sam..

MFGF

Quote from: Nimrod Avissar on 13 May 2014 06:15:52 AM
If this should save the value for all users, then your best bet is to save it in the database.
You can use a stored procedure to achieve this. This'll also help you with your paragraphing.
My friend, mentor, all round genius and The Batman of All Things Cognos, AKA Paul, has a sample here http://cognospaul.com/2014/01/02/creating-data-entry-page-cognos/

Here beginneth the rantings of a senile old muppet...

I hate to disagree with genius developers like Nimrod and Paul, but this is storing up a whole heap of trouble for later on. While (with their help) I am convinced you will get it to work, what happens further down the line when it breaks? Do you have the skills and the time to maintain it for new database versions and new releases of Cognos if it fails? What if you leave? How impossible will it be for any "Normal" (ie non-genius) developer like me to figure it out and debug it? If I was to log a call with IBM to say "My stored procedure update called from Report Studio isn't working since I upgraded to 10.4", they would likely laugh at me and tell me they can't help and it serves me right for building something unsupported. Do you really want to leave a legacy of building skunkworks solutions that nobody but a handful of people worldwide would be capable of supporting?

Muppety rant over.

Normal senile service is now resumed :)

MF.
Meep!

Lynn

I agree with the muppet on this one. I will add that good documentation is critical especially when pursuing an off-the-beaten-path solution. Unfortunately no one likes doing it and many people do a lousy job at it, but at least providing an overview of the situation plus the critical details is well worth the effort to mitigate the impending doom the muppet has predicted.

You might also take a look at the comment capability that exists for saved outputs within Cognos Connection. I realize it isn't exactly going to meet your client's requirements but I think all out-of-the-box options should be evaluated before jumping to something that isn't specifically supported.

Then after a long day at work you can use your toaster to cook eggs, use the heel of your shoe to hammer nails and use a hair dryer to dust the furniture. All will seem right with the world because using the right tool for the right job just ceases to be an issue ;)


Samrat

Hi Dear friends...

Yes defeneatly we are bound by capabilities of tools.. and with in the tool limits we can play around...

There will be few clients who will be desperate for their requirement to be implemented .and for them Nimrod answer will surely be helpful.. may be we can implement such options by mentioning its circumstances of its functioning..

thanks all for your involvement here in this topic.

Cheers,
Sam..

navissar

Normally, I am of the opinion that if two people, especially two people I hold in the highest regards, tell me that I'm drunk I should probably go sleep one off. Nonetheless, this time I must respectfully disagree, professionally. While The Muppet and Lynn's arguments are perfectly valid, there's another way to look at this. I'll try to explain my stance here - dear readers, do keep in mind that this is just another point of view, that I am but a humble developer compared to these two, and that their point of view is very very valid; I just happen to disagree with it. Also, I happen to think The Muppet and Lynn would make for a brilliant band name.
I think TM&L's arguments can be summarized to two main points:
1. Cognos isn't meant to do that. So doing this with Cognos is like hammering in nails with a shoe (It is true that as a young, unmarried student I used to poach eggs in the toaster oven).
2. It'll be really difficult to maintain, as opposed to a tool that was meant to write to the database. Other developers won't be able to maintain it, and even the developer doing it will be in deep snow if it breaks during an upgrade or whatnot.

Regarding the first point, my answer is a twofold: First, i challenge that Cognos isn't supposed to do that. It can be argued that Cognos has a part that's in charge of communicating with a database, and that stored procedures are a part of an RDBMS functionality, and that Cognos has an out-of-box capacity to run stored procedures.
While it is true that Cognos's main purpose is to display data in a meaningful way, this purpose is achieved by answering requirements by the business, and if the business requirement is to allow analysts to comment on a piece of data, then arguably this is a part of Cognos's main purpose.
Lastly on that point, calling a stored procedure from the DB isn't different than using any other out-of-box functionality to call on a 3rd party functionality. If the customer was to purchase a software to do that, we'd still have to activate it somehow from our report - so it's basically the same thing. I think all would agree that writing data to a database IS one the stored procedure's main purposes.
The second part of the answer is that even if Cognos wasn't meant to do it, it is capable of it. Cognos was not meant to do some of the best stuff I've done with it (Off the top of my head: using an event to trigger a report to be saved to FS, where it would trigger - I kid you not - a flashing light in the CFO's office). The only question remaining is that of feasibility - which brings me to point number two.

I have written loads of specialized solutions for Cognos over the years. Most of them - tabbing solutions, prompts manipulation, jQuery embedding, dynamic sorting, whatever - are more difficult, theoretically, to maintain than this method. Other than the SP (Which can be maintained by any average DBA), everything is out of box.
Now, if feasibility is the issue, it isn't very feasible that a customer would buy a piece of software to update a field for one or three reports. Especially nowadays, IT departments are pressed hard for cash. More likely, the customer will have one of their IT crowd to write a quick aspx/php file to update the DB. Then, you'd have to maintain the page AND the iframe or webservice that calls it from Cognos (Because making the user leave Cognos to write a comment on a Cognos report is simply bad UX). So that's basically the same, only now maintenance is someone else's problem.

On top of that, the method of calling a procedure via Cognos is more likely to survive an upgrade than some of the solutions we offer here on a daily basis (Like my cascading prompts with no refresh, for example). Calling a stored procedure  is out of box and should be supported in future versions. SPs didn't change much over the years, and I don't see vendors scraping them just yet.

So that's my rumbling.  As I said, I hate to turn down a client.  :)
And now I think the readers of the future (Hello future folks! Have you invented wireless electricity yet? Is it really cool?) have a variety of opinions, and I'm off to bed.

Lynn

Sorry I didn't respond right away....I had to rush out and get trademark rights for TM&L. Our first product is going to be a light that flashes based on an event studio agent. Keep an eye out for your royalty check. Unfortunately I find that the egg-cooking toaster has already been developed: http://www.amazon.com/Back-Basics-TEM500-Muffin-2-Slice/dp/B000B18P96 ;)

Nimrod, you make excellent points as usual. Ensuring that the client can carry on with any solution and that they understand shortcomings or potential pitfalls when deciding on a particular course is going to be true in many cases, not just those that stretch the boundaries of a tool's capabilities. It is clear that you are able to evaluate requirements and apply solutions with care and consideration for all the important factors that apply.

navissar

Quote from: Lynn on 14 May 2014 07:10:24 AM
Sorry I didn't respond right away....I had to rush out and get trademark rights for TM&L. Our first product is going to be a light that flashes based on an event studio agent. Keep an eye out for your royalty check. Unfortunately I find that the egg-cooking toaster has already been developed: http://www.amazon.com/Back-Basics-TEM500-Muffin-2-Slice/dp/B000B18P96 ;)


Did I ever mention that I'm married to a lawyer, who specializes in matters of intellectual property?  :)
At my attorney's advice I'll be willing to sell the flashing light solution and all rights to it for the humble price of getting to be the lead guitar of The Muppet&Lynn in their debut album.

(It's dead easy BTW - the event saves a report to file system only if a certain value is lower than X. A process on the FS checks the folder constantly for new files. If it detects a new file, it triggers a batch file which calls upon the piece of software in charge of setting the light off (It's a kind of a police light thingy). I offered a text message, but I guess it was too high-tech for them. The real funny thing was that someone - and I admit to nothing here - set this folder as the default save path for Cognos, which caused the CFO's office to be flashy red and blue most hours of the day, until they decided to drop the whole damn thing).

Lynn

Ok, now I'm going to be chuckling all day long. If your musical abilities are anything like mine then it will be a truly awful album indeed. I have heard rumors that the muppet's dancing skills are right on par with my musical (non) talent, but I have not yet witnessed this for myself. It is on my bucket list to take him dancing one of these days.

CognosPaul

I actually set up a solution similar to this requirement. Pressing the refresh button would loop through the report, populating a hidden textbox prompt with the selected values for each prompt (using the prompt API). It would then pass that value, the report name, and the username to a stored procedure. Upon running the report again a value prompt would be populated with the results of that table. The Prompt API would then attempt to populate the prompts with the results of that value prompt. If I can dig it out, I'll write a post on it.

Since the JS was all Prompt API, in theory this should continue to work for however long the Prompt API is supported. I think IBM said that the Prompt API would be supported as is for at least the next two major versions?

MFGF

Quote from: Lynn on 14 May 2014 07:52:28 AM
Ok, now I'm going to be chuckling all day long. If your musical abilities are anything like mine then it will be a truly awful album indeed. I have heard rumors that the muppet's dancing skills are right on par with my musical (non) talent, but I have not yet witnessed this for myself. It is on my bucket list to take him dancing one of these days.

I used to play the recorder. Badly, I admit, but "Go And Tell Aunt Nancy" was (almost) recognisable when I butchered played it. My dancing skills are legendary, however. If you don't believe me, just ask my daughter! She says my Dad Dancing is extraordinary! :)

Lynn, make sure you wear your steel-toecap boots and your kneepads, and we will have a ball! :)

MF.
Meep!