M
M
MADm2016-06-23 18:45:49
ASP.NET
MADm, 2016-06-23 18:45:49

What to use to quickly generate an Excel file?

ASP.NET MVC project. The task is to generate a simple Excel file of 4-5 pages from the user's data with some simple design, possibly with a couple of graphs. Moreover, it is desirable not only to generate it and save it on hard, but immediately give it back to the user, without saving it to hard. Actually, what approach is the simplest in terms of writing code and more reliable.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stanislav Makarov, 2016-06-23
@MADm

Except for this requirement:
then definitely EPPlus (in nuget: EPPlus ), you are unlikely to find something better that does not require an installed Office. As for "immediately give to the user" - you need to see if the workbook can write to Stream, and not to a file.
UPD: judging by the designer ExcelPackage(Stream newStream), he can. So write to MemoryStream and give it to the user. Don't forget to set the Content-Type as needed)

R
Rou1997, 2016-06-23
@Rou1997

XLS or XLSX?
There are libraries for both, for example NPOI, for the second one it is quite easy to write "bicycle".

A
AxisPod, 2016-06-24
@AxisPod

For the new format - ClosedXML.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question