In a C# console application I have a PointF[]
array. I need to draw those points in an .xls chart file, but I need guidance how to do this?
Asked
Active
Viewed 299 times
0

Nathaniel Ford
- 20,545
- 20
- 91
- 102

Michael
- 13,950
- 57
- 145
- 288
-
1http://stackoverflow.com/questions/5361403/generate-excel-with-chart-from-net – Andrey Mar 04 '13 at 22:00
-
1http://stackoverflow.com/questions/5573972/excel-charts-c – Andrey Mar 04 '13 at 22:01
-
2http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c-sharp – Andrey Mar 04 '13 at 22:02
-
http://epplus.codeplex.com/wikipage?title=WebapplicationExample – pm100 Mar 04 '13 at 22:02
-
Microsoft has a whole slew of `interop` assemblies that can help you here. First among them (for what you want) is [this one](http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel(v=office.11).aspx). – Brian Mar 04 '13 at 22:02
1 Answers
1
Have a look at Open XML SDK 2.0 for Microsoft Office
I've used it before to do something like you're describing.
I started off creating an .xls file in Excel that had the correct chart which read values from a specific range of cells and so on. Then using the SDK I added/changed the values of those cells and saved a new version of the file. So basically I used the file created in Excel as a template that I could change whenever without changing the code (as long as the values are written to the same range of cells).
You could also put the value cells in a separate worksheet so that the user does not see them when opening the file...

Cyrus
- 344
- 1
- 8