Error when sheet name contain ','. Error at 682, in XLWorkbook.
↧
Created Unassigned: Error when sheet name contain ','. Error at 682, in XLWorkbook. [8787]
↧
New Post: Can this be upgraded or forced to use Open XML SDK 2.5 as that version fixes white space issues
Powerpoint OpenXML whitespace is disappearing
As per the above article, there is an acknowledged bug with white space in Open XML SDK 2.5. Could ClosedXML be upgraded to use 2.5 or is it possible to force it to do so?
Regards, Paul
As per the above article, there is an acknowledged bug with white space in Open XML SDK 2.5. Could ClosedXML be upgraded to use 2.5 or is it possible to force it to do so?
Regards, Paul
↧
↧
New Post: Memory problem with ClosedXML
Thanks for the reply, Mitch. This was only a test to assess ClosedXML's memory usage. Looking at XLAddress, XLRow and XLCell I can see that they do not implement IDisposable, and I cannot see how resources are released. From my tests it seems like they keep holding on to a lot of memory even after the using block is exited. I would be keen to read other members' opinions on this.
↧
Commented Issue: Implement Subtotals [7862]
I'm not sure how to upload a file, but here's an example. Let me know if that helps. I think, using the examples of formulas and ranges you gave above, I could make it work for the specific spreadsheet I'm working on. The problem is, I'd have to figure out how to do it for each spreadsheet that uses subtotals. I'd like an easy way to define what field to break on and which columns to add or count or whatever for the subtotal.
Name Date Amount
Joe Blow 2-Mar-2011 50.00
Slim Jim 2-Mar-2011 45.00
Bobby Boy 2-Mar-2011 50.00
2-Mar-2011 Total 145.00
Joe Blow 5-Mar-2011 30.00
Bobby Boy 5-Mar-2011 25.00
5-Mar-2011 Total 55.00
Someone Else 7-Mar-2011 50.00
Still Another 7-Mar-2011 25.00
7-Mar-2011 Total 75.00
Grand Total 275.00
Comments: ** Comment from web user: lperez **
Name Date Amount
Joe Blow 2-Mar-2011 50.00
Slim Jim 2-Mar-2011 45.00
Bobby Boy 2-Mar-2011 50.00
2-Mar-2011 Total 145.00
Joe Blow 5-Mar-2011 30.00
Bobby Boy 5-Mar-2011 25.00
5-Mar-2011 Total 55.00
Someone Else 7-Mar-2011 50.00
Still Another 7-Mar-2011 25.00
7-Mar-2011 Total 75.00
Grand Total 275.00
Comments: ** Comment from web user: lperez **
A question already resolved this topic?
↧
New Post: CopyTo seems to be slow while copying a lot of lines.
Since the InsertRowBelow() don't keeps the formats and formulas from the root row, I have to copy from the root row. At last i fill in certain values in to the created rows.
rad = ws.Cell("KontoSaldo").Address.RowNumber;
ws.Row(rad).InsertRowsBelow(2000);
for (int i = 1; i <= 2000r; i++)
{
FillTheRowsWithValues()
It seems that the CopyTo takes longer time for each time it's copying. On my machine it took about 10 sec the first 200 items, when it comes to about 1000 it's only makes about 20 for each 10 sec.
rad = ws.Cell("KontoSaldo").Address.RowNumber;
ws.Row(rad).InsertRowsBelow(2000);
for (int i = 1; i <= 2000r; i++)
{
ws.Row(rad).CopyTo(ws.Row(rad + i));
}FillTheRowsWithValues()
It seems that the CopyTo takes longer time for each time it's copying. On my machine it took about 10 sec the first 200 items, when it comes to about 1000 it's only makes about 20 for each 10 sec.
↧
↧
New Post: data schema subtotal like office 2007???
how to calculate subtotal
like the way in excel from data menu - scheme - subtotal menu
thanks!
like the way in excel from data menu - scheme - subtotal menu
thanks!
↧
Created Unassigned: Error when using XLSX from SSRS [8807]
I get a null reference exception.
It occurs in the XLWorkbook_Load.cs - Load cells. Line 788
xlCell._cellValue = cell.InlineString != null && cell.InlineString.Text != null ? cell.InlineString.Text.Text.FixNewLines() : String.Empty;
I added the nullcheck on cell.InlineString.Text != null
It occurs in the XLWorkbook_Load.cs - Load cells. Line 788
xlCell._cellValue = cell.InlineString != null && cell.InlineString.Text != null ? cell.InlineString.Text.Text.FixNewLines() : String.Empty;
I added the nullcheck on cell.InlineString.Text != null
↧
Reopened Issue: Strange values returned, bad value in cell [8535]
I have an excel file that has a formaula getting its values from other tabs. ClosedXml is returning completely different values. This is very strange behaviour. In cell M1210 there is a value (if opened with excel) of -1634290,7 located in TAB [STAGING]. Codeplex is returning the value -180807,44
Woops. Also other values in this column are having the same problem.
This is no good news.
Woops. Also other values in this column are having the same problem.
This is no good news.
↧
Reopened Issue: Style isnt copied with row.copyto [8493]
im trying to populate an XLS template, and to test the best way im using the following code[code]using System;using ClosedXML.Excel;using System.Linq;using System.Diagnostics;namespace ClosedXML_Examples{ public class Program { static void Main(string[] args) { int innerloop = 100; Stopwatch s = new Stopwatch(); for (int k = 1; k <= 1; k++) // just to test Speed-slowdown when working with Large Data. raise values for testing { XLWorkbook workbook = new XLWorkbook(XLEventTracking.Disabled); s.Reset(); s.Start(); copyDown3(makeSheet(workbook, "copy_loop"), 1, innerloop, k); s.Stop(); Console.WriteLine(string.Format("copy1 : Zeit für {0:D5} durchläufe : {1} = {2:F2} ms/100", k * innerloop, s.Elapsed, (decimal)s.ElapsedMilliseconds / (k * innerloop) * 100)); workbook.SaveAs("test.xlsx"); } Console.Read(); } static IXLWorksheet makeSheet(XLWorkbook workbook,string name) { IXLWorksheet ws = workbook.Worksheets.Add(name); ws.Cell(2, 1).Value = "ende"; // zeile 1 vorbereiten ws.Cell(1, 1).Value = 1.123; for (int x = 1; x <= 21; x++) ws.Cell(1, x).Style.NumberFormat.Format = "#,##0.00"; for (int x = 0; x < 7; x++) { ws.Cell(1, 3 * x + 1).Value = 3 * x + 1; ws.Cell(1, 3 * x + 2).Value = 3 * x + 2; ws.Cell(1, 3 * x + 3).FormulaR1C1 = "=RC[-2]+RC[-1]"; ws.Cell(1, 3 * x + 3).Style.Fill.BackgroundColor = XLColor.Xanadu; } return ws; } static void copyDown3(IXLWorksheet ws, int srcrow, int innerloop, int anz) { for (int i = 0; i < innerloop * anz; i++) { ws.Row(srcrow).CopyTo(ws.Row(srcrow + 1 + i)); // <-- Format isnt copied ! . Why ? } } }}[/code]the formulas are copied, but the styles-Formats are getting lost.am i doing something wrong, or is it bugged ?
↧
↧
Reopened Issue: There isn't a worksheet named '#REF' [8465]
I've attached a simple workbook that can't be opened. It works fine with OpenXML library directly (and incidentally with NPOI and EPPlus).The Exceptions is: There isn't a worksheet named '#REF'.Details:This file was fine when first created but I then added, then deleted, sheets from another workbook that was exhibiting this same problem.I found this entry in the forum which is identical:http://closedxml.codeplex.com/discussions/350351
↧
Reopened Issue: Databars causing Unhandled Exception [8418]
Hi,opening a file with simple databars and saving the file without doing anything else is causing this exception.System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at ClosedXML.Excel.XLCFDataBarConverter.Convert(IXLConditionalFormat cf, Int32 priority, SaveContext context) at ClosedXML.Excel.XLCFConverters.Convert(IXLConditionalFormat conditionalFormat, Int32 priority, SaveContext context) at ClosedXML.Excel.XLWorkbook.GenerateWorksheetPartContent(WorksheetPart worksheetPart, XLWorksheet xlWorksheet, SaveContext context) at ClosedXML.Excel.XLWorkbook.CreateParts(SpreadsheetDocument document) at ClosedXML.Excel.XLWorkbook.CreatePackage(String filePath)I attached a simple xlsx. I also tried the latest check-in.Edit: I should have uploaded the valid file - not the corrupted one.br,Peter
↧
Reopened Issue: Range is invalid when saving a file [8406]
Hi, im trying to learn ClosedXML and doing some simple Tests with my Excel Template. private void testCX_direct() { XLWorkbook wb = new XLWorkbook(@"z:\xls\EAV_VU-Daten_Master_1.xlsx"); // öffnen IXLRange r1 = wb.Range("meldung_zeile"); var ws = r1.Worksheet; int rowNr = r1.FirstRow().RowNumber(); for (int i = 1; i < anz_rows; i++) { for (int k = 0; k < 20; k++) { ws.Cell(rowNr, 1 + k).Value = k.ToString(); } ws.Row(rowNr).CopyTo(ws.Row(rowNr + i)); // neue zeile einfügen } ws.Row(rowNr).Delete(); wb.SaveAs(@"z:\xls\EAV_VU-Daten_Master_ClosedXML.xlsx"); }it works well, but when trying to save the file it throws an error (range is invalid)'Einnahmemeldungen'!$A$3:$A$3 in Worksheet Einnahmemeldungenthat range doesnt even exist. the only one i can think of is the named row, and even if i delete that one (ws.NamedRanges.DeleteAll();)the error is still there.attaching the xlsx file that i use a test-template for the above code.
↧
Reopened Issue: "NaN" causes unreadable content error [8403]
I was getting "Excel found unreadable content" errors in some of my workbooks, but I finally tracked down the issue. To reproduce, start a new workbook and add "NaN" to one of the cells:
Dim wb As New XLWorkbook()
Dim ws As IXLWorksheet = wb.Worksheets.Add("Test")
ws.Cell(1, 1).Value = "NaN"
Upon opening the file, you'll get the "unreadable content" error. If you choose to repair the file, it will then show "NaN" in the cell as expected.
I compared the orignial and repaired versions of xl\SharedStrings.xml, and "NaN" wasn't present in the original file - could that have something to do with it?
Dim wb As New XLWorkbook()
Dim ws As IXLWorksheet = wb.Worksheets.Add("Test")
ws.Cell(1, 1).Value = "NaN"
Upon opening the file, you'll get the "unreadable content" error. If you choose to repair the file, it will then show "NaN" in the cell as expected.
I compared the orignial and repaired versions of xl\SharedStrings.xml, and "NaN" wasn't present in the original file - could that have something to do with it?
↧
↧
Reopened Issue: ValueCached shows null after I reopen the ClosedXML saved file [8396]
I faced an issue while trying to recover a formula cell through ValueCache after saving the file through the workbook save method. Following are the steps to reproduce this issue:
1) Open the attached file
2) Its a simple file with the following values
A1 = 8
B1 = 6
C1 = A1 + B1 = 14
3) I use the following code snippet to open the file, read ValueCached from C1, change the value in A1 and save the file. So far its good and the ValueCached shows the correct value which is 14. Now when I run this second time, the ValueCached shows null
var wb = new XLWorkbook(@"c:\fincalc\simple.xlsx");
var ws = wb.Worksheet(1);
var c1 = ws.Cell("C1").ValueCached;
ws.Cell("A1").Value = "10";
wb.Save();
4) Also if I open the same file through excel and try to exit excel, it promts me to save the file even when I have not changed anything. Can you please let me know if the wb.Save() method is missing out something while saving the file?
Thanks in advance for your time.
1) Open the attached file
2) Its a simple file with the following values
A1 = 8
B1 = 6
C1 = A1 + B1 = 14
3) I use the following code snippet to open the file, read ValueCached from C1, change the value in A1 and save the file. So far its good and the ValueCached shows the correct value which is 14. Now when I run this second time, the ValueCached shows null
var wb = new XLWorkbook(@"c:\fincalc\simple.xlsx");
var ws = wb.Worksheet(1);
var c1 = ws.Cell("C1").ValueCached;
ws.Cell("A1").Value = "10";
wb.Save();
4) Also if I open the same file through excel and try to exit excel, it promts me to save the file even when I have not changed anything. Can you please let me know if the wb.Save() method is missing out something while saving the file?
Thanks in advance for your time.
↧
Reopened Issue: Freeze + Cell select creates unreadable excel [8389]
Hi there,
I found that whenever I do the following:
sheet.SheetView.FreezeColumns(1);
sheet.Cell(1, 1).Select();
The Excel saved is unreadable by MS Excel. However, if I either don't select the first cell or don't freeze panes, the resultant Excel works fine.
I found that whenever I do the following:
sheet.SheetView.FreezeColumns(1);
sheet.Cell(1, 1).Select();
The Excel saved is unreadable by MS Excel. However, if I either don't select the first cell or don't freeze panes, the resultant Excel works fine.
↧
Reopened Issue: Version 68.1 changed order of Rows collection [8373]
I upgraded from version 67.2 to version 68.1 and now the following code does not work.
int rowCount = 0;
XLWorkbook sourceWB = new XLWorkbook(fileLocation);
IXLWorksheet sourceWS = sourceWB.Worksheet(1);
foreach (IXLRow row in sourceWS.Rows())
{
rowCount = row.RowNumber();
...
}
In version 67.2 and all prior versions this gave me each row in order starting at row 1.
Now in version 68.1 the first row in the list is the row of the cell that was selected when the file was saved.
This breaks all my existing code because I expect the first row in the list to be the header row and I depend on the rows being in order.
Thank you.
int rowCount = 0;
XLWorkbook sourceWB = new XLWorkbook(fileLocation);
IXLWorksheet sourceWS = sourceWB.Worksheet(1);
foreach (IXLRow row in sourceWS.Rows())
{
rowCount = row.RowNumber();
...
}
In version 67.2 and all prior versions this gave me each row in order starting at row 1.
Now in version 68.1 the first row in the list is the row of the cell that was selected when the file was saved.
This breaks all my existing code because I expect the first row in the list to be the header row and I depend on the rows being in order.
Thank you.
↧
Reopened Issue: Issue with inserting and deleting row [8339]
I am still having issues with these edge cases when inserting and deleting rows, where cells are selected. As before I do not get library errors but, do get an error in excel when opening the file.
I tried adding sh1.Cell(1, 1).Select(); before deleting/adding rows, but that did not help.
Below are the two tests I was using.
using (XLWorkbook b = new XLWorkbook("C:\\rowDelete2.xlsx"))
{
IXLWorksheet sh1 = b.Worksheets.Worksheet(1);
sh1.Row(2).InsertRowsAbove(2);
sh1.Row(4).Delete();
sh1.Row(4).Delete();
b.SaveAs("C:\\rowDelete_modify2.xlsx");
}
using (XLWorkbook b = new XLWorkbook("C:\\rowDelete.xlsx"))
{
IXLWorksheet sh1 = b.Worksheets.Worksheet(1);
sh1.Row(2).InsertRowsAbove(2);
sh1.Row(4).Delete();
b.SaveAs("C:\\rowDelete_modify.xlsx");
}
I tried adding sh1.Cell(1, 1).Select(); before deleting/adding rows, but that did not help.
Below are the two tests I was using.
using (XLWorkbook b = new XLWorkbook("C:\\rowDelete2.xlsx"))
{
IXLWorksheet sh1 = b.Worksheets.Worksheet(1);
sh1.Row(2).InsertRowsAbove(2);
sh1.Row(4).Delete();
sh1.Row(4).Delete();
b.SaveAs("C:\\rowDelete_modify2.xlsx");
}
using (XLWorkbook b = new XLWorkbook("C:\\rowDelete.xlsx"))
{
IXLWorksheet sh1 = b.Worksheets.Worksheet(1);
sh1.Row(2).InsertRowsAbove(2);
sh1.Row(4).Delete();
b.SaveAs("C:\\rowDelete_modify.xlsx");
}
↧
↧
Created Unassigned: System.OutOfMemoryException in v0.68.0.10, regression? [8808]
Hello,
In order to improve the speed of reading/writing of Excel files, I have recently updated ClosedXML from v0.64.0.0 to v0.68.0.10.
The kind of Excel file that I deal with is a big file, embedding a lot of VBA code ; I use it as a template, filling only 2 sheets with raw data (number or string, no formula).
The VBA developper improve this file continuously, for some files there was a huge speed difference, but we have arrived in a point where :
- With v0.64.0.0, we have the good results, but it is very slow
- With v0.68.0.10, the memory is increasing and then a "System.OutOfMemoryException" is thrown.
The exception is thrown in the code below
```
public XLWorkbook OpenExcel(MemoryStream xlsStream)
{
return new XLWorkbook(xlsStream, XLEventTracking.Disabled); //RR 13/06/2013 Turning off events
}
```
with v0.64.0.0 the memory is not increasing a lot during this operation (quite stable), but with v0.68.0.10 the memory used is increasing a lot (1 more GB) and then the exception occured.
I try to turn of the events, but it doesn't change anything.
Does anyone else had this issue before?
Thank you very much for your help.
Regards,
Renaud
In order to improve the speed of reading/writing of Excel files, I have recently updated ClosedXML from v0.64.0.0 to v0.68.0.10.
The kind of Excel file that I deal with is a big file, embedding a lot of VBA code ; I use it as a template, filling only 2 sheets with raw data (number or string, no formula).
The VBA developper improve this file continuously, for some files there was a huge speed difference, but we have arrived in a point where :
- With v0.64.0.0, we have the good results, but it is very slow
- With v0.68.0.10, the memory is increasing and then a "System.OutOfMemoryException" is thrown.
The exception is thrown in the code below
```
public XLWorkbook OpenExcel(MemoryStream xlsStream)
{
return new XLWorkbook(xlsStream, XLEventTracking.Disabled); //RR 13/06/2013 Turning off events
}
```
with v0.64.0.0 the memory is not increasing a lot during this operation (quite stable), but with v0.68.0.10 the memory used is increasing a lot (1 more GB) and then the exception occured.
I try to turn of the events, but it doesn't change anything.
Does anyone else had this issue before?
Thank you very much for your help.
Regards,
Renaud
↧
New Post: Unable to open workbook in Secure environment
I have an application which I used CLosedXMl to generate and Excel workbook in memory. I can open or download the excel workbook in firefox and chrome in all environments whether this environment uses http or https. When I use IE, I can only open the workbook in an environment which uses http and when I moved the code to QA environment where https is required, I get an error when open or downloading the workbook. The error message is "Internet Explorer cannot download xxxxxx from qa.myaccount.thomsonreuters.com.
Internet Explorer was not able to open this Internet site. This requested site is either unavailable or cannot be found. Please try again later.
Any help will be highly appreciated.
Hakim
Internet Explorer was not able to open this Internet site. This requested site is either unavailable or cannot be found. Please try again later.
Any help will be highly appreciated.
Hakim
↧
Commented Unassigned: System.OutOfMemoryException in v0.68.0.10, regression? [8808]
Hello,
In order to improve the speed of reading/writing of Excel files, I have recently updated ClosedXML from v0.64.0.0 to v0.68.0.10.
The kind of Excel file that I deal with is a big file, embedding a lot of VBA code ; I use it as a template, filling only 2 sheets with raw data (number or string, no formula).
The VBA developper improve this file continuously, for some files there was a huge speed difference, but we have arrived in a point where :
- With v0.64.0.0, we have the good results, but it is very slow
- With v0.68.0.10, the memory is increasing and then a "System.OutOfMemoryException" is thrown.
The exception is thrown in the code below
```
public XLWorkbook OpenExcel(MemoryStream xlsStream)
{
return new XLWorkbook(xlsStream, XLEventTracking.Disabled); //RR 13/06/2013 Turning off events
}
```
with v0.64.0.0 the memory is not increasing a lot during this operation (quite stable), but with v0.68.0.10 the memory used is increasing a lot (1 more GB) and then the exception occured.
I try to turn of the events, but it doesn't change anything.
Does anyone else had this issue before?
Thank you very much for your help.
Regards,
Renaud
Comments: ** Comment from web user: RenaudR **
In order to improve the speed of reading/writing of Excel files, I have recently updated ClosedXML from v0.64.0.0 to v0.68.0.10.
The kind of Excel file that I deal with is a big file, embedding a lot of VBA code ; I use it as a template, filling only 2 sheets with raw data (number or string, no formula).
The VBA developper improve this file continuously, for some files there was a huge speed difference, but we have arrived in a point where :
- With v0.64.0.0, we have the good results, but it is very slow
- With v0.68.0.10, the memory is increasing and then a "System.OutOfMemoryException" is thrown.
The exception is thrown in the code below
```
public XLWorkbook OpenExcel(MemoryStream xlsStream)
{
return new XLWorkbook(xlsStream, XLEventTracking.Disabled); //RR 13/06/2013 Turning off events
}
```
with v0.64.0.0 the memory is not increasing a lot during this operation (quite stable), but with v0.68.0.10 the memory used is increasing a lot (1 more GB) and then the exception occured.
I try to turn of the events, but it doesn't change anything.
Does anyone else had this issue before?
Thank you very much for your help.
Regards,
Renaud
Comments: ** Comment from web user: RenaudR **
Hello, I have news.
I have done some tests with different versions of ClosedXML between 0.64 and 0.68.0.10, and it prove that the problem of "System.OutOfMemoryException"appear with version 0.65 !
So the gap is much more smaller saying something is wrong between 0.64 and 0.65.
Regards,
Renaud
↧