Questions tagged [closedxml]

ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files.

ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.

ClosedXML provides a object oriented way to manipulate Excel 2007+ (.xlsx, .xlsm, etc) files (similar to VBA) without dealing with the hassles of XML Documents. It can be used by any .NET language like C# and Visual Basic (VB).

Online resources:

615 questions
1
vote
1 answer

ClosedXml.Excel HasDuplicates Extension Method Missing following Upgrade

I've been tasked with taking a legacy project written with WPF, that was integrated into a bigger application and making it stand-alone. It hasn't been touched for some time, and from experience, this will always lead to issues when trying to bring…
MartinS
  • 111
  • 1
  • 14
1
vote
0 answers

Return Excel file from core API

I have dotnet Core API which returns excel file(using ClosedXML) data and consuming this API in angular API Method using (MemoryStream stream = new MemoryStream()) { var workbook = new XLWorkbook(); var SheetNames…
Virender Thakur
  • 327
  • 3
  • 12
1
vote
1 answer

Can ClosedXML create a formatted table from merged cells?

Based on documentation examples from: https://github.com/ClosedXML/ClosedXML/wiki/Using-Tables In a C# application, I use ClosedXML to create a workbook with new content. Part of the content is a range of cells that I would like to style as a…
Mike Finch
  • 746
  • 1
  • 7
  • 20
1
vote
1 answer

Put datatable in new worksheet

I'm trying to import a datatable into Excel using VB. I found tons of ways to do so, but all of them got an issue for me. The first method I tried was using ClosedXML. It was great for importing data, but it messed up the pivot table. This is a…
F. Koelman
  • 31
  • 6
1
vote
0 answers

Asp Net Core 3.1 Large Data Export Excel with ClosedXML

I need to get 400-500k data in excel output, but in the Worksheet.SaveAs (stream) part, the data takes up 6gb of ram at a time and the application closes when the ram is not enough on the computer. What I want is to get excel output, but even if it…
1
vote
0 answers

Large excel files taking more time to initialize for ClosedXML

I am using ClosedXML.0.76.0 in my MVC 5 C# project to load the uploaded excel file's data into the object which exists in the MVC controller and afterward displaying data in UI from the object. To get this, I am using WorkBook = new…
Divyang Patel
  • 920
  • 1
  • 8
  • 15
1
vote
1 answer

How to write date in Italian and set italian as default language in ASP.Net C#

I use ClosedXML to generate Excel file, taking data from Microsoft SQL Server. And I write the Date in this fotmat: DDDD D-MM-yyyy.The problem is that it writes in English. I want to set Italian language as default. This is how I generate Excel…
ewardz1
  • 29
  • 9
1
vote
2 answers

index out of range error in c#, "Cannot find column 0"

This is a snippet of my code. XLWorkbook wb = new XLWorkbook(); GridView[] gvExcel = new GridView[] { gv01PL, gv01PD, gv01T1, gv023P, gv023L, gv02SU }; string[] name = new string[] { "01-PL", "01-PD", "01-T1", "02-3P", "02-3L", "02-SU" }; for (int i…
Captain
  • 420
  • 5
  • 14
1
vote
1 answer

ClosedXML convert percentage in template

I`m using closedXML to generate a simple template with 3 columns. To create this template i`m using this code: protected void btnTemplate_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); var tipo =…
Delfanor
  • 77
  • 6
1
vote
2 answers

ClosedXML - How do I set the scroll position of a sheet?

I am creating an Excel spreadsheet (XLSX) from an existing template and adding a dataset to a table on one of the worksheets. I have been able to programmatically set the active sheet, but I can't set where the scroll position of the sheet is so…
1
vote
1 answer

How to sum column value in ClosedXML

I have 9 columns and I want to sum value of each column in ClosedXML. These are the columns : foreach (Attivita attivita in listaSomthing) { worksheet.Cell(index, 1).Value = attivita.Somthing; worksheet.Cell(index, 2).Value =…
MiceX
  • 27
  • 1
  • 9
1
vote
2 answers

Reading only specific rows from Excel using ClosedXML

I would like to read only specific row from an Excel based on value in one of the columns using Lynq query or similar instead of looping through entire rows. Below one does the trick if I exactly know the column index. var result =…
1
vote
0 answers

ClosedXML - Get conditional formatting Style Applied

I am working on manipulation Excel, in order to convert it to HTML, and I am using ClosedXML/EP plus. The issue here: I can't identify for a cell if conditional formatting has been applied or not. When I am doing…
Jijaxxx
  • 13
  • 4
1
vote
1 answer

How to convert System.Drawing.Color to ClosedXML.Excel.XLColor in C#

I am working with ClosedXML and the background color of a specific cell could be set like the following code. using (var workbook = new XLWorkbook()) { var worksheet = workbook.Worksheets.Add("Sample Sheet"); worksheet.Cell("A1").Value =…
JimmyHu
  • 403
  • 1
  • 8
  • 20
1
vote
2 answers

ClosedXML: remove/change alternating row color?

Here's my code so far (VB): Dim wb As New ClosedXML.Excel.XLWorkbook() wb.Worksheets.Add(dTable, "export") wb.SaveAs(location) How can I remove just styling of the alternate rows (defaults to light blue)
user3130959
  • 31
  • 1
  • 6