更新Excel文档编程 [英] Updating an excel document programmatically

查看:109
本文介绍了更新Excel文档编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先上下文,我是一个学生安置在一家软件开发公司的自动化团队,让我帮助开发了自动化测试程序在我们的每日构建。

First for context, I am a placement student on the automation team of a software development company, so I help develop the automated test programs on our daily builds.

我的部门经理产生了一个Excel文件,其中将用于present结果从我们的测试环境。我们的测试虚拟PC机的一个Hyper-V服务器上运行。

My line manager has produced an excel document which will be used to present the results from our test environments. Our tests run on virtual PC's on a hyper-V server.

我希望能够更新该Excel文档与从每个测试环境中测试的结果,但我不知道我应该如何去这样做。

I want to be able to update this excel document with the results of tests from each of the test environments, but I'm not sure how I should go about doing this.

每个虚拟电脑的运行自动化程序(C#.NET 4.0),目前副本的测试日志和结果文件给我们的构建机器,这是每个人都可以访问共享文件夹。

Each of the virtual PC's runs an automation program (C# .NET 4.0), and currently copies the test logs and result files to a shared folder on our build machine, which is accessible by everyone.

所以我想自动化程序运行的测试,然后当它已经完成,我希望它写入表Excel文档的测试结果研究。有没有人有修改Excel文档编程的经验吗?我还应该注意到,excel文件将被存储在共享文件夹的远程虚拟PC上(从测试环境中访问)

So I want the automation program to run its tests, then when it has finished, I want it to write to the table in the excel document with the test results. Has anyone any experience with modifying excel documents programmatically? I should also note that the excel document will be stored in a shared folder on a remote virtual PC (accessible from the test environment)

该表将包含构建名称/日期,环境的详细信息,型式试验,试验结果等。

The table will contain the build name/date, environment details, type of test and the test result etc.

我已经收集这些信息和present它在HTML文件 - 但每个测试环境的独立的HTML文件。这样做的目的是这样的结果将全部在一个地方(Excel文档会照顾presenting在图形和图表的形式表中的数据)。

I already collect this information and present it in HTML files - but there is a separate HTML file for each test environment. The goal of this is so that the results will all be in one place (The excel document will take care of presenting the data in the tables in the form of graphs and charts).

所以真的,我所需要知道的是如何写入一个表中从.NET程序Excel文档。似乎有这样做(因为我发现,当我在网上进行搜索的话)不同的方式,所以我想问一下计算器,看看谁知道做到这一点)的最佳方式。

So really, all I need to know is how to write to a table in an excel document from a .NET program. There seems to be different ways of doing this (as I found when I researched it online), so I want to ask stackoverflow to see who knows the best way to do this).

推荐答案

我用过得快乐EPPlus 的http:// epplus。 codeplex.com / 解析,编辑和创建XLSX文件。

I use and am happy with EPPlus http://epplus.codeplex.com/ for parsing, editing and creating xlsx files.

这个问题已经帮了我:创建的Excel(.XLS和.XLSX)从C#文件

This question had helped me out: Create Excel (.XLS and .XLSX) file from C#

这篇关于更新Excel文档编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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