Mangesh barmate

Mangesh barmate

  • NA
  • 118
  • 136.7k

How to create spreadsheet from available XML data in c#?

Apr 10 2013 5:22 AM
 

Hi,
I have XML data in below format and i want to store XML data into Spreadsheet using OpenXML concept.
<Sales1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ReportingCustomerId>7206489</ReportingCustomerId>
  <PlanPurchaseDate xsi:nil="true" />
  <SessionId>12345</SessionId>
<SalesPerson>
          <Id>0</Id>
          <SequentialId>0</SequentialId>
          <CreateDateTime xsi:nil="true" />
          <LastModifiedDateTime xsi:nil="true" />
          <Age>0</Age>
          <DateOfBirth xsi:nil="true" />
          <FirstName>Mangesh</FirstName>
          <LastName>Barmate</LastName>
          <BenefitAmount>0</BenefitAmount>
          <VolumeAmount>0</VolumeAmount>
          <ChildCount>0</ChildCount>
          <MemberRenewalRateAmount xsi:nil="true" />
          <MemberCurrentRateAmount xsi:nil="true" />
          <MemberCombinedRateAmount xsi:nil="true" />
          <DependentPersonCollection />
          <RiderRates />
          <SubsciberPersonGenKey>0</SubsciberPersonGenKey>
          <EnrolledPersonCount>0</EnrolledPersonCount>
          <DependentRate xsi:nil="true" />
          <RatePerThousand xsi:nil="true" />
</SalesPerson>

</Sales1>

I want to save this XML into spreadsheet and send an email attachement of that generated spreadsheet.

Please suggest me approach for achieving this.
Thanks!