Thursday, 5 May 2016

Default value in switch statement in ssr

Hi Folks,
Follow the below code to get a default  value for Switch statement used in SSRS
=Switch(Fields!PO_TYPE.Value = "Warehouse",1,Fields!PO_TYPE.Value = "Local",1,Fields!PO_TYPE.Value = "Z",3,1=1,4)

Thursday, 24 March 2016

Handle NaN error in SSRS or MDX

Hi Folks!
Today I learnt how to handle NaN error in SSRS. Use the below code for solution


=iif (Single.IsNaN(Sum(Fields!Sales.Value)),"",Sum(Fields!Sales.Value))

Thanks to my friend Anuj for suggesting me this code

Wednesday, 2 December 2015

MDX Drill through issue

MDX parameter in drill through passes values like 15 - MILK but report works with [Product].[Product].[Department No].&[258]. To resolve this issue add  
WITH MEMBER [Label] AS '[Department No]. CURRENTMEMBER.UNIQUENAME ' at the start of the code.
Then add [Measures].[Label] in your Axis(0)

Then in drill through action tab pass [Label} for your parameter

Wednesday, 2 September 2015

SSRS Multiselect paramter is not showing result

SSRS Multiselect paramter is not showing result

Single selection works but not multiselect in ssrs while implementing SSRS reports.


Solution - All you have to do is in Where condition ensure that you are using "IN" operator
And then ensure that the parameter expression should be =Parameter= !Parametername.Value and not Parameter= !Parametername.Value(0)


Thursday, 18 June 2015

Today minus 2 years in ssrs

Hi Folks,
Write the below code in your SSRS expression tab to get date - 2 years in your ssrs textbox

=DateAdd(DateInterval.year,-2,Today())

Monday, 1 June 2015

Order By using CAML queries

Use the below code type to achieve order by using CAML queries in your SSRS query designer

<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ListName>Regions</ListName>
  <ViewFields>
   <FieldRef Name="RegionName"/>
  </ViewFields>
<Query>
<OrderBy>
    <FieldRef Name="RegionName" Ascending = "True"/>
</OrderBy>
</Query>
</RSSharePointList>

Hyperlink in SSRS shows 2 & field name while using it with Sharepoint

While using the GoTo URL link in SSRS to open a sharepoint list like below

="http://devserver:1882/Lists/Regions/DispForm.aspx?ID=25

I used the below settings in GoTo URL option in Action tab

="http://devserver:1882/Lists/Regions/DispForm.aspx?ID="&Fields!Region_ID.Value

but this would bring up wrong results i,e

="http://devserver:1882/Lists/Regions/DispForm.aspx?ID=25&ID=25

We can resolve this issue by adding extra / before your.aspx page

="http://devserver:1882/Lists/Regions//DispForm.aspx?ID="&Fields!Region_ID.Value

Ref - https://connect.microsoft.com/SQLServer/feedback/details/590273/ssrs-goto-url-action