Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an Excel file on linux using Mono Develop

Tags:

.net

linux

excel

I am currently working on a C#.net project (in VS2010) which works with the Excel interop. At some point though, I am going to have to put the project through Mono Develop and up onto our Linux server.

I've heard that the Excel interop doesn't work in Mono. Is there anyway I can create and manipulate Excel files through code using Mono?

Thanks a lot!

EDIT: Ideally, I would like a way to do this FREE and still be able to support formatting. I don't really need read access, only write.

like image 521
PaulG Avatar asked Aug 28 '12 02:08

PaulG


People also ask

Can we create Excel file in Linux?

API to Create Excel Files on Linux - Free Download It is a powerful spreadsheet manipulation API to create, update or convert Excel files. You can either download the API's JAR or install it within your Maven-based applications using the following configurations.


Video Answer


1 Answers

Do you really need to use Excel itself? The issue here isn't so much that Excel doesn't work with Mono as that Excel doesn't work with Linux. You might be able to do something hacky with Wine in order to run Excel and the related COM interop on Linux, but I would probably suggest forgoing Excel altogether if you're going to use Linux. There are several libraries for manipulating .xls and .xlsx files in a more cross-platform way: an entire StackOverflow question is devoted to working with Excel files without using Excel interop.

Now, if you are doing more than simply creating files - for instance, if you want to use Excel's compute engine - then you probably have to use Excel itself. In that case, I see three clear options: (a) run Excel (and possibly your app as well) under Wine, and hope it works, (b) use Excel for Mac and run your server off of OS X, or (c) use Windows. I don't know if options (a) and (b) will allow proper COM interop, although I would expect that Wine tries to replicate all of COM and Office for Mac has some kind of API that takes the place of COM interop. The third option could come in two flavors: you could use Windows Server to run your website, or you could devote one machine or VM to the Excel calculation engine and contact that from the other parts of your web server code.

like image 62
Adam Mihalcin Avatar answered Nov 15 '22 06:11

Adam Mihalcin