Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a Excel Chart\Graph object??

Status
Not open for further replies.

liorlankril

Programmer
Nov 5, 2005
46
IL
I have a sheet in Excel that contain a Chart\Graph object

How can I get this object for display in a c# code.

Can I do it???

How I display it? as a Image in the c# page (like Html page).

How to do it????
 
If your app is an intranet-based app, and all your users have Office or Excel licenses, you can use COM automation and embed the chart in your WinForm.

If you're writing a Web-based app, this is rather difficult, not only because you have to ensure that all your users have Office or Excel licenses, but also the actual embedding is hard. In this situation, I would look at some of the 3rd party charting libraries, such as ChartFx or Dundas, that are written specifically for web apps.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
I will explain:

I'm writting a Web Part file for a SharePoint portal server page

Can I do it? if yes, how??
 
Microsoft has web controls to display excel spreadsheets and charts. You can use them in C# by adding the "Office Web Controls 11", and I think there's also an "Office Web controls XP" version.
 
2 things

1) I dont want to creat a graph, I want to display in wy web part a graph object that exist in an Excel sheet!!!

2) Where can I fint metirial for those Microsoft web controls???
 
You need the office web controls to either create a chart, load a spreadsheet that contains a chart, etc ...

One thing though - if your graph is static, then just save it as a jpg and show that on the site. If it's dynamic, then you'll have no choice but to use the web controls

As for material on the web control - have you tried Google? A simple search for the web components gives you this:
Download:
Docs:
A word of caution though - the office web controls are not very well documented, and are a bit of a headache to work with. They do work, but it just takes quite a bit of trial and error and reading of their docs. Not the best MS product out there ...
 
That's what I need to know!

How to save the static graph as jpg in my web part. How to access it by code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top