I'm a bit confused about how to bind my report to a business object. I've been able to get my object into the 'DataSource' property of my report, but I would think that at this point I'd have to specify the method which is responsible for populating the DataSource. However, I'm not sure where to specify this method? My business object is listed below, it is relatively simple and I'm currently just creating some debug objects in a method that will eventually pull from the database:
My initial approach was to create a BLL, a DLL, entity objects to pass between the two, then implement stored procedures in the DB. My thought was that I would have a method in my BLL that would populate a collection of objects then pass this collection to the report for display. To populate the collection, the BLL would call a method in the DAL which in turn would populate an entity object (or collection of entity objects) based on the data retrieved through the utilization of stored procedures in the database. The BLL would then convert these entity objects to business objects which could be passed to the report in a strongly-typed collection.
Does this approach seem feasible? Is this overkill?
Imports System |
Imports System.Data |
Imports System.Configuration |
Imports System.Web |
Imports System.Collections |
Imports System.Collections.Generic |
Imports Triton.TCNext.EntityLayer |
Public Class TransactionType_BAL |
Inherits List(Of TransactionType_BAL) |
Sub New(ByVal id As Integer, ByVal name As String, ByVal description As String) |
Me.ID = id |
Me.Name = name |
Me.Description = description |
End Sub |
Sub New() |
End Sub |
Private _id As Integer = 0 |
Public Property ID() |
Get |
Return _id |
End Get |
Set(ByVal value) |
_id = value |
End Set |
End Property |
Private _name As String = 0 |
Public Property Name() |
Get |
Return _name |
End Get |
Set(ByVal value) |
_name = value |
End Set |
End Property |
Private _description As String = 0 |
Public Property Description() |
Get |
Return _description |
End Get |
Set(ByVal value) |
_description = value |
End Set |
End Property |
Public Shared Function GetTransactionTypes() As List(Of TransactionType_BAL) |
Dim transactionType1 As TransactionType_BAL = New TransactionType_BAL(1, "Checking Withdrawal", String.Empty) |
Dim transactionType2 As TransactionType_BAL = New TransactionType_BAL(2, "Savings Withdrawal", String.Empty) |
Dim transactionType3 As TransactionType_BAL = New TransactionType_BAL(3, "Credit Withdrawal", String.Empty) |
Dim transactionTypes As List(Of TransactionType_BAL) = New List(Of TransactionType_BAL) |
transactionTypes.Add(transactionType1) |
transactionTypes.Add(transactionType2) |
transactionTypes.Add(transactionType3) |
Return transactionTypes |
End Function |
Private Shared Function GetTransactionTypeFromTransactionTypeEntity(ByVal transactionType As TransactionTypeEntity) As TransactionType_BAL |
If transactionType Is Nothing Then |
Return Nothing |
Else |
Return New TransactionType_BAL(transactionType.ID, transactionType.Name, transactionType.Description) |
End If |
End Function |
Private Shared Function GetTransactionTypeListFromTransactionTypeEntityList(ByVal recordSet As List(Of TransactionTypeEntity)) As List(Of TransactionType_BAL) |
Dim transactionTypes As List(Of TransactionType_BAL) = New List(Of TransactionType_BAL) |
Dim record As TransactionTypeEntity |
For Each record In recordSet |
transactionTypes.Add(GetTransactionTypeFromTransactionTypeEntity(record)) |
Next |
Return transactionTypes |
End Function |
End Class |
My initial approach was to create a BLL, a DLL, entity objects to pass between the two, then implement stored procedures in the DB. My thought was that I would have a method in my BLL that would populate a collection of objects then pass this collection to the report for display. To populate the collection, the BLL would call a method in the DAL which in turn would populate an entity object (or collection of entity objects) based on the data retrieved through the utilization of stored procedures in the database. The BLL would then convert these entity objects to business objects which could be passed to the report in a strongly-typed collection.
Does this approach seem feasible? Is this overkill?