Date prompt in Reporting Serivces 2008
Hi,
I am not very familliar with reporting services(2008), and I meet some problem in my designing reports.
I have designed one report in report designer, the data source is from Cube which is on remote server and also I add one date parameter in the query designer. when I run the report, I can choose the specific dates from a list of dates labels. If I select
'Date/Time' as the data type in parameter properties, no matter how I configure the others, it will show me error all the time.
I want to use a calendar control instead of requiring the user to scroll through the list of date labels from the Cube.
How can I make it?
Thanks and Regards.Connie Zhu
November 26th, 2010 3:32am
Hello Connie,
When you add a dimension as parameter in SSRS report that has data source bind to the cube, the parameter dropdown will display the available members of that dimension and you have to select/deselect values from the list of available members. I believe with
dimensions added as parameters you cannot use calendar control to select date values.
Thanks
Free Windows Admin Tool Kit Click here and download it now
November 26th, 2010 4:33am
I believe with dimensions added as parameters you cannot use calendar control to select date values.
This isn't strictly true. You can use a date type parameter, however you need to construct a StrToMember function (http://technet.microsoft.com/en-us/library/ms146022.aspx) against the
string the parameter returns in order for the mdx to be evaluated correctly.
Is this an incredibly annoying way to construct a report from a OLAP source that should be simpler than a relational DB? Yes absolutely. Should microsoft improve this? Yes.
These links may help:
http://social.msdn.microsoft.com/Forums/en-US/sqlanalysisservices/thread/c7146ac3-40ea-4d53-b321-c707aebbd405
http://www.bizpassion.com/?p=84My Blog "Karl Beran's BI Mumble"
November 26th, 2010 4:48am
Thank you both for your responses.
But Karl, It seems my MDX query has already used StrToMember function. The part of the query which contains the parameters is like the following.
SELECT ( STRTOMEMBER(@FromDateDate, CONSTRAINED) : STRTOMEMBER(@ToDateDate, CONSTRAINED) ) ON COLUMNS
And I checked some reference, It tells me that I can use StrToSet function, then I changed the query like this:
SELECT ( STRTOSET(@FromDateDate) : STRTOSET(@ToDateDate) ) ON COLUMNS
But it shows me the error when I click ok to save the query:
Query (1, 246) The : function expects a member expression for the 1 argument. A tuple set expression was used.
----------------------------
Query preparation failed.Connie Zhu
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2010 1:10am
If you change the parameter data type from a string to datetime (this is required for the date picker/calendar control), you cannot use the StrToMember directly as you are passing a datetime rather than string to the mdx function.
You can get around this in three ways by either adding Report code to convert the datetime to a string for the mdx to parse into the StrToMember function, or create a hidden parameter that refers to your main calendarcontrol and has an expression to convert
the datatype using standard vb functions in the expression, or convert the datetime to string within the MDX as demonstrated in the last post here:
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/4292e607-8fa7-4d71-af8f-3a2e9978f76eMy Blog "Karl Beran's BI Mumble"
November 29th, 2010 7:06am
Thank you very much for your help, Karl...Connie Zhu
Free Windows Admin Tool Kit Click here and download it now
November 30th, 2010 9:25pm