Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating an excel document programmatically

Tags:

c#

.net

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.

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.

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.

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.

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.

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).

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).

like image 709
Ciaran Gallagher Avatar asked Feb 24 '23 06:02

Ciaran Gallagher


1 Answers

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

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

like image 56
Matt Avatar answered Feb 26 '23 21:02

Matt