Questions tagged [excelpackage]

ExcelPackage is open-source software that provides server-side generation of Microsoft Excel 2007 spreadsheets.

From the ExcelPackage homepage:

ExcelPackage provides server-side generation of Excel 2007 spreadsheets.
It is a set of classes and wrappers around the .NET 3.0 System.IO.Packaging API and the new Office Open XML file format. It extracts away the complexity of dealing with the individual XML components making it real easy to create sophisticated spreadsheets on the server.

58 questions
17
votes
2 answers

How to set color or background with "excelpackage"

I use this package: ExcelPackage though I can't figure out how to set the background color for the cell. I tried to use this: ws.Cells["A1"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid; But it shows that the properties are not…
Sergey
  • 7,933
  • 16
  • 49
  • 77
16
votes
2 answers

Set currency format for Excel cell that is created with ExcelPackage

How can I set the currency format for an Excel cell that is created with ExcelPackage? worksheet.Cell(i, 7).Value = item.Price.ToString();
misho
  • 1,195
  • 6
  • 16
  • 29
8
votes
3 answers

NullReferenceException in creating Excel worksheet

i want to fill an excel file and so i use ExcelPackage: Office Open XML Format . but i have an error. my code: string fileName = "DBE_BAKIM_FORMU" + ".xlsx"; FileInfo fi = new FileInfo(HttpContext.Current.Server.MapPath("~/") + fileName); using…
7
votes
1 answer

Write excel using excel package with formatting

I want to write excel file using excel package from System.Data.DataTable and need to format some cells in excel file like back ground color. How can I do that?
Lajja Thaker
  • 2,031
  • 8
  • 33
  • 53
5
votes
3 answers

C# create/modify/read .xlsx files

I am looking for a way to create, modify, read .xlsx files in C# without installing Excel or creating files on the server before giving to the user to download. I found NPOI http://npoi.codeplex.com/ which looks great but supports .xls not .xlsx I…
Baxter
  • 5,633
  • 24
  • 69
  • 105
5
votes
2 answers

How to remove Blank Rows using EPPlus Excel Package Plus

I'm using EPPlus 4.1.0.0, and I want to convert my excel sheet into a datatable. There are few empty rows at the end of the excel file. So while converting it, I am also getting the empty rows into datatable. How do I remove the empty rows before…
ashveli
  • 248
  • 6
  • 28
5
votes
1 answer

C# ExcelPackage (EPPlus) DeleteRow does not change sheet dimension?

I am trying to build a data import tool that accepts an EXCEL file from the user and parses the data from the file to import data into my application. I am running across a strange issue with DeleteRow that I cannot seem to find any information…
Josh
  • 451
  • 8
  • 22
5
votes
1 answer

how to create excel sheet from template excel sheet programmatically?

I am creating a excel sheet from tempalte excel sheet. I have a code try { FileInfo newFile = new FileInfo(@"D:\ExcelFromTemplate.xlsx"); FileInfo template = new FileInfo(@"D:\template.xlsx"); using (ExcelPackage xlPackage = new…
Girish
  • 71
  • 1
  • 3
  • 7
4
votes
1 answer

How to set value of Excel cell by name instead of using coordinates with EPPlus?

I am able to set cell values using EPPlus: var template = new FileInfo(Server.MapPath("~/App_Data/my_template.xlsx")); var pck = new ExcelPackage(template); var ws = pck.Workbook.Worksheets.First(); ws.Cells[15, 4].Value = 66; ws.Cells["B1"].Value…
Stefan
  • 10,010
  • 7
  • 61
  • 117
4
votes
3 answers

ExcelPackage and 98 thousand rows

I want to write an excel file (2007) with the codeplex excelpackage but it is taking a lot of time to write the excel file. I didn't find any method that it could accept a datasource. the piece of my code: var newFile = new…
Gerbrand
  • 5,274
  • 4
  • 29
  • 34
2
votes
1 answer

Excel file remaining locked for editing after use

I have a Windows Forms application with an OpenFileDialog. The user clicks a "Process" button and the application goes through the file - an Excel spreadsheet - and processes the data in it. All of this works as expected with one caveat. After the…
TheIronCheek
  • 1,077
  • 2
  • 20
  • 50
2
votes
1 answer

Convert the string with datetime format-"yyyyMMddhhmmssfff" to "DD-MM-YYYY HH:MM) before exporting DataTable to excel

I am exporting the result from a database to excel using ExcelPackage(EPPLUS nuget package). The datetime field from the database is in string and in the format - yyyyMMddhhmmssfff which is not readable in excel after exporting-ex-…
230490
  • 516
  • 4
  • 15
2
votes
0 answers

how to change the encoding of ExcelPackage() in epplus

Is there any way to encode the ExcelPackage() to UTF-8 format. I have already tried ExcelTextFormat() but does not resolve my issue. The issue is that when I export a CSV file it displays a warning "file format and extension of fileName.csv does not…
Mohan Kurali
  • 362
  • 1
  • 4
  • 15
2
votes
3 answers

Set format of cells produced by LoadFromCollection (epplus) using data annotation

I am using eeplus to create an excel spreadsheet, like this using (var pck = new ExcelPackage()) { var ws = pck.Workbook.Worksheets.Add("Customers"); ws.Cells["A1"].LoadFromCollection(customers, PrintHeaders: true); var ms = new…
Anders Lindén
  • 6,839
  • 11
  • 56
  • 109
2
votes
1 answer

Error opening file generated by epplus

I'm using ExcelPackage throughout my wpf application for generating csvs and xlsxs, whenever I open a xlsx that has been generated by epplus in excel it opens without an error, but when I open a generated csv in excel it shows me "The file format…
Andy
  • 823
  • 5
  • 17
  • 37
1
2 3 4