vb.net 2005 Reportviewer charting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    #1

    vb.net 2005 Reportviewer charting

    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"


  • Steven Cheng[MSFT]

    #2
    RE: vb.net 2005 Reportviewer charting

    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/subscripti...ult.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/subscripti...t/default.aspx.

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



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

    Comment

    • Steve

      #3
      Re: vb.net 2005 Reportviewer charting

      Steven

      Spot on

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

      Regards
      Steve

      "Steven Cheng[MSFT]" <stcheng@online .microsoft.comw rote in message
      news:5$wd3FopHH A.5056@TK2MSFTN GHUB02.phx.gbl. ..
      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/subscripti...ult.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/subscripti...t/default.aspx.
      >
      =============== =============== =============== =====
      >
      >
      >
      This posting is provided "AS IS" with no warranties, and confers no
      rights.
      >

      Comment

      • Steven Cheng[MSFT]

        #4
        Re: vb.net 2005 Reportviewer charting

        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.

        Comment

        Working...