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

Created Unassigned: EPPlus not reading the complete cell value. [14960]

$
0
0
Hi,

The cell value is always being read as string instead of complete no.

When i enter big value in cell, then excel automatically converts to exponential.

Ex: 1234561234561230 ---> 1.23456E+15

Can you please help reading the original value.

Thanks,
Sanketh

Note: Sample sheet is attached.


Commented Unassigned: Error copying cell styles when copying worksheet to another workbook [14959]

$
0
0
Cell styles are corrupted when copying worksheet to another workbook if the worksheet being copied contains cells with different styles but the same custom number format.

Example attached.

Comments: I am finding this to be the case too - Cell Visibility and NumberFormat are not copied. Is there a style component that goes with the worksheet? I havent looked into the EPPlus code, but find the library enormously useful, so would appreciate this feature as well. Thanks for considering it.

Created Unassigned: Exception Read Cell Text Property [14961]

$
0
0
If a cell is formatted with the custom format "h:mm:ss", reading the Text property of a Cell will cause a System.NullReferenceException exception to be thrown. This is being caused by the following line in ExcelNumberFormatXml.AddBuildIn:

NumberFormats.Add("h:mm:dd", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 21, Format = "h:mm:dd" });

The format should be h:mm:ss, not h:mm:dd.

Edited Unassigned: Read Cell Text Property Exception [14961]

$
0
0
If a cell is formatted with the custom format "h:mm:ss", reading the Text property of a Cell will cause a System.NullReferenceException exception to be thrown. This is being caused by the following line in ExcelNumberFormatXml.AddBuildIn:

NumberFormats.Add("h:mm:dd", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 21, Format = "h:mm:dd" });

The format should be h:mm:ss, not h:mm:dd.

Created Unassigned: Calling worksheet.Cells.AutoFitColumns() corrupts the .xlsx data file [14962]

$
0
0
calling AutoFitColumns(min = 5, max = 50) on all the cells in a worksheet (rather than specifying a particular column or columns), no error occurs, but the .xlsx data file becomes corrupted. Excel is still able to open the file, but an error message occurs during the opening process. If you allow Excel to correct the errors and finish opening the file with auto Fit.

To reproduce, simply execute this line of code:

try to with one cell value with 1000 characters

worksheet.Cells.AutoFitColumns(5,50);

Commented Unassigned: Memory isn't released [14956]

$
0
0
Hi,

I have to generate large (250.000 rows and more) Excel files. It works well, but when I Dispose() The ExcelPackage at the end the memory isn't released. I checked my code and I can't find a "stray" reference or somthing alse that would stop the GC to work.. A call to GC.Collect() doesn't free the memory either .. Does anybody else have this issue? Is there something I am forgetting?

Thanks for your help in advance!!
Comments: Good news: This issue seems to be solved in V4!!!!!

Created Unassigned: calling FirstOrDefault() function hangs forever [14963]

$
0
0
Hi,

What I observed is when first request is still executing the method FirstOrDefault() and second request also tries to execute same method, it hangs foreever :(

__Code:__

using (OfficeOpenXml.ExcelPackage excelFile = new OfficeOpenXml.ExcelPackage(stream))
{
Trace.WriteLineIf(reached here -1");
__ OfficeOpenXml.ExcelWorksheet sheet = excelFile.Workbook.Worksheets.FirstOrDefault();__
Trace.WriteLineIf("reached here -1");

................................
..................................
}

It is an ASP.NET web application and Framework 4.0 and EPPLUS ver 3.1.3.
Anyone ever faced this or have an idea how to get this working ? Thanks.

Created Unassigned: calling FirstOrDefault() function hangs forever [14964]

$
0
0
Hi,

What I observed is when first request is still executing the method FirstOrDefault() and second request also tries to execute same method, it hangs foreever :(

__Code:__

using (OfficeOpenXml.ExcelPackage excelFile = new OfficeOpenXml.ExcelPackage(stream))
{
Trace.WriteLineIf(reached here -1");
OfficeOpenXml.ExcelWorksheet sheet = excelFile.Workbook.Worksheets.FirstOrDefault();
Trace.WriteLineIf("reached here -1");

................................
..................................
}


Also tried using
OfficeOpenXml.ExcelWorksheet sheet = excelFile.Workbook.Worksheets[1]
but still not working.

It is an ASP.NET web application and Framework 4.0 and EPPLUS ver 3.1.3.
Anyone ever faced this or have an idea how to get this working ? Thanks.

Commented Unassigned: Repaired Records: Worksheet properties from /xl/workbook.xml part [14872]

$
0
0
When I create spreadsheet with many worksheets via my site using EPPlus, I get the following error:

Excel found unreadable content in ViewData2023_all.xlsx Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes.

Then I get the Repairs popup, and when I open up the log file I see:

<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error094560_01.xml</logFileName><summary>Errors were detected in file 'C:\Users\xxx\Downloads\ViewData2023_all.xlsx'</summary>-<repairedRecords summary="Following is a list of repairs:"><repairedRecord>Repaired Records: Worksheet properties from /xl/workbook.xml part (Workbook)</repairedRecord></repairedRecords></recoveryLog>

Here is a sample of the code:
using (ExcelPackage package = new ExcelPackage())
{
foreach (Install install in Installs)
{
DataWorksheet dwtest = BuildDataWorksheet(site1ID_int, install.InstallID.ToString(), StartDate, EndDate);
if (dwtest.DataRecords.Count > 0)
{

string worksheetName = dwtest.Name;

ExcelWorksheet ws = package.Workbook.Worksheets.Add(worksheetName);

int chssz = dwtest.ColumnHeaders.Count;

int worksheet_col = 0;
int worksheet_row = 0;
for (int hdr_col = 1; hdr_col <= dwtest.ColumnHeaders.Count; hdr_col++)
{
worksheet_col = hdr_col - 1;
ws.Cells[1, hdr_col].Value = dwtest.ColumnHeaders[worksheet_col];
}

for (int cell_row = 2; cell_row <= (dwtest.DataRecords.Count + 1); cell_row++)
{
worksheet_row = cell_row - 2;
for (int cell_column = 1; cell_column <= dwtest.DataRecords[worksheet_row].CellValues.Count; cell_column++)
{
worksheet_col = cell_column - 1;
ws.Cells[cell_row, cell_column].Value = dwtest.DataRecords[worksheet_row].CellValues[worksheet_col];
}
}
} // end of if DataWorksheet has DataRecords
} // end of foreach

var stream = new MemoryStream();
package.SaveAs(stream);

string fileName = "ViewData.xlsx";
string contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";

stream.Position = 0;
return File(stream, contentType, fileName);
}
}

Note:
- when I open in Excel and resave the spreadsheet is fine
- when I create a spreadsheet with one worksheet, the spreadsheet is fine

Thanks!
Comments: Hi! Try this final code: In web page, try this: Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" Response.AddHeader("content-disposition", "attachment; filename=your_file_name.xlsx") Response.BinaryWrite(package.GetAsByteArray()) Response.End() The last row is VERY IMPORTANT !!! Antonio, Roma Italia

Created Unassigned: Impossible to save changes on-fly [14965]

$
0
0
Good product, but there is a big problem - it is impossible to save changes in file if it is opened in Excel.
So you can not track changes online, when file in opened in Excel.
Or there is a some way to archive my goal?

Commented Unassigned: Impossible to save changes on-fly [14965]

$
0
0
Good product, but there is a big problem - it is impossible to save changes in file if it is opened in Excel.
So you can not track changes online, when file in opened in Excel.
Or there is a some way to archive my goal?
Comments: That is a result of how excel works with file, not epplus. What changes are you attempting to track?

Commented Unassigned: Impossible to save changes on-fly [14965]

$
0
0
Good product, but there is a big problem - it is impossible to save changes in file if it is opened in Excel.
So you can not track changes online, when file in opened in Excel.
Or there is a some way to archive my goal?
Comments: No, standard .NET Office Automation allows to change files on-fly. I want to track any changes (for example to see new added data row). Now I can't call Save method on opened in Excel file (it fires exception) and there is no other method like Flash() to flash new data.

Commented Unassigned: Impossible to save changes on-fly [14965]

$
0
0
Good product, but there is a big problem - it is impossible to save changes in file if it is opened in Excel.
So you can not track changes online, when file in opened in Excel.
Or there is a some way to archive my goal?
Comments: If you want to track changes, I would suggest embedding timestamps in your data, because there is nothing that epplus can do to force excel to allow it to save to a file that excel has open already.

Created Unassigned: Loading/Saving xlsx from SSRS corrupts styling in Beta 4.0 [14966]

$
0
0
FOA, thank you for this great piece of work!
We would like to use it with our services, that consume xlsx-files exported by MS Reporting Server 2012.
In case of simply loading and saving such a file like:
```
using (var package = new ExcelPackage(new FileInfo(@"FileFromReportingServer2012.xlsx")))
package.SaveAs(new FileInfo("Corrupted.xlsx"));
```
the styling seems to be corrupted (see corrupted.png).
however, if I open and save the file with Excel in advance, it works.

Commented Unassigned: When Excel workbook contains an invalid date, EPPlus raises the Exception invalid OleAut date. [14898]

$
0
0
Hello,

When i try to open a excel file which contains a cell containing an invalid date, Excel displays it with ####### into the cell and 3778816,1688361 into the edit bar. But when I try to open the file with EPPlus, it raises an exception invalid OleAut date.

You will find an excel invalid file as attachments, and the following code can correct the issue. (it modifies the ExcelWorksheet class)

You can chekced that here : [http://msdn.microsoft.com/fr-fr/library/system.datetime.fromoadate.aspx](http://msdn.microsoft.com/fr-fr/library/system.datetime.fromoadate.aspx)

```
private object GetValueFromXml(ExcelCell cell, XmlTextReader xr)
{
object value;

//XmlNode vnode = colNode.SelectSingleNode("d:v", NameSpaceManager);
//if (vnode == null) return null;

if (cell.DataType == "s")
{
int ix = xr.ReadElementContentAsInt();
value = _package.Workbook._sharedStringsList[ix].Text;
cell.IsRichText = _package.Workbook._sharedStringsList[ix].isRichText;
}
else if (cell.DataType == "str")
{
value = xr.ReadElementContentAsString();
}
else if (cell.DataType == "b")
{
value = (xr.ReadElementContentAsString() != "0");
}
else
{
int n = cell.Style.Numberformat.NumFmtID;
string v = xr.ReadElementContentAsString();

if ((n >= 14 && n <= 22) || (n >= 45 && n <= 47))
{
double res;
if (double.TryParse(v, NumberStyles.Any, CultureInfo.InvariantCulture, out res))
{
if (res >= -657435.0 && res < 2958465)
value = DateTime.FromOADate(res);
else
value = "";
}
else
{
value = "";
}
}
else
{
double d;
if (double.TryParse(v, NumberStyles.Any, CultureInfo.InvariantCulture, out d))
{
value = d;
}
else
{
value = double.NaN;
}
}
}
return value;
}
```
Regards, and thanks for this excellent component !
Comments: No way to get any worksheet if there's an invalid date on any cell, since getting package.Workbook.Worksheets will throw the exception. Would be a nice fix!

Commented Issue: GetValue() returns default value in case of not able to convert to destination type [14724]

$
0
0
I have a cell with the value of type string and text "hello". I then tried to .GetValue<DateTime>() and it returns the default value of DateTime. The same with .GetValue<int>() and 0 (zero).

I expect to receive an exception, because with this behaviour I can not surely eliminate "bad" conversion errors. I read many values out of hand-made excel sheets and it's possible, that hand-made errors exist (du to input mistakes, etc.).
Comments: While this is annoying, and there could be some better options with the GetValue(of T), I think this is pretty standard in .Net - especially with dates. Since Date is not a nullable value, you'll always wind up comparing it with Date.MinValue to see if the default date was returned.

Created Unassigned: Closing workbook created using ExcelPackage.SaveAs shows save dialog [14967]

$
0
0
Steps to reproduce:
1. Create a workbook with multiple worksheets (at least 2 worksheets).
2. Use formulae in worksheets. Also, reference cells from other worksheets.
3. Call ExcelPackage.SaveAs to save the file. In my case, I used the overload with the Stream parameter.
4. Open the excel file created (without doing any editing).
5. Close the file.

Dialog 'Do you want to save the changes you made to 'workbook.xlsx'?' appears. But as described in the steps, there are really no changes made.

My question is how do I generate an excel workbook without showing that dialog? TIA

Created Unassigned: Calculate() throws an exception [14968]

$
0
0
The attached file contains two formulas:
1. a simple INDIRECT formula in a cell
2. an unsupported OFFSET formula in a "defined name" (dynamic named range)

An unhandled exception is thrown when the document is opened with EPPlus 4.0 beta when the Calculate() method is executed.
excelPackage.Workbook.Calculate();

Created Unassigned: Collapsed columns are shown when copying worksheet [14969]

$
0
0
When copying worksheet with collapsed column, in the copy the column is not collapsed.
Example attached.

Commented Issue: Issue while reading xSeries of excel chart [13128]

$
0
0
The excel file was created in office 2010, but the value of xSeries cannot be read correctly(empty) through EPPlus. Here is the inner xml for ExcelChartSerie:
<c:grouping val="standard" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" />
<c:varyColors val="0" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" />
<c:ser xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart">
<c:idx val="0" />
<c:order val="0" />
<c:marker>
<c:symbol val="none" />
</c:marker>
<c:cat>
<c:strRef>
<c:f>Sheet1!$B$2</c:f>
<c:strCache>
<c:ptCount val="1" />
<c:pt idx="0">
<c:v>$$student.Age</c:v>
</c:pt>
</c:strCache>
</c:strRef>
</c:cat>
<c:val>
<c:numRef>
<c:f>Sheet1!$F$2</c:f>
<c:numCache>
<c:formatCode>"¥"#,##0.00_);[Red]\("¥"#,##0.00\)</c:formatCode>
<c:ptCount val="1" />
<c:pt idx="0">
<c:v>0</c:v>
</c:pt>
</c:numCache>
</c:numRef>
</c:val>
<c:smooth val="0" />
</c:ser>
<c:dLbls xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart">
<c:showLegendKey val="0" />
<c:showVal val="0" />
<c:showCatName val="0" />
<c:showSerName val="0" />
<c:showPercent val="0" />
<c:showBubbleSize val="0" />
</c:dLbls>
<c:marker val="1" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" />
<c:smooth val="0" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" />
<c:axId val="25110784" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" />
<c:axId val="43503616" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" />

And later I found the issue is in the constructor of ExcelChartSerie. The private field _xSeriesPath should be assigned with "{0}/c:strRef/c:f" instead of "{0}/c:numRef/c:f".
Comments: This problem still exists. Any idea on when it would be fixed?
Viewing all 2262 articles
Browse latest View live


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