It's time for our next June TechNet Guru winner!
MCC award winner Tim Pacl is our SSRS TechNet Guru for June! See the TechNet Guru Contributions for June 2013.
About Tim: Retired from the U. S. Navy Submarine Force. Working in computer industry since 1998. 4 years of that at Razorfish as Senior Developer and the remaining years at Dell, Inc. TFS administration, builds, ALM, web front end development, ASP.Net, Winforms, SQL Reporting. (Amongst others)
Here is Tim's winning article:
Using Custom Code in SSRS Reports for Advanced String Operations
Here are all the June SSRS winners (all were from Tim):
And thank you to Tim for 6 great articles about Reporting Services! Find all 6 here.
Here's an excerpt from the article:
OverviewSQL Services Reporting Services is a very powerful tool and with each new release, it grows in functionality. However many users find that the expression builder functions do not quite do what they need. Fortunately, Microsoft has provided a powerful means of extending the capabilities of a report, virtually without limit, by using the custom code capability. While custom code can access custom assemblies, the string manipulation functionality discussed here uses only the core .Net assemblies which are available by default on the Reporting server and so requires no explicitly referenced assemblies.
String Manipulation Using Custom CodeThe SQL Server Reporting Services, Power View MSDN forum contains numerous questions asking how to extend the string manipulation capabilities of Reporting Services. In some cases, the solution can only be achieved through custom code. We will explore three different string manipulation scenarios requiring custom code in SSRS reports:
Concatenating Data Column Values Into a Single String Occassionally a report author may have a need to display detail records in a grouped table in a single cell rather than separate rows.ScenarioMy dataset returns multiple rows of data for a given grouping with only one field (we will call it Grade) varying across those rows. I want my report to display a single line for a group with all of the values of Grade for that group displayed as a concatenated string in a single cell of each group row.Solution Add the below function to the custom code module of the report:Private Num AsString=""Private tempstr AsString=""Function AggregateString(Group asString, Val asString) as String If Group = Num Then tempstr = tempstr +", "+ Val Else Num = Group tempstr = Val EndIf Return tempStr EndFunctionWith this custom VB.Net function, you can create a delimited string that concatenates all of the specified detail records of a group using the RunningValue function.
Read the rest here:
Thanks to Tim Pacl for your great contribution to the TechNet Guru contest! You can read about all the June winners here: TechNet Guru Award Winners - June 2013
Also, for the July Guru competition, see TechNet Guru Contributions for July 2013.
Are you a Wiki Ninja? http://technet.com/wiki
- User Ed