|
In the tutorial Database you have the following structure:
So I want to create a devexpress report based on the “Area” object.
I want to show the Area.description, Territory.description and the Employee.LastName that is assigned to the territory and I don’t want to use a property to pull out the employees last name.
How do I do that without creating a view or stored procedure? The field list stops at Area.Territories.EmployeeTerritories.EmployeeID
In SQL I would just write the following query:
SELECT dbo.Area.Description AS [Area Description], dbo.Territory.Description AS [Territory Description], dbo.Employee.LastName FROM dbo.Area INNER JOIN dbo.Territory ON dbo.Area.Id = dbo.Territory.AreaId INNER JOIN dbo.EmployeeTerritory ON dbo.Territory.Id = dbo.EmployeeTerritory.TerritoryId INNER JOIN dbo.Employee ON dbo.EmployeeTerritory.EmployeeId = dbo.Employee.Id
Which returns (list edited for size):
|
Eastern |
Wilton |
|
|
Eastern |
Neward |
|
|
Eastern |
Westboro |
Fuller |
|
Eastern |
Louisville |
Fuller |
|
Southern |
Atlanta |
Leverling |
|
Southern |
Savannah |
Leverling |
|
Southern |
Orlando |
Leverling |
|
Eastern |
Fairport |
Buchanan |
|
Western |
Phoenix |
Suyama |
|
Western |
Scottsdale |
Suyama |
|
Northern |
Minneapolis |
Dodsworth |
I could create a class for the stored proc and then report on it but that is very ineffective for me as I have 3 different databases I am hooking up to. Problem is if I need to make a simple addition to the stored proc it means modifying the stored proc, rebuilding all 3 models and then creating a upgrade script for the 300 users to update their databases.
Any ideas?
Thanks
|