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
0
votes
3 answers

Gathering Data For ClosedXML Using foreach Loop

My C# ASP.NET MVC5 application has a model named Ticket. I want to export all of the tickets in my database to an excel spreadsheet using ClosedXML. I have an Action just for exporting and downloading the data to the spreadsheet. Everything is…
Michael
  • 339
  • 4
  • 13
0
votes
2 answers

How to count number of columns Excel file in ClosedXML?

I tried to do that using code: worksheet.Columns.count(); But there is not method count() for Columns All code is: class ExcelReader { private XLWorkbook workbook; private string file; private IXLWorksheet…
ITMANAGER
  • 131
  • 1
  • 3
  • 10
0
votes
1 answer

How to create an editable excel

I am creating an Excel file: SpreadsheetDocument document = SpreadsheetDocument.Create(filename, SpreadsheetDocumentType.Workbook) WorkbookPart workBookPart = document.AddWorkbookPart(); workBookPart.Workbook = new Workbook(); …
Toni
  • 57
  • 3
  • 15
0
votes
3 answers

Iterate through all the data in excel file and find specific text

I need to generate a excel file which range is not known, so I can't iterate through fixed range of columns/rows. So is there a way to iterate through the used cells in order to find all cells with text "V" using ClosedXML or OpenXML?
Toni
  • 57
  • 3
  • 15
0
votes
1 answer

ClosedXml "display value" and "real value"

I am not sure if there is such a thing in Excel (xlsx) file, but if you see the screenshot I can type in certain format of value what is displayed in cell is different from formula bar. But if I use ClosedXml to create Excel, currentCell.Value =…
hardywang
  • 4,864
  • 11
  • 65
  • 101
0
votes
0 answers

C# Closed.XML Password Protection

I am using c# Closed.XML for creating excel files then i need protect them with a password. Do you know anyway to protect excel file with a password by Closed.XML, or you know another way to creating password protection?
Alex
  • 13
  • 1
  • 4
0
votes
1 answer

How to Read percentage value with sign(%) from Excel file using ClosedXml

Input: Cell Value=6.25%; var Value= ws1.Cell(rowNum, collNum).Value.ToString(); Output: 0.0625 Expected Output: 6.25%
0
votes
0 answers

C# DataTable to Excel using ClosedXML

I have looked through post after posts and cannot figure how to get this to work. I have a c# controller which i want to return an excel file of the data query from database. My response which I capture from firebug seems to be in binary (see…
chungtinhlakho
  • 870
  • 10
  • 21
0
votes
2 answers

Export data from excel to a database table using ClosedXML example

i have to read rows of data from an excel file which has only a column and then i have to save the rows in a table in database . In my project i have to use ClosedXML .dll . I have search but i couldn't find an example . Can you please help…
Jona
  • 1
  • 3
0
votes
1 answer

ClosedXML.Excel.XLCell Verify if Cell have Bold Properties

Hi i have a XLCell and need to validate if that cell have Bold style. IXLCell cell = worksheet.Cell(12, 5); if (cell.Style.Font.Bold) { callFunction(); } Open xlsx the cell have the Bold style…
user2903358
  • 1
  • 1
  • 1
0
votes
1 answer

OutOfMemory errors using large datatables with ClosedXML

I have an issue creating worksheets when adding large DataTables. I am getting out of memory errors. I turned off the event tracking as suggested to improve performance and memory consumption but I am still experiencing these errors. Here is some…
tsage080667
  • 89
  • 1
  • 10
0
votes
1 answer

C# create Pivot Charts OpenXML

Good morning, I am creating a pivot table with closedxml, so far so good everything is working fine, does anyone knows how to create a chart associated with the pivot table (pivot chart) using ClosedXML or OpenXML. Is it even possible or only normal…
Luciano Pinto
  • 43
  • 1
  • 9
0
votes
1 answer

Exporting large(>500000 rows) Datasets into xlsx

I have problem with export dataset into xlsx. My code: DataSet freeTable = new DataSet(); freeTable = FoxDal.Instance.freeTable; XLWorkbook wb = new XLWorkbook(); wb.Worksheets.Add(freeTable.Tables[0], "sheet1"); wb.SaveAs(@"E:\test5.xlsx"); While…
P10trek
  • 167
  • 4
  • 15
0
votes
1 answer

Aspose cells / Closed XML insert row issue

I am using Aspose cells to open spreadsheets from dot net and insert data. In some cases we have to insert new rows for the data, meaning stuff below the insertion point gets pushed down. Trouble is, anything referencing cells in those rows (eg a…
Programnik
  • 1,449
  • 1
  • 9
  • 13
0
votes
1 answer

closedxml pivot table report filter default value

How do you set default Report Filter value? Dim ws_pivot As IXLWorksheet = wb.Worksheets.Add("NAME") Dim pivot_range As IXLRange = some_data.RangeUsed() Dim pivot_table As IXLPivotTable = ws_pivot.PivotTables.AddNew("Pivot_Name",…
BadirPJ
  • 3
  • 2