COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: BIsrik on 04 Oct 2005 11:01:16 AM

Title: [Solved]date display in the prompt
Post by: BIsrik on 04 Oct 2005 11:01:16 AM
I have two date prompts from and to date prompts. I am using the layout calculation to display the dates selected by the user. It displays like between september 20 2005 to september 21 2005.

I want the date range to display as 09/20/2005 to 09/21/2005. I checked out the data format in the properties also but that too didn't work.

Plz suggest me how to achieve this..

Srik
Title: Re: date display in the prompt
Post by: bdybldr on 13 Dec 2005 09:25:20 PM
I've run into this issue also.  Has anyone found a way to parse out the begin and end dates?
Title: Re: date display in the prompt
Post by: sir_jeroen on 14 Dec 2005 02:13:03 AM
For each date you use an individual dateprompt?
Try a calculated field: cast(?Date From? as date) and then apply formatting... that should do the trick..
Title: Re: date display in the prompt
Post by: bdybldr on 14 Dec 2005 08:49:51 AM
Jeroen, ReportNet Addict,
I was using the Date prompts with Range option.Ã,  I switched to 2 separate prompts and changed all the queries to Between ?BeginDate? and ?EndDate?Ã,  The only way that I have found to cast the fields to date is inside a list or repeater.Ã,  Is there a way to display it as a calculated display (ParamDisplayValue)?

Thanks for your help...much appreciated!!

Title: Re: date display in the prompt
Post by: sir_jeroen on 14 Dec 2005 09:02:50 AM
bdybldr: How come you're calling me Jeroen? :D
Title: Re: date display in the prompt
Post by: bdybldr on 14 Dec 2005 09:37:45 AM
Oops...sorry.  :-[  Thought that was your name.  ReportNet Addict is too long to type.
Title: Re: date display in the prompt
Post by: sir_jeroen on 14 Dec 2005 01:20:25 PM
Gheghe.... :D

But unfortunately it ain't possible to do a formatting to the date range.. if you add the range in a calculation you'll see that only the start date is returned.. Therefore I think that the range is returned as an array of dates... So I think that if you want format it you'll have to disect the daterange using javascript. but then only html reports will be possible... So I would conclude: No.. it's not possible to do any reformatting...
Title: Re: date display in the prompt
Post by: turnonthejets on 14 Dec 2005 01:34:44 PM
Does the attached report specification work for you? It's based on the GO Sales package.  This report uses two date prompts not a range.

I've added the Start Date parameter as a calc to the acutal list and hence the query as well, then used this as the layout calculation.  I can then apply the format to that item.

Have a look and let me know.
Title: Re: date display in the prompt
Post by: sir_jeroen on 14 Dec 2005 01:56:31 PM
turnon... this works.. off course.. but the trouble is lying in the range that can not be formatted (Am I correct BISrik??)  Working with 2 individual date prompts will always work...

Note: BISrik do you have a problem with a range or with the date prompt????
Title: Re: date display in the prompt
Post by: turnonthejets on 14 Dec 2005 02:01:22 PM
Sure, but wouldn't two prompts and a between filter work the same for him?  Maybe I'm missing something.  BISrik, give us a GO Sales spec that shows the problem you're having specifically and we can be sure we're fixing your exact pwoblem...
Title: Re: date display in the prompt
Post by: sir_jeroen on 14 Dec 2005 02:03:22 PM
No... A between filter can't be formatted... because it's rendered on the server as a text string (when using a report expression) or as a single date (when using it as a calculation) Or I must be doing something wrong :S
Title: Re: date display in the prompt
Post by: turnonthejets on 14 Dec 2005 02:34:13 PM
Still not sure that we're on the same page.  Have a look at the spec that I attached I'm using a between filter with two seperate prompts and adding the Start Date in a calc on the list allows me then to use that column in the header and format it correctly.....I guess we should wait until Srik has a look and let's us know if we helped or not  :D
Title: Re: date display in the prompt
Post by: BIsrik on 15 Dec 2005 06:47:00 AM
guys, these calculation will work only when there is some data returned by the query. If for a particular date range there is no data then these calculations also would not be displayed.

immaterial u use between operator or in_range operator or >= and <= operators u cannot format the layout calucaltion of date prompts. This is what cognos said me...Its just given for enhancement and might come in cognos8. Can anybody who has cognos8 check on that...

Srik
Title: Re: date display in the prompt
Post by: bdybldr on 15 Dec 2005 09:26:31 AM
Your right, Srik.  You cannot format date prompts but if you capture the prompt values in a query item and display it in the header, you can format the date if used as two separate dates.

I will verify if the dates will display if there is no data and get back to you on that.
Title: Re: date display in the prompt
Post by: bdybldr on 15 Dec 2005 09:41:41 AM
Srik,
I can confirm that that no dates are displayed if there is no data when your filter is applied to a date field in the table, such as transaction_date. 

However, if you use a Time dimension table with all dates that is joined to your table that has no value for those dates, then it will properly display the dates selected in the prompt, even when there is no data.

If this is an important requirement I would recommend building this type of table if you don't have one already.

Title: Re: date display in the prompt
Post by: BIsrik on 15 Dec 2005 11:26:02 PM
fine...thanks for all the suggestion.

Srik