I've successfully used ClosedXML to generate a pivot table, but the question is: is it possible in ClosedXML to group a pivot table's columns — preferably by weeks? I cannot find anything on on how to do this on the Internet, or on the Documentation tab. I also couldn't figure it out looking through everything in the Intellisense/Auto-complete in Visual Studio.
↧
New Post: Possible to Group Columns in Pivot Table
↧
New Post: Possible to Group Columns in Pivot Table
I honestly don't know. Pivot table support was added haphazardly by contributors and I forgot the details of it. =/
↧
↧
Created Unassigned: Problem with Symbols in Text Cells [9359]
I'm experiencing a problem when I assign a text value that contains a symbol in it to a cell.
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
↧
Commented Unassigned: Problem with Symbols in Text Cells [9359]
I'm experiencing a problem when I assign a text value that contains a symbol in it to a cell.
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: I get those characters just fine. What's your locale?
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: I get those characters just fine. What's your locale?
↧
New Post: Bijective base-26
Hi, FWIW, i've written a much less featured xlsx reader/writer for a specific purpose in our code base, then i found your project and had a look at the code - after some fun writing different implementations we came across the concept of the bijective base-26 counting system. Perhaps this might be helpful to share the following code which i think is an elegant and possibly most optimal way from a performance point of view of doing the 1-based column number to column reference conversion -
public static class ExcelCellRefs
{
public const Int32 MaxRows = 1048576;
public const Int32 MaxCols = 16384;
/// <summary>
/// 1-based column number -> column reference e.g. 1 -> "A", 16384 => "XFD"
/// </summary>
public static Dictionary<String, Int32> ColRefToNum { get; private set; }
/// <summary>
/// Column reference -> 1-based column number e.g. "A" -> 1, "XFD" -> 16384
/// </summary>
public static Dictionary<Int32, String> ColNumToRef { get; private set; }
static ExcelCellRefs()
{
var colRefs = GenerateColRefs(MaxCols).ToArray();
var tuples = Enumerable.Range(1, MaxCols).
Select(c => new {Num = c, Ref = colRefs[c - 1]}).
ToArray();
ColRefToNum = tuples.ToDictionary(t => t.Ref, t => t.Num);
ColNumToRef = tuples.ToDictionary(t => t.Num, t => t.Ref);
}
/// <summary>
/// Generates Excel column reference names
/// e.g. the last column name for GenerateColRefs(16384) is "XFD"
/// </summary>
public static IEnumerable<String> GenerateColRefs(Int32 columnCount)
{
var names = new List<String>();
var i = 1;
while (i <= columnCount)
{
names.Add(ToBijectiveBase26(i));
i++;
}
return names;
}
/// <summary>
/// No concept of 0 in the bijective base-26 counting system,
/// it's a 26-adic counting system and not a pure base-26 numbering
/// (Thank you Internet for explaining that to me as i would have otherwise
/// had no idea...)
/// </summary>
/// <param name="n">The 1-based column number to convert</param>
/// <returns>The column name as used in Excel e.g. 16384 is "XFD"</returns>
public static String ToBijectiveBase26(Int32 n)
{
var chars = new List<char>();
while (n > 0)
{
--n;
chars.Insert(0, (char)('A' + n % 26));
n /= 26;
}
return String.Join(String.Empty, chars);
}
/// <summary>
/// No concept of 0 in the bijective base-26 counting system,
/// it's a 26-adic counting system and not a pure base-26 numbering
/// (Thank you Internet for explaining that to me as i would have otherwise
/// had no idea...)
/// </summary>
/// <param name="colRefName">The column name as used in Excel to convert</param>
/// <returns>The 1-based column number e.g. "XFD" will be 16384</returns>
public static Int32 FromBijectiveBase26(String colRefName)
{
var chars = colRefName.ToCharArray();
var result = 0;
var power = 0;
for (var i = chars.Length - 1; i >= 0; i--)
{
result += ((chars[i] - 'A') + 1) * (Int32)Math.Pow(26, power);
power++;
}
return result;
}
/// <summary>
/// Parses an Excel cell ref name into the 1-based row and column numbers
/// </summary>
/// <param name="cellRef">The cell ref name e.g. XFD123</param>
/// <param name="rowNumber">The 1-based row number e.g. XFD123 => 123</param>
/// <param name="columnNumber">The 1-based col number e.g. XFD123 => 16384</param>
/// <returns>true if the cell ref name is valid, false otherwise</returns>
public static Boolean ParseCellRef(String cellRef, out Int32 rowNumber, out Int32 columnNumber)
{
var cellRefLen = cellRef.Length;
if (cellRefLen < 2)
{
rowNumber = columnNumber = -1;
return false;
}
// using reg ex here proved to be too slow hence the hand-rolled parsing
var index = 0;
while (!(cellRef[index] >= 48 && cellRef[index] <= 57)) // fast !isdigit detection
index++;
var colRef = cellRef.Substring(0, index);
var rowNum = cellRef.Substring(index, cellRefLen - index);
columnNumber = ColRefToNum[colRef];
if (columnNumber > MaxCols)
{
rowNumber = columnNumber = -1;
return false;
}
var rowNumParsed = Int32.TryParse(rowNum, out rowNumber);
if (!(rowNumParsed && rowNumber <= MaxRows))
{
rowNumber = columnNumber = -1;
return false;
}
return true;
}
}
↧
↧
New Post: Possible to Group Columns in Pivot Table
Eh, it finally occurred to me I could just add a field to the table, have C# calculate the week date, and use that as the pivot column.
↧
New Post: Bijective base-26
First time I see p-adic numbers being used outside pure mathematics =)
Ran some tests and the results are...
XLHelper.GetColumnLetterFromNumber is slightly better than ToBijectiveBase26.
FromBijectiveBase26 is slightly better than XLHelper.GetColumnNumberFromLetter.
In this case "slightly better" really means "it doesn't matter" because the difference is a whooping 1 second (if that) for every 10 million operations.
Each test ran 10M times.
ToBijectiveBase26:
Test 1 random column (1-26)
Took: 2.2978524 secs
Test 2 random columns (27-702)
Took: 2.9170196 secs
Test 3 random columns (703-16384)
Took: 3.6836017 secs
XLHelper.GetColumnLetterFromNumber:
Test 1 random column (1-26)
Took: 0.8154559 secs
Test 2 random columns (27-702)
Took: 1.2372901 secs
Test 3 random columns (703-16384)
Took: 1.8447462 secs
FromBijectiveBase26:
Test 1 random column (A-Z)
Took: 0.3456822 secs
Test 2 random columns (AA-ZZ)
Took: 0.5361384 secs
Test 3 random columns (AAA-XFD)
Took: 1.1249966 secs
XLHelper.GetColumnNumberFromLetter
Test 1 random column (A-Z)
Took: 1.3690976 secs
Test 2 random columns (AA-ZZ)
Took: 1.5478759 secs
Test 3 random columns (AAA-XFD)
Took: 1.488285 secs
I rewrote your ToBijectiveBase26 function to be more performant:
NEW ToBijectiveBase26:
Test 1 column (1-26)
Took: 0.7168028 secs
Test 2 columns (27-702)
Took: 1.1513819 secs
Test 3 columns (703-16384)
Took: 1.7939328 secs
In the interest of having "the best" we'll use FromBijectiveBase26 and the new ToBijectiveBase26.
Thanks!
Ran some tests and the results are...
XLHelper.GetColumnLetterFromNumber is slightly better than ToBijectiveBase26.
FromBijectiveBase26 is slightly better than XLHelper.GetColumnNumberFromLetter.
In this case "slightly better" really means "it doesn't matter" because the difference is a whooping 1 second (if that) for every 10 million operations.
Each test ran 10M times.
ToBijectiveBase26:
Test 1 random column (1-26)
Took: 2.2978524 secs
Test 2 random columns (27-702)
Took: 2.9170196 secs
Test 3 random columns (703-16384)
Took: 3.6836017 secs
XLHelper.GetColumnLetterFromNumber:
Test 1 random column (1-26)
Took: 0.8154559 secs
Test 2 random columns (27-702)
Took: 1.2372901 secs
Test 3 random columns (703-16384)
Took: 1.8447462 secs
FromBijectiveBase26:
Test 1 random column (A-Z)
Took: 0.3456822 secs
Test 2 random columns (AA-ZZ)
Took: 0.5361384 secs
Test 3 random columns (AAA-XFD)
Took: 1.1249966 secs
XLHelper.GetColumnNumberFromLetter
Test 1 random column (A-Z)
Took: 1.3690976 secs
Test 2 random columns (AA-ZZ)
Took: 1.5478759 secs
Test 3 random columns (AAA-XFD)
Took: 1.488285 secs
I rewrote your ToBijectiveBase26 function to be more performant:
public static String ToBijectiveBase26(Int32 n)
{
var ret = String.Empty;
while (n > 0)
{
--n;
ret = (char)('A' + n % 26) + ret;
n /= 26;
}
return ret;
}
(This stupid editor keeps replacing the plus sign with +)NEW ToBijectiveBase26:
Test 1 column (1-26)
Took: 0.7168028 secs
Test 2 columns (27-702)
Took: 1.1513819 secs
Test 3 columns (703-16384)
Took: 1.7939328 secs
In the interest of having "the best" we'll use FromBijectiveBase26 and the new ToBijectiveBase26.
Thanks!
↧
Created Unassigned: Table Corrupt File (Table in package starts at table2.xml) [9360]
When copying a template excel file to the new location and generating rows from data and then opening the file. I get this message:
[screenshots](http://imgur.com/a/eUFnv)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error122760_01.xml</logFileName><summary>Errors were detected in file 'C:\Users\Jay\NET Projects\Tutor Hours\Tutor Data Tests\bin\Debug\Schedules Export Test.xlsx'</summary><repairedRecords summary="Following is a list of repairs:"><repairedRecord>Repaired Records: Table from /xl/tables/table2.xml part (Table)</repairedRecord></repairedRecords></recoveryLog>
Commit:e5ab70dada340914840ffe8f5635dcf5df138c1e
[screenshots](http://imgur.com/a/eUFnv)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error122760_01.xml</logFileName><summary>Errors were detected in file 'C:\Users\Jay\NET Projects\Tutor Hours\Tutor Data Tests\bin\Debug\Schedules Export Test.xlsx'</summary><repairedRecords summary="Following is a list of repairs:"><repairedRecord>Repaired Records: Table from /xl/tables/table2.xml part (Table)</repairedRecord></repairedRecords></recoveryLog>
Commit:e5ab70dada340914840ffe8f5635dcf5df138c1e
↧
New Post: Bijective base-26
Ran another test and GetColumnNumberFromLetter is actually an order of magnitude faster if you take out the checks that FromBijectiveBase26 doesn't perform...
Test 1 column (A-Z)
Took: 0.0390483 secs
Test 2 columns (AA-ZZ)
Took: 0.0819978 secs
Test 3 columns (AAA-XFD)
Took: 0.1435579 secs
That said, it still falls under the "it doesn't matter" category =)
So we'll keep using GetColumnNumberFromLetter and implement the new ToBijectiveBase26.
Test 1 column (A-Z)
Took: 0.0390483 secs
Test 2 columns (AA-ZZ)
Took: 0.0819978 secs
Test 3 columns (AAA-XFD)
Took: 0.1435579 secs
That said, it still falls under the "it doesn't matter" category =)
So we'll keep using GetColumnNumberFromLetter and implement the new ToBijectiveBase26.
↧
↧
Source code checked in, #47361080d678c9782bb1b90bae6d0bfd2a7add39
Update GetColumnLetterFromNumber function
↧
Commented Unassigned: Table Corrupt File (Table in package starts at table2.xml) [9360]
When copying a template excel file to the new location and generating rows from data and then opening the file. I get this message:
[screenshots](http://imgur.com/a/eUFnv)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error122760_01.xml</logFileName><summary>Errors were detected in file 'C:\Users\Jay\NET Projects\Tutor Hours\Tutor Data Tests\bin\Debug\Schedules Export Test.xlsx'</summary><repairedRecords summary="Following is a list of repairs:"><repairedRecord>Repaired Records: Table from /xl/tables/table2.xml part (Table)</repairedRecord></repairedRecords></recoveryLog>
Commit:e5ab70dada340914840ffe8f5635dcf5df138c1e
Comments: Here is the source template file.
[screenshots](http://imgur.com/a/eUFnv)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error122760_01.xml</logFileName><summary>Errors were detected in file 'C:\Users\Jay\NET Projects\Tutor Hours\Tutor Data Tests\bin\Debug\Schedules Export Test.xlsx'</summary><repairedRecords summary="Following is a list of repairs:"><repairedRecord>Repaired Records: Table from /xl/tables/table2.xml part (Table)</repairedRecord></repairedRecords></recoveryLog>
Commit:e5ab70dada340914840ffe8f5635dcf5df138c1e
Comments: Here is the source template file.
↧
Released: ClosedXML 0.74.0 (Aug 09, 2014)
Many updates. See history.
↧
Created Release: ClosedXML 0.74.0 (Aug 09, 2014)
Many updates. See history.
↧
↧
Commented Unassigned: Problem with Symbols in Text Cells [9359]
I'm experiencing a problem when I assign a text value that contains a symbol in it to a cell.
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: Display language: English (United States) Input Language: same Format: same Location: United States No problem typing symbols or copy pasting them in Excel, saving from Excel to XLSX files and loading them back. The problem is not Excel or the Region settings or Excel. What if I want to use other ASCII characters like the degree sign, etc.? I was using the stable version of ClosedXML. If it is working for you, is it possible this is fixed in the latest build?
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: Display language: English (United States) Input Language: same Format: same Location: United States No problem typing symbols or copy pasting them in Excel, saving from Excel to XLSX files and loading them back. The problem is not Excel or the Region settings or Excel. What if I want to use other ASCII characters like the degree sign, etc.? I was using the stable version of ClosedXML. If it is working for you, is it possible this is fixed in the latest build?
↧
Commented Unassigned: Problem with Symbols in Text Cells [9359]
I'm experiencing a problem when I assign a text value that contains a symbol in it to a cell.
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: Nothing like that was touched but pick up v0.74.0 and see if it helps. If not then attach a project that reproduces it.
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: Nothing like that was touched but pick up v0.74.0 and see if it helps. If not then attach a project that reproduces it.
↧
Commented Unassigned: Problem with Symbols in Text Cells [9359]
I'm experiencing a problem when I assign a text value that contains a symbol in it to a cell.
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: Thank you for your sanity check MDeLeon! I ran simple "¡Hola Mundo!" tests and cannot repeat the problem. However, my main application does not work. My conclusion now is that this is not a ClosedXML problem, but probably a problem with my application. Maybe leave this issue Open a little longer until I solve the problem - in case it is of interest to anyone else experiencing this issue.
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: Thank you for your sanity check MDeLeon! I ran simple "¡Hola Mundo!" tests and cannot repeat the problem. However, my main application does not work. My conclusion now is that this is not a ClosedXML problem, but probably a problem with my application. Maybe leave this issue Open a little longer until I solve the problem - in case it is of interest to anyone else experiencing this issue.
↧
Released: ClosedXML 0.74.0 (Aug 09, 2014)
- Multiple thread safe improvements including
- AdjustToContents
- XLHelper
- XLColor_Static
- IntergerExtensions.ToStringLookup
- Exception now thrown when saving a workbook with no sheets, instead of creating a corrupt workbook
- Fix for hyperlinks with non-ASCII Characters
- Added basic workbook protection
- Fix for error thrown, when a spreadsheet contained comments and images
- Fix to Trim function
- Fix Invalid operation Exception thrown when the formula functions MAX, MIN, and AVG reference an empty cell
- Fix clearing of formats on merged cells
- Fix Null Reference Exception when input workbook does not have a style sheet
↧
↧
Updated Release: ClosedXML 0.74.0 (Aug 09, 2014)
- Multiple thread safe improvements including
- AdjustToContents
- XLHelper
- XLColor_Static
- IntergerExtensions.ToStringLookup
- Exception now thrown when saving a workbook with no sheets, instead of creating a corrupt workbook
- Fix for hyperlinks with non-ASCII Characters
- Added basic workbook protection
- Fix for error thrown, when a spreadsheet contained comments and images
- Fix to Trim function
- Fix Invalid operation Exception thrown when the formula functions MAX, MIN, and AVG reference an empty cell
- Fix clearing of formats on merged cells
- Fix Null Reference Exception when input workbook does not have a style sheet
↧
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: I made some improvements to memory usage that went into build 0.74.0 . Could anyone test and let me know if they are still having the problem?
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: I made some improvements to memory usage that went into build 0.74.0 . Could anyone test and let me know if they are still having the problem?
↧
Commented Unassigned: Problem with Symbols in Text Cells [9359]
I'm experiencing a problem when I assign a text value that contains a symbol in it to a cell.
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: OK to close this issue. I figured out what my problem was. My application read the text from raw text files. It appears that Microsoft .NET StreamReader and TextReader do not handle non-encoded Text files reliably! It appears that others have this problem and some can work around it by specifying various encodings in StreamReader constructor. However, I could not find one that worked. Maybe it would work if I put encoding prefixes in my files. I do not know. My work-around was to use the equivalent to File.ReadAllBytes(...) instead of ReadAllText(...) and then convert the bytes to characters and append the characters to the text for the worksheet cells. This is not a ClosedXML or OpenXML SDK issue! Thanks for your help and great project!!
For example: Cell(1,1).Value = "¡Oy Vey!";
The resulting cell in the worksheet displays a black diamond with a question mark in it where the extended character symbols should be.
When I look at a hex dump of the raw sharedStrings.xml file generated by ClosedXML, I cannot find the "¡" character or 0xA1 in hex in the file. Other extended characters do not work either.
I tried both Cell.Value and SetValue and with and without assigning the DataType to Text. All things I try have the same result.
I am new to ClosedXML, so perhaps there is a setting to enable it to not translate extended characters in text strings assigned to Cell values. I did not find anything related to this in the documentation.
//AJ
Comments: OK to close this issue. I figured out what my problem was. My application read the text from raw text files. It appears that Microsoft .NET StreamReader and TextReader do not handle non-encoded Text files reliably! It appears that others have this problem and some can work around it by specifying various encodings in StreamReader constructor. However, I could not find one that worked. Maybe it would work if I put encoding prefixes in my files. I do not know. My work-around was to use the equivalent to File.ReadAllBytes(...) instead of ReadAllText(...) and then convert the bytes to characters and append the characters to the text for the worksheet cells. This is not a ClosedXML or OpenXML SDK issue! Thanks for your help and great project!!
↧