C# export excel chart to image and send it an email

S

Sam

I've server side automation to create some chart in excel using OpenXML. I need to export a chart from my report to an image and send it in an email. The excel libraries are not installed on servers so interop COM is not an option. How can I achieve this without using anything external dlls or anything? Suggestions appreciated. thanks
 
S

Sam

I don't rely on Excel installation. I use OpenXML format for server side uatomation of report generation. The problem I am having is exporting charts from excel to send in an email along with reports. I can't find any librarythat will render a chart out of OpenXML format.
 
S

Sam

Also, I am ok with minimum dependency. That is something that I can ship with my application and does not rely on any server side installation.
 
A

Arne Vajhøj

I've server side automation to create some chart in excel using
OpenXML. I need to export a chart from my report to an image and send
it in an email. The excel libraries are not installed on servers so
interop COM is not an option. How can I achieve this without using
anything external dlls or anything? Suggestions appreciated.

If you do not have Excel, then you can not use Excel to
generate the graphics.

If you can parse the data without the Excel libraries
(lot of work but possible), then you can generate
the graphics using your code. That would again
be some work.

It seems a lot more practical to generate the graphics
on a system with Excel and then upload the generated
graphics to the server without Excel.

Arne
 
A

Arne Vajhøj

I don't rely on Excel installation. I use OpenXML format for server
side uatomation of report generation. The problem I am having is
exporting charts from excel to send in an email along with reports. I
can't find any library that will render a chart out of OpenXML
format.

You can not find something like Excel.

But if you are willing to write some code, then it is
certainly possible.

You can just use System.Drawing or System.Windows.Media or you
can use a third party library.

But the entire approach seems questionable.

Arne
 
J

Jeff Johnson

I've server side automation to create some chart in excel using OpenXML. I
need
to export a chart from my report to an image and send it in an email. The
excel
libraries are not installed on servers so interop COM is not an option.
How can I
achieve this without using anything external dlls or anything? Suggestions
appreciated. thanks

Okay, let's deconstruct this question, because it's confusing a lot of
people. You say you have code running on a server that creates a chart "IN"
Excel. For most people here, that suggests that you are using the Microsoft
Excel EXECUTABLE to generate this chart, programmatically (i.e., via
Automation) in this case.

I don't think that's really what you mean, because you stated that "the
excel libraries are not installed on servers."

So I think what you mean is that you have some code that creates a file that
is NORMALLY USED BY EXCEL. Please note that an .xls[x] file is not "Excel,"
it is merely a file type that is associated with Excel.

Then you ask, "How can I achieve this without using anything [sic] external
dlls or anything?" Well, there's only one answer to that: write all the code
yourself! I don't think this was really your question, either. I think the
"external DLLs" you referred to meant "DLLs belonging to some commercial
application, like Excel."

I think what you're really really asking here is, "Is there any free
assembly out there which can read OpenXML spreadsheets and generate images
from the chart data embedded within them that will look just as good as
those generated by Excel?" And I think the answer is going to be a big NO.
More than likely there are several commercial offerings, but they aren't
going to be cheap.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top