![office web components download office web components download](https://blog.mastykarz.nl/assets/images/2018/08/sharepoint-framework-javascript-web-part-web-component.png)
} //Chart control accepts tab-delimited string Nodes = (0).ChildNodes ĪNames= nodes.Item(i-1).ChildNodes.Item(0).InnerText ĪTotals= nodes.Item(i-1).ChildNodes.Item(1).InnerText System.IO.StringWriter sw = new System.IO.StringWriter() OWC10.ChartSpaceClass oChartSpace = new OWC10.ChartSpaceClass() SqlDataAdapter da = new SqlDataAdapter("CustorderHist 'ALFKI'", New SqlConnection("Server=(local) DataBase=Northwind user id=sa password= ") Private void btnChart_Click(object sender, System.EventArgs e) Your chart! I've also included a helper method that checks the file systemĮvery time a user requests a chart and cleans up any GIF files older than The SQL Server Northwind Database, populate the control with your dataĪs I described above, save the file as a GIF, and populate your ImageĬontrol's ImageURL property so that when the postback occurs, you have
#Office web components download code
What I'll show next is the code to get a DataSet from Using statements to your WebForm codebehind class: using OWC10 Wrapper for you, called appropriately, "OWC10".
![office web components download office web components download](https://www.webcomponents.org/assets/logo-192x192.png)
Fire up a new ASP.NET WebForms application,Īnd stick a button and an Image control on the design surface.Ĭlick "Add Reference" from the Solution Explorer,Ĭhoose the COM tab, and find the library, which will lookĬlick "OK" and VS.NET will build a COM Interop To use the OWC Chart Component, all you need to to is set a COM reference Load that into an XmlDocument instance,Īnd then you can iterate the nodelist with your data and convert it intoĪ tab - delimited string and the control will be happy! Is a tab-delimited string ( It also accepts an object array, but I gave One of the acceptable data sources for the control Thing I could really find besides the ugly code, I finally figured outĪn elegant way to do it. I wanted to do it server side, save the gif to the filesystem, andĪfter reading some of the COM - based documentation, which was the only Ouch! Even UGLIER! I don't want to do it client Only other solution they had was to transform Dataset Xml into an ADOĭataset representation. And the documentation on using OWC Chart control in MSDN isĭownright ugly! Ugly as a bulldog chewing on a wasp! They want you toĭo it client side with an