I am having my xml data in XDocument (LINQ). I want to write this data into excel data. I am using console application.
I dont want to use excel com objec开发者_开发百科t.
You can fairly easily create .xslx format documents without using com (or indeed without having excel anywhere near your machine).
There are links in this answer:
Building Excel Files with C#
And if you look in the latest CTP for V2.0 of the open XML SDK you will find a very nice tool that will help reverse engineer the file formats into code as a starting point
It may not suit your needs in this case but I have often found that writing to a .csv file (which will likely have an association with Excel if installed) makes for an easy to do alternative in many situations.
精彩评论