从WinForm获取数据到Excel [英] Get Data Into Excel from WinForm

查看:223
本文介绍了从WinForm获取数据到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,所以我有一张表格,填写一个客户地址,购买信息等等。现在,我想把这些数据放到Excel中,列出每个购买的产品的数量,人,他们的电子邮件等。每个客户将有自己的行。我的程序是用C#编码的,它是一个winform。现在,我有点初学者,之前我已经把数据放到了ListBox中。这样做很容易做ListBox到Excel或有更好的方法来解决这个问题?

解决方案

我建议引用Microsoft.Office.Interop.Excel。有关如何执行此操作的更多信息,请遵循本指南。



http://msdn.microsoft.com/en-us/library/dd264733.aspx


Ok, So I have a form, that is filled in with a customers address, purchase info etc. Now, I want to get that data into Excel, having a column for the quantities of each product purchased, the name of the person, their email, etc. Each customer would have their own row. My program is coded in C#, it is a winform. Now, I am a bit of a beginner and I have only put data into a ListBox before. Would it be easy to do ListBox to Excel or is there a better way to go about this?

解决方案

I'd recommend referencing Microsoft.Office.Interop.Excel . For more information on how to do this follow this guide.

http://msdn.microsoft.com/en-us/library/dd264733.aspx

这篇关于从WinForm获取数据到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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