Hi All
I want to create a Column chart showing total number of appointment hours
per staff member
Along side each bar I want to show another series of total number of
working hours per staff member
When I try to drop the 'total' datafield from the 2nd data adaptor
(HaircutsDataSe t_Staffrostergr aph) on to the 'Series' area on the graph I
get the message
'Cannot add a field from the dataset "HaircutsDataSe t_Staffrostergr aph to a
dataregion which uses the dataset HaircutsDataSet _Staffappointme nthours"
What am I doing wrong??
regards
Steve
Code....
mystarttime = dtfrom.Value
myendtime = dtto.Value.AddD ays(1)
sql = "SELECT SUM(DATEDIFF(ho ur, a.mytime, a.endtime)) AS total, s.username
"
sql &= "FROM Appointments a INNER JOIN "
sql &= "Staff s ON a.staffnumber = s.staffnumber "
sql &= "WHERE a.myDate < '" & Format(myendtim e, "MMM d, yyyy") & "' AND
a.myDate >= '" & Format(mystartt ime, "MMM d, yyyy") & "' "
sql &= "GROUP BY s.username"
dtsales = getdata(sql)
sql = "SELECT SUM(DATEDIFF(ho ur, sr.mystarttime, sr.myendtime)) AS total,
s.username "
sql &= "FROM staffrosterdeta il sr INNER JOIN "
sql &= "Staff s ON sr.staffnumber = s.staffnumber "
sql &= "WHERE sr.myDate < '" & Format(myendtim e, "MMM d, yyyy") & "' AND
sr.myDate >= '" & Format(mystartt ime, "MMM d, yyyy") & "' "
sql &= "GROUP BY s.username"
dtworkinghours = getdata(sql)
ReportViewer1.L ocalReport.Data Sources.Add(New
Microsoft.Repor ting.WinForms.R eportDataSource ("HaircutsDataS et_Staffappoint menthours",
dtsales))
ReportViewer1.L ocalReport.Data Sources.Add(New
Microsoft.Repor ting.WinForms.R eportDataSource ("HaircutsDataS et_Staffrosterg raph",
dtworkinghours) )
ReportViewer1.L ocalReport.Repo rtPath = reportpath &
"Staffappointme nthours.rdlc"
I want to create a Column chart showing total number of appointment hours
per staff member
Along side each bar I want to show another series of total number of
working hours per staff member
When I try to drop the 'total' datafield from the 2nd data adaptor
(HaircutsDataSe t_Staffrostergr aph) on to the 'Series' area on the graph I
get the message
'Cannot add a field from the dataset "HaircutsDataSe t_Staffrostergr aph to a
dataregion which uses the dataset HaircutsDataSet _Staffappointme nthours"
What am I doing wrong??
regards
Steve
Code....
mystarttime = dtfrom.Value
myendtime = dtto.Value.AddD ays(1)
sql = "SELECT SUM(DATEDIFF(ho ur, a.mytime, a.endtime)) AS total, s.username
"
sql &= "FROM Appointments a INNER JOIN "
sql &= "Staff s ON a.staffnumber = s.staffnumber "
sql &= "WHERE a.myDate < '" & Format(myendtim e, "MMM d, yyyy") & "' AND
a.myDate >= '" & Format(mystartt ime, "MMM d, yyyy") & "' "
sql &= "GROUP BY s.username"
dtsales = getdata(sql)
sql = "SELECT SUM(DATEDIFF(ho ur, sr.mystarttime, sr.myendtime)) AS total,
s.username "
sql &= "FROM staffrosterdeta il sr INNER JOIN "
sql &= "Staff s ON sr.staffnumber = s.staffnumber "
sql &= "WHERE sr.myDate < '" & Format(myendtim e, "MMM d, yyyy") & "' AND
sr.myDate >= '" & Format(mystartt ime, "MMM d, yyyy") & "' "
sql &= "GROUP BY s.username"
dtworkinghours = getdata(sql)
ReportViewer1.L ocalReport.Data Sources.Add(New
Microsoft.Repor ting.WinForms.R eportDataSource ("HaircutsDataS et_Staffappoint menthours",
dtsales))
ReportViewer1.L ocalReport.Data Sources.Add(New
Microsoft.Repor ting.WinForms.R eportDataSource ("HaircutsDataS et_Staffrosterg raph",
dtworkinghours) )
ReportViewer1.L ocalReport.Repo rtPath = reportpath &
"Staffappointme nthours.rdlc"
Comment