Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i check the prompt status?

Status
Not open for further replies.

jokerfm4

Programmer
Jan 21, 2008
1
AT
hi to all cognos users,

i am working in cognos8 report studio. i m trying to filter with a date prompt. my goal is to choose a date in a date prompt which will filter my report and if no date is chosen a specified date (for example a users company joining date which can be different for each user)will be used.

its no problem to insert a date prompt and the filter works great... but how can i manage it to tell the filter if the prompt is not activated it should choose the employees company joining date?


my problem is the following: is it possible to check if a date prompt is active or not...
like:

IF ?dateprompt? is active
THEN...// use the chosen date
ELSE...// use the company joining date of each employee

please can anyone help

thanks a lot
joker
 
Hello, it sounds as if you're running into a tricky situation, but here's a couple of thoughts:

You essentially need to get at the date controls default value and do a validation on the prompt page. Try adding a HTML item with a .js that will set the control's value to your default value (ie. company joining date) if the user has not put focus() on the control. You may have an issue of getting the company joining date value passed to the date control, and if so then I would explore the idea of having it's value set in a hidden form field.



Wallace Taylor
 
Haven't worked much with date prompts and have ReportNet, not C8, but I would try something like including a static, dummy date in your prompt (perhaps something early like 1/1/1900, it shouldn't coincide with anything in your data) which is the default and represents "none chosen" with a filter like
(?dateparam?=1/1/1900 and [date]=[companyjoindate]) or ([date]=?dateparam?)
with "1/1/1900" appropriately formatted for the comparison to the prompt param to work.
You didn't mention whether the company join date is in your table or elsewhere, you may need a second query to determine that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top