| | |
Embedding a spreadsheet and chart into a windows form
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2006
Posts: 2
Reputation:
Solved Threads: 0
Using Visual Studio 2003
Hi, I am trying to incorporate a spreedsheet and chart into my windows forms application. My current attempt is using the web controls, AxOWC10.AxSpreadsheet and AxOWC10.AxChartSpace with the Primary Interop Asseblies installed. If I understand, these controls are intended for use in web pages; perhaps it is bad practice to use them in a Form. If that is the case please steer me in the right direction, if using the web controls in a Form is acceptable then I might be going down the right path and am just hung up.
A little about the overall project:
I am recieving data continuously from four serial ports (that's working) and loading it to the AxSpreadsheet in my Form (that's working too!) The data is comming from three load cell indicators, and one digital string pot device at a rate of 10 samples/sec each and they are completely asychronous. I would like the chart to be updated "real time" and like to have the data stored in a spread sheet for easy portability as well as binding to chart.
What I need help with.
The problem is in getting the chart bound to the spreadsheet data. I cannot figgure out or find help in searches on how to feed series data into a chart directly from code, or link it to a spreadsheet so the chart will update automaticly when the spreadsheet is updated. The help I have found says that the AxChartSpace is capable of automaticly updating when its data source is updated, and also that it can be bound to a spreadsheet.
P.S., not a student any more. If it was for a grade I would just make the chart brute force and not worry much about maintainability or sleek appearance, but I hope to use this app for a long time.
Thank you for your time.
Hi, I am trying to incorporate a spreedsheet and chart into my windows forms application. My current attempt is using the web controls, AxOWC10.AxSpreadsheet and AxOWC10.AxChartSpace with the Primary Interop Asseblies installed. If I understand, these controls are intended for use in web pages; perhaps it is bad practice to use them in a Form. If that is the case please steer me in the right direction, if using the web controls in a Form is acceptable then I might be going down the right path and am just hung up.
A little about the overall project:
I am recieving data continuously from four serial ports (that's working) and loading it to the AxSpreadsheet in my Form (that's working too!) The data is comming from three load cell indicators, and one digital string pot device at a rate of 10 samples/sec each and they are completely asychronous. I would like the chart to be updated "real time" and like to have the data stored in a spread sheet for easy portability as well as binding to chart.
What I need help with.
The problem is in getting the chart bound to the spreadsheet data. I cannot figgure out or find help in searches on how to feed series data into a chart directly from code, or link it to a spreadsheet so the chart will update automaticly when the spreadsheet is updated. The help I have found says that the AxChartSpace is capable of automaticly updating when its data source is updated, and also that it can be bound to a spreadsheet.
P.S., not a student any more. If it was for a grade I would just make the chart brute force and not worry much about maintainability or sleek appearance, but I hope to use this app for a long time.
Thank you for your time.
•
•
Join Date: Jun 2006
Posts: 2
Reputation:
Solved Threads: 0
In my contiuing research I have found that using web components in a form is OK, that is according to Alvin Bruney in his post:
[uml]http://www.developersdex.com/asp/message.asp?p=2912&ID=%3C49D1FB22-A2E0-45A2-A38F-D5FE16322965%40microsoft.com%3E[/uml]
I have also learned to use the chart's setData method, but keep getting runtime errors on it. I believe that it is becuase of the way I am trying to connect it to the spread sheet. This is becuase when I debug I see that the data source for the chart is null. Examples in VB show:
I've tired all I can think of in C#, the most commonly seen is:
but that throws the "Specified cast is not valid." runtime exception.
I am using the OWC10 not Owc11 I have nothing against using Owc11 other than I cannot figgure out how to referance it correctly. I can referance the OWC10 stuff as I can manipulate the OWC10.axSpreadsheet and .axChartSpace, just cannot bind the chart to the spreadsheet.
Thanks again and I guess I will keep updating this thread as I learn more. Hopefully I won't be the only one contributing! Have a great weekend.
[uml]http://www.developersdex.com/asp/message.asp?p=2912&ID=%3C49D1FB22-A2E0-45A2-A38F-D5FE16322965%40microsoft.com%3E[/uml]
I have also learned to use the chart's setData method, but keep getting runtime errors on it. I believe that it is becuase of the way I am trying to connect it to the spread sheet. This is becuase when I debug I see that the data source for the chart is null. Examples in VB show:
Set ChartSpace1.DataSource = Spreadsheet1
axChartSpace1.DataSource = (msdatasrc.DataSource)(object)axSpreadsheet1;
but that throws the "Specified cast is not valid." runtime exception.
I am using the OWC10 not Owc11 I have nothing against using Owc11 other than I cannot figgure out how to referance it correctly. I can referance the OWC10 stuff as I can manipulate the OWC10.axSpreadsheet and .axChartSpace, just cannot bind the chart to the spreadsheet.
Thanks again and I guess I will keep updating this thread as I learn more. Hopefully I won't be the only one contributing! Have a great weekend.
![]() |
Similar Threads
- Can't pass data to control on another form (VB.NET)
- Need Help in Windows form inC# (C#)
- Centering a form in VB.NET (VB.NET)
- "Not Responding" Message in Windows Form Application (ASP.NET)
- Controlling windows scroll (VB.NET)
- multiform windows appliction in VB . NET (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: C#,system tray, wont go from task bar.
- Next Thread: Blon insert in MySQL using ODBC in C# win Application
| Thread Tools | Search this Thread |
.net access algorithm animation array barchart bitmap box broadcast c# check checkbox client code combobox control conversion csharp custom database datagrid datagridview dataset datastructure datetime degrees development directrobot draganddrop drawing encryption enum event excel file form format forms function gdi+ hash httpwebrequest image index input install java label lisp list listbox mandelbrot math mouseclick mp3 mysql native operator parse path photoshop picturebox pixelinversion post print process programming radians regex remoting richtextbox safari server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer treeview update usercontrol usercontrols validation visualstudio webbrowser wfa windows winforms wpf xml





