Creating a custom aggregate function using a .NET Assembly
I am currently working on a project where the number of reports that need to use the same user defined function is growing so steadily that putting the function into the Code section of the report and using a hidden matrix is not the answer for me. http://social.msdn.microsoft.com/Forums/is/sqlreportingservices/thread/a01476ec-de2f-44a2-8142-f6de78818fcb What I need to be able to do is write a function that works just like the Sum function Sum(expression, scope) but instead uses a custom function. If I were only deploying one or two reports the current work arounds would be just fine. With the volume of reports that I already have this is just NOT an option. I have several "possible" bad ways to reduce the amount of effort there, but it just seems that the most obvious place to put this would be in a matrix group and use it there. My expression for a "Group" total would go from this 'Sum(Field!Name.Value, "MyScope")' to 'MySpecificAggregationFunction(Field!Name.Value, "MyScope")' I have not found anything that points me in any good direction for accomplishing this sort of task. I would expect that Microsoft would expose the Microsoft.ReportingServices.RdlObjectModel SDK, but that seems to not have happened yet or maybe they are not going to. Either way I just need some guide to how to get the job done. I don't want to spend my time trying things that turn up to be fruitless. Here is a list of my ideas so far: 1. Create a .NET class, instantiate an instance, add data to the instance, use the result 2. Create a static class, pass the class all of the values from a matrix, process the data, use the result. Still I have found no methods or guides as to the best way to get that done. Any books related to this subject? Any articles? ThanksRobert Attaway The SQLMDX Dude sqlmdxdude@gmail.com
September 1st, 2012 3:39pm

For those that have reviewed this post and are either interested in this or have the same need I am nearing a solution that is a conglomerate of many ideas. Once I have this resolved I will provide the solution here. The references that were most useful are: http://www.codeproject.com/Articles/30555/Adding-Custom-Assemblies-in-SQL-Server-Reporting-S http://www.katieandemil.com/ssrs-percentile-function-2008-r2-calculation-custom-code-example My solution, which I am about 90% done implementing, uses multiple instance variables that point to external code to do all the work of data classification across multiple groups of data. As with anything not anticipated by Microsoft as a need, the effort has been large and difficult because just when you think you have everything just fine you find a snag.Robert Attaway The SQLMDX Dude sqlmdxdude@gmail.com
Free Windows Admin Tool Kit Click here and download it now
September 1st, 2012 3:43pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics