Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert excel file to xml

0 views
Skip to first unread message

noopathan

unread,
May 16, 2006, 12:43:52 AM5/16/06
to
Hi experts ,
I have an excel file in the below format

---------------------------------------------------------------------
CodeID CodeName Market Name Date
--------------------------------------------------------------------

1 Sample1 Market1 22/2/2004
--------------------------------------------------------------------
2 Sample2 Market2 22/2/2003
--------------------------------------------------------------------

and so on..................

I want to convert this excel file in to the following xml format

<From Excel>
<CodeId>1</CodeId>
<CodeName>sample1</CodeName>
<MarketName>market1</MarketName>
<Date>22/2/2004</Date>
</From Excel>

<From Excel>
<CodeId>2</CodeId>
<CodeName>sample2</CodeName>
<MarketName>market2</MarketName>
<Date>22/2/2005</Date>
</From Excel>


and likewise all the selected cells from the excel file.I want to
implement it using c#.

Can anyone give the ideas (preferrably sample source code), helpfull
links so that I can do this task successfully.

Early ideas are greatly appreciated as I am stuck with this............

Regards
Jango

Michael Nemtsev

unread,
May 16, 2006, 2:45:01 AM5/16/06
to
Excell can export the data into XML format, you need to use VSTO/Automation
for this (googling to find samples of using Excel export and .NET), but the
schema of excell export may not suit you - you must decide how to cope with
this
There are several ways, but all based on XSLT transfomation
- use excell export to get xml file and then use XSLT to reformat xml
- use ADO/ODBC to connect to excell file, get data table and then convert
DataTable XML presentation into you own XML schema.

These ideas that just come into my mind. I'd use the second one.

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Nareshs

unread,
May 16, 2006, 4:44:02 AM5/16/06
to
Hi

Try this link.You might find it useful
http://www.codeproject.com/csharp/Excel2XML.asp

Regards
Naresh

0 new messages