Sajid Hussain

Sajid Hussain

  • 1.2k
  • 514
  • 100.7k

how do show blank row when there is no data

Mar 12 2015 4:00 AM
i am working on rdlc report , i am using following code
 
 var SecBeat = _service.GetBeatBySector_Id(sectorId); 
foreach (var Sb in SecBeat)
{ dataset.SectorBeat.Rows.Add(Sb.Name); }
var bs = _service.GetAllBeatStatus().Where(x => x.Date == dt && x.Sector_Id == sectorId && x.Shift == 1).ToList();
if (bs != null)
{ foreach (var bsec in bs)
{ Employee emp = _service.GetEmployee(bsec.Employee_Id);
Beat beat = beats.FirstOrDefault(x => x.Id == bsec.Beat_Id && x.Sector_Id == sectorId);
dataset.Beat.Rows.Add(beat.Name,
emp.Name,
emp.Id,
emp.CellNo
// bs.HasWireless
);
}
}
else
{
foreach (var bsec in bs)
{ dataset.Beat.Rows.Add("", "", "");
}
}

Answers (2)