Display percentage in ASP.Net RDLC Report using Stored Procedure

makumbi
 
on Jul 19, 2022 11:31 PM
659 Views

How can i display percentages of these subject items in my RDLC report.

Subject 1 2 3 4 6 7 9 11 18 X Total
ENG 2 2       1         5
SCIENCE 2 2   1             5
SST 2 1 1 1             5
MTC 1 1 1 1   1         5
T.aggregates         1 1 1 1 1   5
Div.analysis  117  77               240 240

say the percentage of those in Div.analysis one.

example 117 divided by total multiplied by 100 and in Div.analysis two 77 divided by total multiplied by 100.

this one is the storedprocedure.

PROCEDURE [dbo].[Analysisclass]@c nvarchar(50) AS
SELECT     [no], class, subject, Total, [1] as one, [2] as two, [3] as three, [4] as four, [5] as five, [6] as six, [7] as seven, [8] as eight, [9] as nine, [10] as ten, [11] as eleven, [12] as twelve, [13] as thirteen, [14] as fourteen, [15] as fifteen, [16] as sixteen, [17] as seventeen, [18] as eighteen, [19] as nineteen, [20] as twenty, [21] as twentyone, [22] as twentytwo, [23] as twentythree, [24] as twentyfour, [25] as twentyfive, [26] as twentysix, [27] as twentyseven,
           [28] as twentyeight, [30] as thirty, [29] as twentynine, [31] as thirtyone, [33] as thirtythree, [32] as thirtytwo, [34] as thirtyfour, [35] as thirtyfive, [36] as thirtysix, U, X
from analysis3
where class=@c
order by  [no]

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Jul 21, 2022 06:27 AM

Calculate the percentage in the stored procedure and display the result in report.

CREATE PROCEDURE [dbo].[Analysisclass]
	@c nvarchar(50) 
AS
	SELECT  [no], class, subject, Total, 
			(([1] / Total) * 100) as one, (([2] / Total) * 100) as two, (([3] / Total) * 100) as three, (([4] / Total) * 100) as four, (([5] / Total) * 100) as five, 
			(([6] / Total) * 100) as six, (([7] / Total) * 100) as seven, (([8] / Total) * 100) as eight, (([9] / Total) * 100) as nine, (([10] / Total) * 100) as ten, 
			(([11] / Total) * 100) as eleven, (([12] / Total) * 100) as twelve, (([13] / Total) * 100) as thirteen, (([14] / Total) * 100) as fourteen, (([15] / Total) * 100) as fifteen, 
			(([16] / Total) * 100) as sixteen, (([17] / Total) * 100) as seventeen, (([18] / Total) * 100) as eighteen, (([19] / Total) * 100) as nineteen, (([20] / Total) * 100) as twenty, 
			(([21] / Total) * 100) as twentyone, (([22] / Total) * 100) as twentytwo, (([23] / Total) * 100) as twentythree, (([24] / Total) * 100) as twentyfour,(([25] / Total) * 100) as twentyfive, 
			(([26] / Total) * 100) as twentysix, (([27] / Total) * 100) as twentyseven, (([28] / Total) * 100) as twentyeight, (([29] / Total) * 100) as twentynine, (([30] / Total) * 100) as thirty, 
			(([31] / Total) * 100) as thirtyone, (([32] / Total) * 100) as thirtytwo, (([33] / Total) * 100) as thirtythree, 
			(([34] / Total) * 100) as thirtyfour, (([35] / Total) * 100) as thirtyfive, (([36] / Total) * 100) as thirtysix, U, X
	from analysis3
	where class=@c
	order by  [no]