Showing posts with label aggregate. Show all posts
Showing posts with label aggregate. Show all posts

Friday, February 24, 2012

Custom Code...For the Sake of Argument

Is it possible to write custom code that achieves the same thing as an aggregate function?

ex: Calculating the sum of a group? (with out using the sum( field!one.value) function)

if I had a group that grouped on name.

Name Number
header Fields!FirstName.Value ************
details Fields!Number.Value
footer

Can i write a custom code function (or functions) that will get the sume of the numbers in that group.

Thanks in advance.

Hi all

I am also interested in writing code that can access the datasets created for the reports. I wanted to write a search function that searched a dataset from a parameter input to custom code. I am trying to count records of a group, and also trying to count filltered records within that group to calculate a percentage and display them on a group banner. The easy formatting examples everybody provides for custom code is no help... I was trying to use ADO code with the already created datasets, but got nowhere... That infernal "error in custom code" I think is hard-coded into the SSRS...

Dick

I just stumbled on to "Microsoft Reporting Services inAction: Extending Microsoft SQL Server 2000 Reporting Services with Custom Code". Some light weekend reading.

|||

Yes you can perform certain types of custom aggregations via custom code. One example is shown in the following blog posting: http://blogs.msdn.com/bwelcker/archive/2005/05/10/416306.aspx

-- Robert

|||Currently SSRS doesn't support custom aggregates although SQL Server 2005 provides this capability in the form of CLR custom aggregate functions. One approach is to prepare your dataset in such a way that your aggregates can be produced by the standard SSRS aggregate functions, e.g. SUM. For example, if some report lines need to add up while others to subtract from the group aggregate, you can have an additional sign column which will have values of 1 or -1 accordingly.

custom code

Is it possible to use aggregate functions inside custom code?Hi,
This is not directly suppotred by RS. There is an other way to do this. See
http://blogs.msdn.com/bwelcker/archive/2005/05/10/416306.aspx for
instructions how to.
Jan Pieter Posthuma
"loginov" wrote:
> Is it possible to use aggregate functions inside custom code?
>
>|||Thanks, but this doesn't work for me :)
I try to implement nested datasets like
'=Max(IIF
(Cint(Fields("id").value)=Parameters!id.Value,Fields("title").value,""),
"dataset2")'
within "dataset1" and hide this inside my function. Another problem - RS
doesn't support nested aggregate functions :(
I have no words.
BTW do you know how to get PageNumber in the Body section?
"Jan Pieter Posthuma" <JanPieterPosthuma@.discussions.microsoft.com>
ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:9037C02C-9EA3-4808-AD98-C7B986430F85@.microsoft.com...
> Hi,
> This is not directly suppotred by RS. There is an other way to do this.
> See
> http://blogs.msdn.com/bwelcker/archive/2005/05/10/416306.aspx for
> instructions how to.
> Jan Pieter Posthuma
> "loginov" wrote:
>> Is it possible to use aggregate functions inside custom code?
>>

Tuesday, February 14, 2012

Custom aggregate function

hi how do i write a custom aggregate function or select query.I have Table name MemberDetail where which has two column Memberid and WokingDay.In this table same member could have multiple working days. i want select query that will return single row for each member and his/her quama separated working days. without using cursor. how do i do that.

eg

Table MemberDetail

MemberID WorkingDay

M1234 12

M1234 10

M1555 02

M1555 15

See

http://www.aspfaq.com/show.asp?id=2529

|||

cool its working,but i also wanted to get count as

MEMBERID WORKINDAYS COUNT

M1234 12,10 2

M1555 02,15 2

|||select MEMBERID, yourstrcatfunction(MEMBERID), count(*)
from yourtable
group by MEMBERID

Custom Aggregate

How can you create and use a custom aggregate function in Reporting
Services? For example, to calculate the Median in a group.Noel,
You always have the choice for <expression> and you can use nearly
anything you can dream up in SQL or CLR.
Dennis Graham
Noel wrote:
> How can you create and use a custom aggregate function in Reporting
> Services? For example, to calculate the Median in a group.