Hi ihtesham07,
I have created procedure that will return user marks.
CREATE PROCEDURE StudentMarks
AS
BEGIN
DECLARE @StudentMarks AS TABLE(StudentName VARCHAR(50),SubjectName VARCHAR(50),TotalMark INT,MarksSecured INT)
INSERT INTO @StudentMarks VALUES('Ram','English',100,89)
INSERT INTO @StudentMarks VALUES('Ram','Hindi',100,79)
INSERT INTO @StudentMarks VALUES('Ram','Math',100,45)
INSERT INTO @StudentMarks VALUES('Ram','Physics',75,72)
INSERT INTO @StudentMarks VALUES('Ram','Chemistry',75,70)
INSERT INTO @StudentMarks VALUES('Ram','Histry',75,11)
INSERT INTO @StudentMarks VALUES('Ram','Geography',75,28)
SELECT sm.StudentName,sm.SubjectName,sm.TotalMark,sm.MarksSecured FROM @StudentMarks sm
END
By refering the below article i have created the sample that will give me the below output with total mark and percentage. Refer the below links.
For percentage calculation go to FieldExplorer->FormulaFields->RightClick and select New->Give Name->Select Use Editor->Write "(SUM({Mark.MarksSecured})*100)/SUM({Mark.TotalMark}) " formula and save it. Then drag the field in the rpt file where you want to show. Here Mark is the datatable name.
http://www.codeproject.com/Articles/166291/Generate-a-report-using-Crystal-Reports-in-Visual
Screenshot