SQL Reporting 05 Services - Displays the amount of custom code in the table header

I have a view receiving data like

Course Attendee if-student shadow-tutor course-max

CS1     steve      no           mark        5

CS1     anna       yes          dan         5

and after extracting, I choose the course, counter (visitor), shadow tutor, course-max, where if-student = Parameters! if_student. The result will look like this:

Course shadow-tutor Actual# max#

CS1       mark         1

          dan          1
        CS1 total:     2      5

I used the report Sum(Fields!Actual.Value)and Fields!Max.Valuefor the total column. And the title I wanted to use Sum(Fields!Actual.Value), and Sum(Fields!Max.Value)as a general. However, this will not work. the sum (max) will return me the sum of all col, in this case it will return 10 instead of 5.

I tried using native code as follows:

Public Dim total_cmax As Integer = 0

Public Function sum_cmax(cmax As Integer) As Integer
   total_cmax = total_cmax + cmax
   Return cmax
End Function

Public Function get_cmax(obj As Object) As Integer
   obj.Value =  total_cmax
End Function

, get_cmax , 0. get_cmax , .

? , . , , .

+3
1

, , . (1 ), .

1,

=SUM(Fields!Max_Number, "table1_Courses")

=RunningValue(Fields!Max_Number.Value,SUM,"table1_Courses" )

, , .

2,

=SUM(Fields!Max_Number.Value)/RowNumber("table1_Courses")

, Fields! Max_Number.Value, , SSRS05 , .

3, ReportItems

 =Sum(ReportItems("course_max").Value)
 =ReportItems("total_max").Value

, ReportItems / . . , MS , .

, , . . 200, 150 1- 50 , 1- Sum(ReportItems("course_max").Value) 150, 200.

4, .

Public Dim total_cmax As Integer = 0

Public Function sum_cmax(cmax As Integer) As Integer
   total_cmax = total_cmax + cmax
   Return cmax
End Function

Public Function get_cmax(obj As Object) As Integer
   obj.Value =  total_cmax
End Function

, MS! , , .

get_cmax sum_cmax, get_cmax, 0, get_cmax ( "sum_cmax" ) 0. , MS . , get_cmax , AND, .

, . , - . =ReportItems("total_max").Value, 0. , .

, .

0

Source: https://habr.com/ru/post/1740009/


All Articles