Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all 2262 articles
Browse latest View live

Commented Unassigned: Could not load file or assembly EPPlus, Version=4.0.0.0 [15011]

$
0
0
Greetings!

I try to run an executable, but get the following error:

![Image](http://s57.radikal.ru/i158/1405/ce/cf1986c81d73.png)

What is missing and how can I fix it without source code?

Thank you!
Comments: It works with your build! Thank you!

Commented Unassigned: ExcelRange LoadFromText issue with multiline cell value [15015]

$
0
0
When loading a csv file to a worksheet, if any one cell value in csv is multiline, and happens to use the same EOL character, an error will be thrown.

This is happening because of the split by EOL character.

Attached file for test, second line contains a EOL character in the first value. LoadFromText will split the second line, and be unable to process it.
Comments: Here is a proposed fix for this issue: https://epplus.codeplex.com/SourceControl/network/forks/costea32/EPPlusBug15015/contribution/6911

Commented Unassigned: Huge Memory Leaks in Library [14878]

$
0
0
Hello,

Thanks for the Great Library.

But after some usage i have found huge Memory Leaks.
Currently my purpose is to read a Huge file and process it.

But Performance was very bad even after All Reading was completed.

After Analysis using ANTS Memory Profiler i found huge memory leaks.
The Chart is as Below was taken after reading was completed.

![Image](http://img818.imageshack.us/img818/2493/2r67.png)

![Image](http://img543.imageshack.us/img543/9109/p5p.png)
Comments: I too am having issues with what seems to be a memory leak. I am trying to import cells from a variety of sources using the LoadFromCollection<T> and LoadFromText functions on the worksheet object. I tried to load approximately 230,000 rows by 25 columns. (Mostly financial data with a few short descriptions). Memory climbed at an alarming rate eventually topping out at around 8GB. It eventually completed and save the file, which turned out to be a 45Mb xlxs file. I loaded the file in Excel and it all looked good, Excel uses about 220Mb of memory to display the file. I then created a simple application to load the same file into an ExcelPackage object, and to my surprise it only consumed 245mb from an 8Mb initial memory commit for the sample application. I have tried to batch load the rows including creating and disposing of the EPPlus objects but this had no effect. Shame really since it looks like it is a fantastic library.

Commented Unassigned: Huge Memory Leaks in Library [14878]

$
0
0
Hello,

Thanks for the Great Library.

But after some usage i have found huge Memory Leaks.
Currently my purpose is to read a Huge file and process it.

But Performance was very bad even after All Reading was completed.

After Analysis using ANTS Memory Profiler i found huge memory leaks.
The Chart is as Below was taken after reading was completed.

![Image](http://img818.imageshack.us/img818/2493/2r67.png)

![Image](http://img543.imageshack.us/img543/9109/p5p.png)
Comments: Just updated to the V4 beta and memory use seems to be improved but it is still an unworkable solution at over 5GB of memory commit for the file described above. (an improvement from the 8GB in V3.1.3)

Created Unassigned: COUNT.IF Formula Error [15016]

$
0
0
Hi guys!!!!

Thanks for this fantastic library!!!! I have a problem with a count.if formula. When I try to create the following formula, excel detects an error an removes the formula

=CONTAR.SI('Casos de Test Fallidos'!C3:C1002;"*-*")

Another problem I've found occurs when I add an Hyperlink on an excel created from a template, the value inserted on the same cell is removed.

Any idea???

Thanks again.

Created Unassigned: System.IO.FileNotFoundException when trying to save big xlsx. [15017]

$
0
0
Hi,

I have problem with saving 3,5 MB file. It has 16383 columns and 2006 rows.
Here is my code:

```
//some data generation - List<Data> results;
using (ExcelPackage package = new ExcelPackage())
{
ExcelWorksheet sheet = package.Workbook.Worksheets.Add("Data");
int column = 1;
int row = 1;
foreach (Data data in results)
{
sheet.Cells[row, column++].Value = data.Some1;
sheet.Cells[row, column++].Value = data.Some2;
...
sheet.Cells[row, column++].Value = data.Some16383;
row++;
column = 1;
}

package.SaveAs(new FileInfo(@"D:\out.xlsx"));
}
```

In last line when I'm trying to save my xlsx I'm getting this error:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

Additional information: Nie można odnaleźć pliku 'C:\Users\Dominik\AppData\Local\IsolatedStorage\ysknheu1.uqd\idmw3yqn.k3c\Url.l53e0nslgq3rtqq2mtbkxyqqpkaswth0\Publisher.qolcwimjscmc2r1axln3vci10dth4a4y\Files\25hyrr40.puy'.

But when I change my foreach statement to:
```
foreach (Data data in results.Take(500))
```

Everythink works. Any solution?

Edited Unassigned: System.IO.FileNotFoundException when trying to save big xlsx. [15017]

$
0
0
Hi,

I have problem with saving 3,5 MB file. It has 16383 columns and 2006 rows.
Here is my code:

```
//some data generation - List<Data> results;
using (ExcelPackage package = new ExcelPackage())
{
ExcelWorksheet sheet = package.Workbook.Worksheets.Add("Data");
int column = 1;
int row = 1;
foreach (Data data in results)
{
sheet.Cells[row, column++].Value = data.Some1;
sheet.Cells[row, column++].Value = data.Some2;
...
sheet.Cells[row, column++].Value = data.Some16383;
row++;
column = 1;
}

package.SaveAs(new FileInfo(@"D:\out.xlsx"));
}
```

In last line when I'm trying to save my xlsx I'm getting this error:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

Additional information: Cannot find specified file. 'C:\Users\Home\AppData\Local\IsolatedStorage\ysknheu1.uqd\idmw3yqn.k3c\Url.l53e0nslgq3rtqq2mtbkxyqqpkaswth0\Publisher.qolcwimjscmc2r1axln3vci10dth4a4y\Files\25hyrr40.puy'.

But when I change my foreach statement to:
```
foreach (Data data in results.Take(500))
```

Everythink works. Any solution?

Edited Unassigned: System.IO.FileNotFoundException when trying to save big xlsx. [15017]

$
0
0
Hi,

I have problem with saving 3,5 MB file. It has 16383 columns and 2006 rows.
Here is my code:

```
//some data generation - List<Data> results;
using (ExcelPackage package = new ExcelPackage())
{
ExcelWorksheet sheet = package.Workbook.Worksheets.Add("Data");
int column = 1;
int row = 1;
foreach (Data data in results)
{
sheet.Cells[row, column++].Value = data.Some1;
sheet.Cells[row, column++].Value = data.Some2;
...
sheet.Cells[row, column++].Value = data.Some16383;
row++;
column = 1;
}

package.SaveAs(new FileInfo(@"D:\out.xlsx"));
}
```

In last line when I'm trying to save my xlsx I'm getting this error:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

Additional information: Cannot find specified file. 'C:\Users\Home\AppData\Local\IsolatedStorage\ysknheu1.uqd\idmw3yqn.k3c\Url.l53e0nslgq3rtqq2mtbkxyqqpkaswth0\Publisher.qolcwimjscmc2r1axln3vci10dth4a4y\Files\25hyrr40.puy'.

But when I change my foreach statement to:
```
foreach (Data data in results.Take(500))
```

Everything works. Any solution?

Created Unassigned: ColumnMax can not span over existing column 3. Exception when styling empty cell [15018]

$
0
0
Hello, I encountered above exception when - under certain circumstances - I try to access the style of an ExcelRange. Below you find a minimal self-contained program that reproduces the issue, when using EPPlus 4.0 Beta 2. This issue does not occur with the current stable 3.x version of EPPlus.

The program generates two excel files. In the first case the data block contains 4x4 cols/rows of data and everything works fine. The second time it tries to generate a file with 25x25 blocks. This time I encounter above issue. The issue can be worked around by assigning some value to the Value-property of the Range before accessing its style property.

```
using System.IO;
using OfficeOpenXml;
using OfficeOpenXml.Style;

namespace ConsoleApplication10
{
class Program
{
static void Main()
{
CreateXlsxSheet("test4.xlsx", 4, 4);
CreateXlsxSheet("test25.xlsx", 25, 25);
}

private static void CreateXlsxSheet(string pFileName,int pRows,int pColumns)
{
if(File.Exists(pFileName))
{
File.Delete(pFileName);
}

using(ExcelPackage excelPackage = new ExcelPackage(new FileInfo(pFileName)))
{
ExcelWorksheet excelWorksheet = excelPackage.Workbook.Worksheets.Add("Testsheet");

// Fill with data
for (int row = 1; row <= pRows; row++)
{
for (int column = 1; column <= pColumns; column++)
{
if (column > 1 && row > 2)
{
using (ExcelRange range = excelWorksheet.Cells[row, column])
{
range.Style.Numberformat.Format = "0";
range.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
range.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
}
excelWorksheet.Cells[row, column].Value = row*column;
}
}
}

// Try to style the first column, begining with row 3 which has no content yet...
using (ExcelRange range = excelWorksheet.Cells[ExcelCellBase.GetAddress(3, 1, pRows, 1)])
{
ExcelStyle style = range.Style;
}

// now I would add data to the first column (left out here)...
excelPackage.Save();
}
}
}
}

```

Edited Unassigned: ColumnMax can not span over existing column 3. Exception when styling empty cell [15018]

$
0
0
Hello, I encountered above exception when - under certain circumstances - I try to access the style of an ExcelRange. Below you find a minimal self-contained program that reproduces the issue, when using EPPlus 4.0 Beta 2. This issue does not occur with the current stable 3.x version of EPPlus.

The program generates two excel files. In the first case the data block contains 4x4 cols/rows of data and everything works fine. The second time it tries to generate a file with 25x25 blocks. This time I encounter above issue. The issue can be worked around by assigning some value to the Value-property of the Range before accessing its style property.

```
using System.IO;
using OfficeOpenXml;
using OfficeOpenXml.Style;

namespace ConsoleApplication10 {
class Program {
static void Main() {
CreateXlsxSheet("test4.xlsx", 4, 4);
CreateXlsxSheet("test25.xlsx", 25, 25); }

private static void CreateXlsxSheet(string pFileName,int pRows,int pColumns) {
if(File.Exists(pFileName)) File.Delete(pFileName);

using(ExcelPackage excelPackage = new ExcelPackage(new FileInfo(pFileName))) {
ExcelWorksheet excelWorksheet = excelPackage.Workbook.Worksheets.Add("Testsheet");

// Fill with data
for (int row = 1; row <= pRows; row++) {
for (int column = 1; column <= pColumns; column++) {
if (column > 1 && row > 2) {
using (ExcelRange range = excelWorksheet.Cells[row, column]) {
range.Style.Numberformat.Format = "0";
range.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
range.Style.VerticalAlignment = ExcelVerticalAlignment.Center; }
excelWorksheet.Cells[row, column].Value = row*column; } } }

// Try to style the first column, begining with row 3 which has no content yet...
using (ExcelRange range = excelWorksheet.Cells[ExcelCellBase.GetAddress(3, 1, pRows, 1)]) {
ExcelStyle style = range.Style; }

// now I would add data to the first column (left out here)...
excelPackage.Save(); } } } }
```

Edited Unassigned: ColumnMax can not span over existing column 3. Exception when accessing Style of empty ExcelRange [15018]

$
0
0
Hello, I encountered above exception when - under certain circumstances - I try to access the style of an ExcelRange. Below you find a minimal self-contained program that reproduces the issue, when using EPPlus 4.0 Beta 2. This issue does not occur with the current stable 3.x version of EPPlus.

The program generates two excel files. In the first case the data block contains 4x4 cols/rows of data and everything works fine. The second time it tries to generate a file with 25x25 blocks. This time I encounter above issue. The issue can be worked around by assigning some value to the Value-property of the Range before accessing its style property.

```
using System.IO;
using OfficeOpenXml;
using OfficeOpenXml.Style;

namespace ConsoleApplication10 {
class Program {
static void Main() {
CreateXlsxSheet("test4.xlsx", 4, 4);
CreateXlsxSheet("test25.xlsx", 25, 25); }

private static void CreateXlsxSheet(string pFileName,int pRows,int pColumns) {
if(File.Exists(pFileName)) File.Delete(pFileName);

using(ExcelPackage excelPackage = new ExcelPackage(new FileInfo(pFileName))) {
ExcelWorksheet excelWorksheet = excelPackage.Workbook.Worksheets.Add("Testsheet");

// Fill with data
for (int row = 1; row <= pRows; row++) {
for (int column = 1; column <= pColumns; column++) {
if (column > 1 && row > 2) {
using (ExcelRange range = excelWorksheet.Cells[row, column]) {
range.Style.Numberformat.Format = "0";
range.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
range.Style.VerticalAlignment = ExcelVerticalAlignment.Center; }
excelWorksheet.Cells[row, column].Value = row*column; } } }

// Try to style the first column, begining with row 3 which has no content yet...
using (ExcelRange range = excelWorksheet.Cells[ExcelCellBase.GetAddress(3, 1, pRows, 1)]) {
ExcelStyle style = range.Style; }

// now I would add data to the first column (left out here)...
excelPackage.Save(); } } } }
```

Created Unassigned: Index was out of range. Must be non-negative and less than the size of the collection. After call to GetAsByteArray() [15019]

$
0
0
I'm using EPplus to edit excel (xlsx) files
But there is error when i try to edit 2 files.
Error disappeares when i copy data from sheet to another sheet, but i can't understand what is the cause

public FileInfo ApplyChanges(string path, string sheetName, RowChange change)
{
ExcelPackage package;
using (var ms = new System.IO.MemoryStream(_fileProvider.Download(path)))
{
package = new ExcelPackage(ms);
}
var fileInfo = _fileProvider.GetFileInfo(path);
var excelSheet = package.Workbook.Worksheets[sheetName];
foreach (var columnChange in change.ColumnChanges)
excelSheet.Cells[change.RowId, columnChange.ColumnId].Value = columnChange.Value;
_fileProvider.Upload(fileInfo.Path, fileInfo.Name, package.GetAsByteArray());
fileInfo = _fileProvider.GetFileInfo(fileInfo.Path);
return FileInfo.Copy(fileInfo);
}

Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source=mscorlib

stack trace

at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at OfficeOpenXml.ExcelStyleCollection`1.get_Item(Int32 PositionID)
at OfficeOpenXml.ExcelStyles.RemoveUnusedStyles()
at OfficeOpenXml.ExcelStyles.UpdateXml()
at OfficeOpenXml.ExcelWorkbook.Save()
at OfficeOpenXml.ExcelPackage.GetAsByteArray(Boolean save)
at OfficeOpenXml.ExcelPackage.GetAsByteArray()
at TableViewer.BL.ExcelWrappers.ExcelDocumentProvider.ApplyChanges(String path, String sheetName, RowChange change) in c:\Users\yakunina\Desktop\tableviewer\TableViewer.BL\ExcelWrappers\ExcelDocumentProvider.cs:line 81
at TableViewer.BL.SheetProvider.UpdateRemoteAndLocal(BLSheet sheet, Int32 dbSheetId, RowChange rowChange) in c:\Users\yakunina\Desktop\tableviewer\TableViewer.BL\UnifiedSheetProvider\SheetProvider.cs:line 145
at TableViewer.BL.SheetProvider.Update(Int32 id, RowChange rowChange) in c:\Users\yakunina\Desktop\tableviewer\TableViewer.BL\UnifiedSheetProvider\SheetProvider.cs:line 134
at TableViewer.WebService.Controllers.DatasForColumnController.Post(ChangesDTO changes) in c:\Users\yakunina\Desktop\tableviewer\TableViewer.WebService\Controllers\DatasForColumnController.cs:line 73
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClassf.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4()
at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)

Created Unassigned: Error while copying worksheet [15020]

$
0
0
hi,
i am trying to copy worksheet from one package to another, the copy was successful but when i open the new file i get message that says that excel found unreadable content in the new file and ask me if i want to recover, the recover fix the problem but i still need to avoid this message.
here is my code:
```
using (ExcelPackage pck = new ExcelPackage(ConfigFile))
{
using (ExcelPackage NewPackage = new ExcelPackage(NewFile))
{
ExcelWorksheet PreSheet = pck.Workbook.Worksheets["Pre"];
ExcelWorksheet NewSheet = NewPackage.Workbook.Worksheets.Add("New", PreSheet);
NewPackage.Save();
}
}
```
how can i fix this issue?
thanks.

Created Unassigned: Fill Color Has No RGB value [15021]

$
0
0
Hello,
I'm using EPPlus to import Excel schedules into Autodesk Revit Architecture but am having a problem with the cell's background fill color. I extract the color like so:

```
ExcelStyle style = sheet.Cells[cellAddress].Style;
ExcelFill fill = style.Fill;
ExcelColor bColor = fill.BackgroundColor;
string rgb = bColor.Rgb;

```
But for some reason the rgb is always "" and doesn't have a value even if the cell does have a colored fill background. Also, no matter what the color of the cell, the ExcelColor.Indexed Property is always -2147483648. Is it because I'm opening an Excel 2013 file? Thanks in advance.

Created Unassigned: AutoFitColumns nullref error on empty sheet [15022]

$
0
0
It seems like AutoFitColumns throws a nullref error on an empty sheet, or possibly a sheet with a single empty cell.

Commented Issue: Named table address reference with a special column leads to Exception [14779]

$
0
0
Attached is a workbook in which I created a small named table called "Tabelle1".
Now I want to use the column "Key" for a drop-down-validation. To achieve this I added a defined name "AllKeys" with formula "=Tabelle1[Key]" which is a valid formula in Excel (from the table the column with this name will be used). And in data validation I inserted the formula "=AllKeys".

If I open and save this Workbook with EPPlus, an InvalidOperationException with InnerException of text "Invalid Address format TABELLE1[KEY]". This exception is thrown in ExcelCellBase.GetRowCol(...).
Comments: I am also using a named range to do data validation. The EPPlus DLL can generate Excel files with named ranges defined by referencing a column of a table, but will throw an Exception when trying to read these files. Microsoft Excel itself can of course read these files just fine.

Created Unassigned: Cell with @ at the end [15023]

$
0
0
Hi

I have a cell with @ at the end. When I open this excel sheet using EPPLus it crashes as it is trying to create as a hyperlink (which is not).


at System.Uri.CreateHostStringHelper(String str, UInt16 idx, UInt16 end, Flags& flags, String& scopeId)
at System.Uri.CreateHostString()
at System.Uri.EnsureHostString(Boolean allowDnsOptimization)
at System.Uri.GetComponentsHelper(UriComponents uriComponents, UriFormat uriFormat)
at System.Uri.GetComponents(UriComponents components, UriFormat format)
at System.Uri.get_AbsoluteUri()
at OfficeOpenXml.ExcelWorksheet.LoadHyperLinks(XmlTextReader xr) in C:\Files\GIT\DataSure_Integration\DataSure\DataSure\EPPlus 4.0\ExcelWorksheet.cs:line 948
at OfficeOpenXml.ExcelWorksheet.CreateXml() in C:\Files\GIT\DataSure_Integration\DataSure\DataSure\EPPlus 4.0\ExcelWorksheet.cs:line 694
at OfficeOpenXml.ExcelWorksheet..ctor(XmlNamespaceManager ns, ExcelPackage excelPackage, String relID, Uri uriWorksheet, String sheetName, Int32 sheetID, Int32 positionID, eWorkSheetHidden hide) in C:\Files\GIT\DataSure_Integration\DataSure\DataSure\EPPlus 4.0\ExcelWorksheet.cs:line 269
at OfficeOpenXml.ExcelWorksheets..ctor(ExcelPackage pck, XmlNamespaceManager nsm, XmlNode topNode) in C:\Files\GIT\DataSure_Integration\DataSure\DataSure\EPPlus 4.0\ExcelWorksheets.cs:line 90
at OfficeOpenXml.ExcelWorkbook.get_Worksheets() in C:\Files\GIT\DataSure_Integration\DataSure\DataSure\EPPlus 4.0\ExcelWorkbook.cs:line 275

Created Unassigned: Trimming String Literals In FormulaParsing [15024]

$
0
0
Hello,

When trying to parse a formula such as =FIND(" ","FirstName LastName") it fails because OfficeOpenXml.FormulaParsing.LexicalAnalysis.TokenizerAnalysis.CurrentTokenHasValue trims the string literal " " and thinks the token doesn't have a value.

Commented Unassigned: Trimming String Literals In FormulaParsing [15024]

$
0
0
Hello,

When trying to parse a formula such as =FIND(" ","FirstName LastName") it fails because OfficeOpenXml.FormulaParsing.LexicalAnalysis.TokenizerAnalysis.CurrentTokenHasValue trims the string literal " " and thinks the token doesn't have a value.
Comments: Perhaps it should be changed from ``` public bool CurrentTokenHasValue { get { return !string.IsNullOrEmpty(CurrentToken.Trim()); } } ``` to ``` public bool CurrentTokenHasValue { get { return !string.IsNullOrEmpty((IsInString) ? CurrentToken : CurrentToken.Trim()); } } ```

Commented Unassigned: Trimming String Literals In FormulaParsing [15024]

$
0
0
Hello,

When trying to parse a formula such as =FIND(" ","FirstName LastName") it fails because OfficeOpenXml.FormulaParsing.LexicalAnalysis.TokenizerAnalysis.CurrentTokenHasValue trims the string literal " " and thinks the token doesn't have a value.
Comments: In addition I had to change the OfficeOpenXml.FormulaParsing.LexicalAnalysis.SourceCodeTokenizer.Tokenize method from ``` if (tokenSeparator.TokenType == TokenType.String) { if (context.LastToken != null && context.LastToken.TokenType == TokenType.OpeningEnumerable) { context.AppendToCurrentToken(c); context.ToggleIsInString(); continue; } else if (context.LastToken != null && context.LastToken.TokenType == TokenType.String && !context.CurrentTokenHasValue) //Added check for enumartion { // We are dealing with an empty string (''). context.AddToken(new Token(string.Empty, TokenType.StringContent)); } context.ToggleIsInString(); } ``` to ``` if (tokenSeparator.TokenType == TokenType.String) { if (context.LastToken != null && context.LastToken.TokenType == TokenType.OpeningEnumerable) { context.AppendToCurrentToken(c); context.ToggleIsInString(); continue; } else if (context.LastToken != null && context.LastToken.TokenType == TokenType.String) { if (!context.CurrentTokenHasValue) //Added check for enumartion { // We are dealing with an empty string (''). context.AddToken(new Token(string.Empty, TokenType.StringContent)); } else { context.ToggleIsInString(); context.AddToken(CreateToken(context, worksheet)); context.AddToken(tokenSeparator); context.NewToken(); continue; } } context.ToggleIsInString(); } ``` This worked for me but it's not as generic as the rest of the function.
Viewing all 2262 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>