如何从c#中的可用XML数据创建电子表格? [英] How to create spreadsheet from available XML data in c#?

查看:51
本文介绍了如何从c#中的可用XML数据创建电子表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有以下格式的XML数据,我想使用OpenXML概念将XML数据存储到Spreadsheet中。



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>







我想将这个XML保存到电子表格中并发送生成的电子表格的电子邮件附件。



请建议我实现这一目标的方法。



谢谢!




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!

推荐答案

请看这些:

使用OpenXml导入XML [ ^ ]

使用Open XML创建基本的Excel工作簿 [ ^ ]

http://blogs.msdn.com/b/chrisquon/archive/2009/07/22/creating-an-excel-spreadsheet-from-scratch-using-openxml.aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/office/dd452407%28v=office.12%29.aspx [ ^ ]

http://msdn.microsoft。合作m / en-us / library / office / hh180830%28v = office.14%29.aspx [ ^ ]

http://blog.stuartwhiteford.com/?p=49 [ ^ ]
See these:
Importing XML using OpenXml[^]
Creating basic Excel workbook with Open XML[^]
http://blogs.msdn.com/b/chrisquon/archive/2009/07/22/creating-an-excel-spreadsheet-from-scratch-using-openxml.aspx[^]
http://msdn.microsoft.com/en-us/library/office/dd452407%28v=office.12%29.aspx[^]
http://msdn.microsoft.com/en-us/library/office/hh180830%28v=office.14%29.aspx[^]
http://blog.stuartwhiteford.com/?p=49[^]


这篇关于如何从c#中的可用XML数据创建电子表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆