public JsonResult EmployeeReport(int?empid) { string data = string.Empty; Publication p1 = new Publication(); if (empid.HasValue) { data = JsonConvert.SerializeObject(p1.GenrateReport_emp(empid.Value)); } else { data = JsonConvert.SerializeObject(p1.GenrateReport_emp(0)); } return(Json(data, JsonRequestBehavior.AllowGet)); }