diff --git a/erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py b/erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py
index 5258bf4..2e59d61 100644
--- a/erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py
+++ b/erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py
@@ -22,11 +22,13 @@
 	if not student_list:
 		return  columns, []
 
-	student_mobile_map = get_student_mobile_no(student_list)
+	student_map = get_student_details(student_list)
 	guardian_map = get_guardian_map(student_list)
 
 	for d in program_enrollments:
-		row = [d.student, d.student_name, student_mobile_map.get(d.student)]
+		student_details = student_map.get(d.student)
+		row = [d.student, d.student_name, student_details.get("student_mobile_number"), student_details.get("student_email_id"),
+				student_details.get("address")]
 
 		student_guardians = guardian_map.get(d.student)
 
@@ -34,7 +36,7 @@
 			for i in xrange(2):
 				if i < len(student_guardians):
 					g = student_guardians[i]
-					row += [g.guardian_name, g.relation, g.mobile_number]
+					row += [g.guardian_name, g.relation, g.mobile_number, g.email_address]
 
 		data.append(row)
 
@@ -46,23 +48,31 @@
 		_("Student ID") + ":Link/Student:90", 
 		_("Student Name") + "::150", 
 		_("Student Mobile No.") + "::110",
+		_("Student Email ID") + "::125",
+		_("Student Address") + "::175",
 		_("Guardian1 Name") + "::150",
 		_("Relation with Guardian1") + "::80",
 		_("Guardian1 Mobile No") + "::125",
+		_("Guardian1 Email ID") + "::125",
 		_("Guardian2 Name") + "::150",
 		_("Relation with Guardian2") + "::80",
 		_("Guardian2 Mobile No") + "::125",
+		_("Guardian2 Email ID") + "::125",
 	]
 	return columns
 
-def get_student_mobile_no(student_list):
-	student_mobile_map = frappe._dict()
-	student_mobile_no = frappe.db.sql('''
-		select name, student_mobile_number from `tabStudent` where name in (%s)''' %
+def get_student_details(student_list):
+	student_map = frappe._dict()
+	student_details = frappe.db.sql('''
+		select name, student_mobile_number, student_email_id, address_line_1, address_line_2, city, state from `tabStudent` where name in (%s)''' %
 		', '.join(['%s']*len(student_list)), tuple(student_list), as_dict=1)
-	for s in student_mobile_no:
-		student_mobile_map[s.name] = s.student_mobile_number
-	return student_mobile_map
+	for s in student_details:
+		student = frappe._dict()
+		student["student_mobile_number"] = s.student_mobile_number
+		student["student_email_id"] = s.student_email_id
+		student["address"] = ', '.join([d for d in [s.address_line_1, s.address_line_2, s.city, s.state] if d])
+		student_map[s.name] = student
+	return student_map
 
 def get_guardian_map(student_list):
 	guardian_map = frappe._dict()
@@ -75,8 +85,12 @@
 	guardian_mobile_no = dict(frappe.db.sql("""select name, mobile_number from `tabGuardian` 
 			where name in (%s)""" % ", ".join(['%s']*len(guardian_list)), tuple(guardian_list)))
 
+	guardian_email_id = dict(frappe.db.sql("""select name, email_address from `tabGuardian` 
+			where name in (%s)""" % ", ".join(['%s']*len(guardian_list)), tuple(guardian_list)))
+
 	for guardian in guardian_details:
 		guardian["mobile_number"] = guardian_mobile_no.get(guardian.guardian)
+		guardian["email_address"] = guardian_email_id.get(guardian.guardian)
 		guardian_map.setdefault(guardian.parent, []).append(guardian)
 
 	return guardian_map
\ No newline at end of file
