SSRS Expressions

The thing that I have trouble with most is referring to text boxes in the report, you do that like this:

 

ReportItems!myFielName.value

 

*** Case sensitive.

This expression, placed in a ReportItem text box Color property, displays the text in black when the value is > 0; otherwise, the value is displayed in red:

=IIF(Me.Value > 0,"Black","Red")

This expression, placed in a text box in the page header or page footer, displays the first value per page of the rendered report, for a text box named LastName:

=First(ReportItems("LastName").Value)

Edit 2/20/2017 by JoeyMorgan2012:

To get the month previous to the report month, as for a sales summary or other report for the last full month, use:

=Monthname(month(dateadd(DateInterval.Month,-1,DateTime.Today)),true)
Use False instead of True to get the full month name instead of the abbreviation. Using Year instead of Monthname will give the year and return last year for a January report. More accurate than using Year(DateTime.Today)-1

 

 

 

 

 

 


 

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences