S
Steve
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
(HaircutsDataSet_Staffrostergraph) on to the 'Series' area on the graph I
get the message
'Cannot add a field from the dataset "HaircutsDataSet_Staffrostergraph to a
dataregion which uses the dataset HaircutsDataSet_Staffappointmenthours"
What am I doing wrong??
regards
Steve
Code....
mystarttime = dtfrom.Value
myendtime = dtto.Value.AddDays(1)
sql = "SELECT SUM(DATEDIFF(hour, 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(myendtime, "MMM d, yyyy") & "' AND
a.myDate >= '" & Format(mystarttime, "MMM d, yyyy") & "' "
sql &= "GROUP BY s.username"
dtsales = getdata(sql)
sql = "SELECT SUM(DATEDIFF(hour, sr.mystarttime, sr.myendtime)) AS total,
s.username "
sql &= "FROM staffrosterdetail sr INNER JOIN "
sql &= "Staff s ON sr.staffnumber = s.staffnumber "
sql &= "WHERE sr.myDate < '" & Format(myendtime, "MMM d, yyyy") & "' AND
sr.myDate >= '" & Format(mystarttime, "MMM d, yyyy") & "' "
sql &= "GROUP BY s.username"
dtworkinghours = getdata(sql)
ReportViewer1.LocalReport.DataSources.Add(New
Microsoft.Reporting.WinForms.ReportDataSource("HaircutsDataSet_Staffappointmenthours",
dtsales))
ReportViewer1.LocalReport.DataSources.Add(New
Microsoft.Reporting.WinForms.ReportDataSource("HaircutsDataSet_Staffrostergraph",
dtworkinghours))
ReportViewer1.LocalReport.ReportPath = reportpath &
"Staffappointmenthours.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
(HaircutsDataSet_Staffrostergraph) on to the 'Series' area on the graph I
get the message
'Cannot add a field from the dataset "HaircutsDataSet_Staffrostergraph to a
dataregion which uses the dataset HaircutsDataSet_Staffappointmenthours"
What am I doing wrong??
regards
Steve
Code....
mystarttime = dtfrom.Value
myendtime = dtto.Value.AddDays(1)
sql = "SELECT SUM(DATEDIFF(hour, 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(myendtime, "MMM d, yyyy") & "' AND
a.myDate >= '" & Format(mystarttime, "MMM d, yyyy") & "' "
sql &= "GROUP BY s.username"
dtsales = getdata(sql)
sql = "SELECT SUM(DATEDIFF(hour, sr.mystarttime, sr.myendtime)) AS total,
s.username "
sql &= "FROM staffrosterdetail sr INNER JOIN "
sql &= "Staff s ON sr.staffnumber = s.staffnumber "
sql &= "WHERE sr.myDate < '" & Format(myendtime, "MMM d, yyyy") & "' AND
sr.myDate >= '" & Format(mystarttime, "MMM d, yyyy") & "' "
sql &= "GROUP BY s.username"
dtworkinghours = getdata(sql)
ReportViewer1.LocalReport.DataSources.Add(New
Microsoft.Reporting.WinForms.ReportDataSource("HaircutsDataSet_Staffappointmenthours",
dtsales))
ReportViewer1.LocalReport.DataSources.Add(New
Microsoft.Reporting.WinForms.ReportDataSource("HaircutsDataSet_Staffrostergraph",
dtworkinghours))
ReportViewer1.LocalReport.ReportPath = reportpath &
"Staffappointmenthours.rdlc"