Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesNeed help setting data source property PLEASENeed help setting data source property PLEASE
Previous
 
Next
New Post
1/20/2011 4:33 PM
 
Normally in my module code When I access the DB for records it is returned in an object that I can access the individual properties such as the following:
Dim cntTTS As New TimeClock_Controller
Dim objTTS As TTS_MainInfo
  
If gsEmpID <> "" Then
    objTTS = cntTTS.Get(gsBureauID, gsCoID, gsEmpID)
Else
    objTTS = cntTTS.Get(Session("empBureauID"), Session("empCompanyID"), currentUser)
End If
  
With objTTS
    rtxtHiddenDnnID.Text = .dnnID
    rtxtFName2.Text = .EmployeeFirstName
    rtxtMName2.Text = .EmployeeMiddleName
    rtxtLName2.Text = .EmployeeLastName
 
' And so on
I am attempting to work with the MS ReportViewer and need to set the data source to my objects datasource. The samples I have found are accessing data directly fro the SQL DB something like this:
Private Sub GetSalesOrderData(ByVal salesOrderNumber As String, _
                            ByRef dsSalesOrder As DataSet)
 
     Dim sqlSalesOrder As String = _
         "SELECT SOH.SalesOrderNumber, S.Name AS Store, " & _
         "       SOH.OrderDate, SP.FirstName AS SalesFirstName, " & _
         "       SP.LastName AS SalesLastName, E.JobTitle AS " & _
         "       SalesTitle, SOH.PurchaseOrderNumber, " & _
         "       SM.Name AS ShipMethod, BA.AddressLine1 " & _
         "       AS BillAddress1, BA.AddressLine2 AS " & _
         "       BillAddress2, BA.City AS BillCity, " & _
         "       BA.PostalCode AS BillPostalCode, BSP.Name " & _
         "       AS BillStateProvince, BCR.Name AS " & _
         "       BillCountryRegion, SA.AddressLine1 AS " & _
         "       ShipAddress1, SA.AddressLine2 AS " & _
         "       ShipAddress2, SA.City AS ShipCity, " & _
         "       SA.PostalCode AS ShipPostalCode, SSP.Name " & _
         "       AS ShipStateProvince, SCR.Name AS " & _
         "       ShipCountryRegion, PP.PhoneNumber AS CustPhone, " & _
         "       CC.FirstName AS CustFirstName, CC.LastName " & _
         "       AS CustLastName " & _
         "FROM   Sales.Customer C INNER JOIN " & _
         "       Sales.SalesOrderHeader SOH ON " & _
         "       SOH.CustomerID = C.CustomerID " & _
         "       LEFT OUTER JOIN Sales.Store S ON " & _
         "       S.BusinessEntityID = C.StoreID " & _
         "       INNER JOIN Person.Address AS BA ON " & _
         "       BA.AddressID = SOH.BillToAddressID " & _
         "       INNER JOIN Person.StateProvince BSP ON " & _
         "       BSP.StateProvinceID = BA.StateProvinceID " & _
         "       INNER JOIN Person.CountryRegion BCR ON " & _
         "       BCR.CountryRegionCode = BSP.CountryRegionCode " & _
         "       INNER JOIN Person.Address SA ON " & _
         "       SA.AddressID = SOH.ShipToAddressID " & _
         "       INNER JOIN Person.StateProvince SSP ON " & _
         "       SSP.StateProvinceID = SA.StateProvinceID " & _
         "       INNER JOIN Person.CountryRegion SCR ON" & _
         "       SCR.CountryRegionCode = SSP.CountryRegionCode " & _
         "       INNER JOIN Purchasing.ShipMethod SM ON " & _
         "       SOH.ShipMethodID = SM.ShipMethodID " & _
         "       LEFT OUTER JOIN Person.Person CC ON " & _
         "       CC.BusinessEntityID = C.PersonID " & _
         "       LEFT OUTER JOIN Person.PersonPhone PP ON " & _
         "       CC.BusinessEntityID = PP.BusinessEntityID " & _
         "       LEFT OUTER JOIN Person.Person SP " & _
         "       RIGHT OUTER JOIN HumanResources.Employee E ON " & _
         "       SP.BusinessEntityID = E.BusinessEntityID ON " & _
         "       SOH.SalesPersonID = E.BusinessEntityID " & _
         "WHERE  (SOH.SalesOrderNumber = @SalesOrderNumber)"
 
     Using connection As New SqlConnection( _
                   "Data Source=(local); " & _
                   "Initial Catalog=AdventureWorks2008R2; " & _
                   "Integrated Security=SSPI")
 
         Dim command As New SqlCommand(sqlSalesOrder, connection)
 
         Dim parameter As New SqlParameter("SalesOrderNumber", _
             salesOrderNumber)
         command.Parameters.Add(parameter)
 
         Dim salesOrderAdapter As New SqlDataAdapter(command)
 
         salesOrderAdapter.Fill(dsSalesOrder, "SalesOrder")
 
     End Using
 
 End Sub
Once that call is finished the reports data source is set to the dataset returned:
'Get the sales order data
GetSalesOrderData(salesOrderNumber, dataset)
 
'Create a report data source for the sales order data
Dim dsSalesOrder As New ReportDataSource()
dsSalesOrder.Name = "SalesOrder"
dsSalesOrder.Value = dataset.Tables("SalesOrder")
 
localReport.DataSources.Add(dsSalesOrder)

Problem is I do not understand how to reference or code this from my DNN object. 
It should be simple to me but I am not grasping it. 
TIA
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesNeed help setting data source property PLEASENeed help setting data source property PLEASE


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out