If you are unable to create a new account, please email support@bspsoftware.com

 

Report asking for parameter values before displaying prompt page

Started by mgervais, 23 Jun 2021 03:46:22 PM

Previous topic - Next topic

mgervais

This is a strange problem I've never encountered before.

We have a report that asks for the year as the first prompt question and a parameter of ?parmYear?

I use ?parmYear? throughout the report to filter other queries. I keep getting an error to enter parmYear for the report you are about to run before it displays the prompt page. Any idea why it's asking for a prompt value when the prompt page hasn't been shown to the user yet?

MFGF

Quote from: mgervais on 23 Jun 2021 03:46:22 PM
This is a strange problem I've never encountered before.

We have a report that asks for the year as the first prompt question and a parameter of ?parmYear?

I use ?parmYear? throughout the report to filter other queries. I keep getting an error to enter parmYear for the report you are about to run before it displays the prompt page. Any idea why it's asking for a prompt value when the prompt page hasn't been shown to the user yet?

Hi,

The only reason I can think of for that to happen is if the prompt page needs the parameter to be resolved before it will render. Take a close look at what's going on in the prompt page.

When you say you are getting an error, is it a specific message (and if so, can you post it up) or is it just an auto-generated prompt that is appearing?

To try to troubleshoot, what do you see if you add another prompt page before this one and prompt for parmYear on the new page? do you still get an error?

Cheers!

MF.
Meep!

mgervais

Yes, double checked the prompt report and all the queries to see I didn't have a rogue reference somewhere. The strange thing is I actually got it working, saved, and the next day it's giving me the error again so I'm almost convinced this is a bug.

The error is the auto generated prompt asking for the year. I tried a new prompt page in front as you suggested and it seems to work. The prompot page comes up and I can select the year, then the original prompt page works as normal. So it seems it is the prompt page causing the strange issue.

Prompt page looks like this:

Select Year
Select Term (post-secondary)
Select Faculty > then program group > then program

I'm referencing Year in the queries for the term code (shows terms based on year selected). This is a normal template I use in most reports. However, for the faculty I'm referencing another table that returns results based on the ?year? that the user selects in year. Perhaps it's trying to use the parameter in the other prompts before the year has been passed? That's the only thing I can think of.




MFGF

Quote from: mgervais on 24 Jun 2021 11:22:35 AM
Yes, double checked the prompt report and all the queries to see I didn't have a rogue reference somewhere. The strange thing is I actually got it working, saved, and the next day it's giving me the error again so I'm almost convinced this is a bug.

The error is the auto generated prompt asking for the year. I tried a new prompt page in front as you suggested and it seems to work. The prompot page comes up and I can select the year, then the original prompt page works as normal. So it seems it is the prompt page causing the strange issue.

Prompt page looks like this:

Select Year
Select Term (post-secondary)
Select Faculty > then program group > then program

I'm referencing Year in the queries for the term code (shows terms based on year selected). This is a normal template I use in most reports. However, for the faculty I'm referencing another table that returns results based on the ?year? that the user selects in year. Perhaps it's trying to use the parameter in the other prompts before the year has been passed? That's the only thing I can think of.

Hi,

Your Faculty prompt can't render and display its values until the ?year? parameter has been fulfilled. Since the Year and Faculty prompts are on the same prompt page, they render at the same time (before any of the parameters are fulfilled). This seems to be your issue. The report is auto-generating a Year prompt so that it can display the prompt page with the Faculty prompt on it.

You're going to need to have your Year and Faculty prompts on separate prompt pages.

Cheers!

MF.
Meep!

CognosPaul

The alternative is to make the ?parmYear? parameter optional by turning it into a macro and providing a default value:
#prompt('parmYear','integer',timestampMask($current_timestamp,'yyyy'))#

The faculty on the prompt page will always show the current year's set, so I would add a reprompt button so when a user selects a different year they'd see the correct faculties.

mgervais

Thanks for the reply, Dave. I found another solution as shown below. I didn't want to use two prompt pages, so I found that in my School prompt, I could go to the properties and set the cascade source to the year query.

I guess this stops it from trying to pull the parameter first thing when the report is run as now I can select year, term and faculty and the prompt lists are behaving properly.