Thanks for any help. I'm not new to Crystal Reports and use them
routinely in vb.net for desktop applications, but I don't know where
to start for using them in my asp.net apps. I currently have an .aspx
page with a datagrid populated by two compliled DLL's which make the
fields available to the datagrid with this code below. Should I have
a
popup screen that contains the ReportViewer from the toolbox? How can
I in my crystal report set the datasource. It would be really cool if
I could simply use the data in the datagrid as my source. Is this
possible?
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim act As Action
Dim pos As Position
Dim empname As String
Dim lvi As ListItem
Dim Employee As Employee
Dim empcount As Integer
act = (New
ActionBroker).G etActionCurrent (Global.UserSec urity.EmpId, Today,
Global.UserName , Global.UserPass word, Global.appDataS ource)
pos = (New PositionBroker) .GetPosition(ac t.PositionID,
Global.UserName , Global.UserPass word, Global.appDataS ource)
m_department = pos.Department. Name
Dim emps As Employees = (New
EmployeeBroker) .GetCurrentEmpl oyeesByDepartme nt(m_department ,
Global.UserName , Global.UserPass word, Global.appDataS ource)
Dim dt As New DataTable
Dim count As Integer = 0
For Each emp As Employee In emps
SetListViewItem (emp, dt, count)
count = count + 1
Next
dgEmployees.Dat aSource = dt
dgEmployees.Dat aBind()
End Sub
Private Sub SetListViewItem (ByVal dr As Employee, ByVal dt As
DataTable, ByVal count As Integer)
If count = 0 Then
dt.Columns.Add( "Emp #")
dt.Columns.Add( "Last Name")
dt.Columns.Add( "First Name")
dt.Columns.Add( "Title")
End If
Dim EmpPos As Action = (New
ActionBroker).G etActionCurrent (dr.Key, Today, Global.UserName ,
Global.UserPass word, Global.appDataS ource)
Dim employee As DataRow = dt.NewRow
employee("Emp #") = dr.Key
employee("Last Name") = dr.LastName
employee("First Name") = dr.FirstName
employee("Title ") = EmpPos.WorkAgai nstInfo.Title
dt.Rows.Add(emp loyee)
End Sub 'SetListViewIte m
routinely in vb.net for desktop applications, but I don't know where
to start for using them in my asp.net apps. I currently have an .aspx
page with a datagrid populated by two compliled DLL's which make the
fields available to the datagrid with this code below. Should I have
a
popup screen that contains the ReportViewer from the toolbox? How can
I in my crystal report set the datasource. It would be really cool if
I could simply use the data in the datagrid as my source. Is this
possible?
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim act As Action
Dim pos As Position
Dim empname As String
Dim lvi As ListItem
Dim Employee As Employee
Dim empcount As Integer
act = (New
ActionBroker).G etActionCurrent (Global.UserSec urity.EmpId, Today,
Global.UserName , Global.UserPass word, Global.appDataS ource)
pos = (New PositionBroker) .GetPosition(ac t.PositionID,
Global.UserName , Global.UserPass word, Global.appDataS ource)
m_department = pos.Department. Name
Dim emps As Employees = (New
EmployeeBroker) .GetCurrentEmpl oyeesByDepartme nt(m_department ,
Global.UserName , Global.UserPass word, Global.appDataS ource)
Dim dt As New DataTable
Dim count As Integer = 0
For Each emp As Employee In emps
SetListViewItem (emp, dt, count)
count = count + 1
Next
dgEmployees.Dat aSource = dt
dgEmployees.Dat aBind()
End Sub
Private Sub SetListViewItem (ByVal dr As Employee, ByVal dt As
DataTable, ByVal count As Integer)
If count = 0 Then
dt.Columns.Add( "Emp #")
dt.Columns.Add( "Last Name")
dt.Columns.Add( "First Name")
dt.Columns.Add( "Title")
End If
Dim EmpPos As Action = (New
ActionBroker).G etActionCurrent (dr.Key, Today, Global.UserName ,
Global.UserPass word, Global.appDataS ource)
Dim employee As DataRow = dt.NewRow
employee("Emp #") = dr.Key
employee("Last Name") = dr.LastName
employee("First Name") = dr.FirstName
employee("Title ") = EmpPos.WorkAgai nstInfo.Title
dt.Rows.Add(emp loyee)
End Sub 'SetListViewIte m
Comment