Wednesday, November 23, 2016

Better CSS Colors

http://bootsnipp.com/snippets/BDp09

Monday, October 17, 2016

Passing multiple values for a single parameter in Reporting Services

Passing multiple values for a single parameter in Reporting Services


=join(Parameters!<your param name>.Value,",")
source : http://stackoverflow.com/questions/512105/passing-multiple-values-for-a-single-parameter-in-reporting-services

Wednesday, October 12, 2016

Center and crop thumbnails with CSS

Here is a handy CSS centering technique I first noticed in the WordPress media library, where it is used to centre and crop irregularly sized thumbnails within a square container.
cropped-thumbnails
The technique uses CSS3 transforms, so it works in all modern browsers, including IE9 and above.
<div class="thumbnail">
  <img src="landscape-img.jpg" alt="Image" />
</div>
<div class="thumbnail">
  <img src="portrait-img.jpg" class="portrait" alt="Image" />
</div>
.thumbnail {
  position: relative;
  width: 200px;
  height: 200px;
  overflow: hidden;
}
.thumbnail img {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 100%;
  width: auto;
  -webkit-transform: translate(-50%,-50%);
      -ms-transform: translate(-50%,-50%);
          transform: translate(-50%,-50%);
}
.thumbnail img.portrait {
  width: 100%;
  height: auto;
}
The technique works by positioning the image so that its top left corner is in the centre of its container. Then, a 2D translation moves it up and left by half its own width.
The key here is that the percentage values passed to the translate function are relative to the element, not its container, as would be the case if we were to manipulate the element’s top andleft properties instead.
Note that the portrait format image has the class portrait, so that we can correctly scale it to fill its container.
So there you go. A really simple CSS technique for centering and cropping thumbnails.
Source : http://jonathannicol.com/blog/2014/06/16/centre-crop-thumbnails-with-css/

Friday, September 30, 2016

Tablix: Repeat header rows on each page not working

Tablix: Repeat header rows on each page not working


It depends on the tablix structure you are using. In a table, for example, you do not have column groups, so Reporting Services does not recognize which textboxes are the column headers and setting RepeatColumnHeaders property to True doesn't work.
Instead, you need to:
  1. Open Advanced Mode in the Groupings pane. (Click the arrow to the right of the Column Groups and select Advanced Mode.)
    • Screenshot
  2. In the Row Groups area (not Column Groups), click on a Static group, which highlights the corresponding textbox in the tablix. Click through each Static group until it highlights the leftmost column header. This is generally the first Static group listed.
  3. In the Properties window, set the RepeatOnNewPage property to True.
    • Screenshot
  4. Make sure that the KeepWithGroup property is set to After.
The KeepWithGroup property specifies which group to which the static member needs to stick. If set to After then the static member sticks with the group after it, or below it, acting as a group header. If set to Before, then the static member sticks with the group before, or above it, acting as a group footer. If set to None, Reporting Services decides where to put the static member.
Now when you view the report, the column headers repeat on each page of the tablix.
This video shows how to set it exactly as the answer described
source : http://stackoverflow.com/questions/11285923/tablix-repeat-header-rows-on-each-page-not-working-report-builder-3-0

Thursday, September 29, 2016

First and Last day of current month

=DateSerial(Year(Now), Month(Now), 1) for first day of the month 
=DateSerial(Year(Now), Month(Now)+1, 0) for the last day of the month.
--previous month last
=DateSerial(Year(Now()), Month(Now()), "1").AddDays(-1)

--previous month first
=DateSerial(Year(Now()), Month(Now()), "1").AddMonths(-1)

SSRS Expression Cheat Sheet

SSRS Expression Cheat Sheet

ProblemsExpression
Return first day of current Week 
(ex. Default Start Date parameter to return WTD)
Expression on the parameter default value: 
=DateAdd("d",-DatePart(DateInterval.WeekDay,Today,0,0)+1,Today) 
Expression Output Example: 11/7/2010 12:00:00 AM
Return first day of current Month 

(ex. Default Start Date parameter to return MTD)
Expression on the parameter default value: =DateAdd("d",-(Day(today)-1), Today)
or
=DateSerial( year(today()), month(today()), 1) 
Expression Output Example:11/1/2010 12:00:00 AM
Return first day of current year 
ex. Default Start Date parameter to return YTD)
Expression on the parameter default value: 
=DateAdd("d",-DatePart(DateInterval.DayOfYear,Today,0,0)+1,Today) 
Expression Output Example: 1/1/2010 12:00:00 AM
Return period over period 
(ex. Default date parameters to a rolling year)
Expression on the parameter default value: 

Week over Week 
=DateAdd("ww",-1, Today) 

Month over Month 
=DateAdd("m",-1,Today) 

Year over Year 
=DateAdd("yyyy",-1, Today) 

Expression Output Example:10/9/2010 12:00:00 AM
Return current month nameExpression in Text Box: 
=MonthName(Month(Today())) 

Expression Output Example:November
Uppercase fieldsExpression in Text Box: 
=UCASE(Fields!FieldName.Value) 

Expression Output Example:NOVEMBER
Convert text to proper case 
(ex. 1st letter in each word is uppercase)
Expression in Text Box: 
=StrConv(Fields!FieldName.Value, VbStrConv.ProperCase)
Replace NULL with another valueExpression in Text Box: 
=iif(Fields!FieldName.Value = nothing, "No Value",Fields! FieldName.Value)
Alternating row color (Banding effect)BackgroundColor property on Text Box: 
=iif(RowNumber(Nothing) Mod 2 = 0, "Silver", "White")
Handling division by zeroExpression in Text Box: 

=iif(Fields!DenominatorField.Value = 0, 0, Fields!NumeratorField.Value/ 

iif(Fields!DenominatorField.Value = 0, 1, Fields! DenominatorField.Value))
security number)Expression in Text Box: 

=Replace(Fields!EmailAddress.Value,"-","")

source : http://pragmaticworks.com/Training/Resources/Cheat-Sheets/SSRS-Expression-Cheat-Sheet

Show all records/some records based on parameter value

Method 1 
You need to set up a filter similar to the following:
enter image description here
Where the expression is:
=IIf(Parameters!FilterColumn.Value = Fields!Category.Value
        or Parameters!FilterColumn.Value = "All products"
    , "Include"
    , "Exclude")
This matches the row Category based on the parameter value, or, if the value = All products, will include all rows.
As mentioned in the comments and the other answer, this is possible in the SP too, but since it seems to be specifically to demonstrate the functionality this should do the trick at the report level.
--------------------------------------------------------------------------------------------------------------------------
Method 2 
I have created some solution and worked for me:
enter image description here
In Expression field, I put first expression:
1.  Iif(Parameters!FilterColumn.Value = "All", 1, Fields!Category.Value)
In Value field, I put second expression:
2.  Iif(Parameters!FilterColumn.Value = "All", 1, Parameters!FilterColumn.Value)
So, when I choose "All" value in parameter, then first expression will result 1, and second expression will result 1, and i have 1 = 1 which is true for all rows, and I got all rows in table.
When I choose specific category from parameter, then in first expression result will be Fields!Category.Value and in second expression will be Parameters!FilterColumn.Value. Simple, I got Fields!Category.Value = Parameters!FilterColumn.Value, or just give me rows where category is that choosen in parameter.
source : http://stackoverflow.com/questions/18203317/show-all-records-some-records-based-on-parameter-value