Author Topic: Prompt page controls using the same render variable  (Read 267 times)

Online rteruyas

  • Full Member
  • ***
  • Join Date: Dec 2016
  • Posts: 43
  • Forum Citizenship: +1/-0
Prompt page controls using the same render variable
« on: 17 Jan 2018 02:41:58 pm »
Good day guys

I've been asked to change one of the controls in my prompt page depending on the type of user executing the report:
- If user is type "A", then we show a value prompt with only the values he can choose
- If user is type "B", then we show a text box prompt so he can query all values

I tried to create a render variable for both the valuePrompt and textBox.
It works for typeA, but for some strange reason, when a "B" user runs the report, it shows them both controls. I've checked my logic a few times and can't seem to find anything weird related to it.

A few details I checked:
- both controls set the same parameter
- the filter using the parameter is not mandatory in the query
- sometimes I execute the report and I don't get the prompt page at all

Any idea what I might be missing?
I'm using 11.0.7. Thanks in advance!
Happy Reporting!
[Ray]

Offline CognosPaul

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Jan 2009
  • Posts: 1,668
  • Forum Citizenship: +250/-1
    • Paul's Cognos Blog
Re: Prompt page controls using the same render variable
« Reply #1 on: 17 Jan 2018 08:35:34 pm »
Can you post the exact logic you're using to get the user type and the render variable expression?

Online rteruyas

  • Full Member
  • ***
  • Join Date: Dec 2016
  • Posts: 43
  • Forum Citizenship: +1/-0
Re: Prompt page controls using the same render variable
« Reply #2 on: 18 Jan 2018 08:26:51 am »
Thanks @CognosPaul
I've created a test report in the public cognos environment;  the report specification is attached

In real world, userType comes from the database, so there is no problem getting that.
What I can't figure out yet is why when userType is '1', it works as expected, but when the value is '2', it shows all controls. I thought it was something in my logic, but there is a text field that works fine using the same render variable.

Any ideas what I'm missing?


Happy Reporting!
[Ray]

Online rteruyas

  • Full Member
  • ***
  • Join Date: Dec 2016
  • Posts: 43
  • Forum Citizenship: +1/-0
Re: Prompt page controls using the same render variable
« Reply #3 on: 18 Jan 2018 08:38:51 am »
Screenshot attached :)
Happy Reporting!
[Ray]

Offline CognosPaul

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Jan 2009
  • Posts: 1,668
  • Forum Citizenship: +250/-1
    • Paul's Cognos Blog
Re: Prompt page controls using the same render variable
« Reply #4 on: 18 Jan 2018 09:39:59 am »
This is insanity.

I see exactly what you're seeing. We can get the desired results by sticking the prompts into a conditional block instead of using render variables.

Open a PMR, the workaround is good for this example, but it's really insufficient

Online rteruyas

  • Full Member
  • ***
  • Join Date: Dec 2016
  • Posts: 43
  • Forum Citizenship: +1/-0
Re: Prompt page controls using the same render variable
« Reply #5 on: 18 Jan 2018 12:56:33 pm »
Thanks @CognosPaul

I just reported it. I'm waiting to get an APAR number.
This is what I got from customer support

"There isn't an issue with the way the report is designed.  The problem appears to be specific to Text Box prompt object not observing the Render Variable setting so is always being rendered when the report is run.  The Value Prompt is working as expected with regards to rendering.
I'm reporting this to development and will followup with an APAR reference number for this issue."


Quote
We can get the desired results by sticking the prompts into a conditional block instead of using render variables
That's correct. Also, if I use a block and put the text box prompt inside, it works  ::)

Thanks for testing!
« Last Edit: 18 Jan 2018 02:04:53 pm by rteruyas »
Happy Reporting!
[Ray]

 


       
Twittear