vb.net 2005 Reportviewer charting

  • Thread starter Thread starter Steve
  • Start date Start date
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"
 
Hi Steve,

From your description, you're encountering some problem when try draging
two table's fields onto a chart report item inside a VS 2005 client
report(for reportviewer), correct?

According to the steps you mentioned, I think the problem here is due to
the SQL Server SSRS client report (also server report) only allow a single
dataset bound to a given report Item(such as Table, Chart ......). The
"DataSet" here is the SSRS specific dataset rather than .NET ADO.NET
dataset. You can think the "dataset" here a "resultset".

Therefore, for your scenario, if you want to display info on a single chart
from multiple resultset (from backend data storage's perspective), I
suggest you consider use a View to merge the columns in the two resultset
so that bind a single resultset(table in .net dataset) to the chart.

How do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
Steven

Spot on

I have now combined the different datatables in to 1 and all works fine

Regards
Steve
 
Thanks fine:)

Have a nice day!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hey, draw barchart in Reportviewer

Hey

i am new in ReportViewer. Actually i want to draw barchart in Reportviewer. How i will achive this.


Sincerely,

P. Raju.



Steven Cheng[MSFT] said:
Thanks fine:)

Have a nice day!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top