Saturday, February 25, 2012

Ampersand in Analysis Services Report Alert

I have an alert in AS 2005 that will start a reporting services report. I want to pass the current member position in a hierarchy using a parameter:

settostr({[Dim].[MyHierarchy].currentmember}) .

That causes a URL like this:

http://hosting/reportserver/?%2fReport%20Project6/Report1&DimCurrentMember={[Dim].[MyHierarchy].[Lvl1].&[all].&[west].&[300]}&rs:Command=Render&rs:Renderer=PDF

How do I get AS to use %26 for the &'s .

In order to deal with this scenario, you can use MDX function UrlEscapeFragment. So your code will become:

UrlEscapeFragment(settostr({[Dim].[MyHierarchy].currentmember}) )

|||

Thank you!

I have been searching all over for this solution.

|||Yes - this is not very documented, except for the fact that the sample AdventureWorks cube uses this function in the "Sales Reason Comparisons" report action.

No comments:

Post a Comment