Data Binding Microsoft .NET Chart Control

Posted by ruan007 on 11-Dec-2010 05:55

Hi,

Have anyone used MS Chart control for .NET. I tried to use it on my 10.2B forms but was unable to get the chart displayed, it throwed an error (pls see attachment).

Here is the code snippet I tried:

DEFINE VARIABLE rBindS AS Progress.Data.BindingSource NO-UNDO.
    DEFINE VARIABLE bGradeHdl AS HANDLE NO-UNDO.
    def temp-table tt-grade no-undo
          field studentname as char
          field physics as dec
          field chemistry as dec
          field math as dec.

@VisualDesigner.
METHOD PRIVATE VOID button1_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
  create tt-grade.
        assign
          studentname = "student 1"
          physics = 90.5
          chemistry = 91
          math = 95.

        create tt-grade.
        assign
          studentname = "student 2"
          physics = 80
          chemistry = 75.5
          math = 87.

          create tt-grade.
        assign
          studentname = "student 3"
          physics = 62
          chemistry = 88
          math = 78.8.

          create tt-grade.
        assign
          studentname = "student 4"
          physics = 68.9
          chemistry = 88
          math = 75.4.

        bGradeHdl = BUFFER tt-grade:HANDLE.
        rBindS = NEW Progress.Data.BindingSource(bGradeHdl).

        chart1:DataBindTable(rBindS).
  RETURN.
END METHOD.

[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/mscharterror.doc:550:0]

All Replies

Posted by Peter Judge on 11-Dec-2010 12:33

I'd report that to tech support.

-- peter

Posted by jquerijero on 17-Jan-2011 15:10

I believe most MS controls require a .NET Dataset or .NET DataTable and not a BindingSource object. You will need to export the temp-table (schema and data) into an in-memory(longchar) XML and load it to XMLDataDocument object which has a Dataset property that you can use for binding to the chart control.

This thread is closed