This blog
explain how to create RDLC report from business or custom object and it will demonstrates
the steps by steps how to define the RDLC file and how to bind the report data
source with business object.
Here is a business class
which stores report data.
public class Employee
{
public int EmployeeID
{ get; set; }
public string Name
{ get; set; }
public int Age
{ get; set; }
public string City
{ get; set; }
}
Here is a
method which call repository class - EmployeeRepository.cs to populate to
employee object collection
public List<Employee> GetEmployeesCityWise(string City)
{
EmployeeRepository _repository
= new EmployeeRepository();
List<Employee>
employees = _repository.GetEmployees(City);
return employees;
}
Below are
steps to create rdlc report and bind with business object
1.
Add new RDLC report and View Report Data (View -->
Report data):
Data Source Type |
2.
Add new Data set and select data Source Type as Object
3.
Select Data Object (employee) what you want to bind to Report
Data Objects |
4.
Now you can view a list of available fields in data object
5.
Drag and Drop object Fields on report
RDLC |
Thanks
for Visiting !!
No comments:
Post a Comment