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

Commented Issue: Can't add comment with excel2013 and vs2010. [14835]

$
0
0
Here's my code:
var comment = xlSheet.Cells[iDataRow, iCol].AddComment(sb4info.ToString(), "Dean");

After that, I opened the excel file. And then there's an error msg:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error082960_01.xml</logFileName><summary>Errors were detected in file 'C:\AAAAAAA\CDS\TestLDSS\CDS_LDSS_V_2.2.1ALL.xlsx'</summary><repairedRecords summary="Following is a list of repairs:"><repairedRecord>Repaired Records: Comments from /xl/comments2.xml part (Comments)</repairedRecord></repairedRecords></recoveryLog>
Comments: did you have any solution ?

Created Unassigned: Refernce formulas [14941]

$
0
0
When I use a stored procedure to fetch data into a data set table containing a formula in one column and load the data into excel file from a specified row using LoadFromDataTable method, the formula column displays just the formula and not the value calculated using the formula. What settings I need to use for the cell to display the value using the formula in that column which is fetched from the stored procedure ???

Edited Unassigned: Refernce formulas [14941]

$
0
0
When I use a stored procedure to fetch data into a data set table containing a formula in one column and load the data into excel file from a specified row position using LoadFromDataTable method, the formula column displays just the formula and not the value calculated using the formula. What settings I need to use for the cell to display the value using the formula in that column which is fetched from the stored procedure ???

Created Unassigned: ExcelPackage Write + System.OutOfMemoryException [14942]

$
0
0
Hi,

We have been using EPPlus version 3.1.3.0 successfully quite for some time now. Thank you for this wonderful functionality. We used to have a 64 bit Win XP machine with a 8 GB RAM. It was indeed very satisfactory at that point. But now we are limited with 32 bit Win 7 machine with 3.39 GB usable RAM.
This limitation has also affected our tool functionality as well. We are getting the following error for quite some time now.

Exception Details : System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

While we check the file we found despite raising the error the file has been filled with all the records properly. ( approx 10 Lacs + record).

We have also monitored the program execution and found out that this error comes while it reads from c:\pagefile.sys and writes to the concerned excel file <filepath>.

Memory consumed during this time is almost full. ( only 6-100 MB is Free). We are very much limited with the Memory increment ( from 4 gb to 8 gb and 32 bit to going back to 64 bit again ). Could you please suggest if there is any other way to resolve this issue.

I have mentioned below the code we are using,

Calling Block :

try
{
Writer objWriter = new Writer();
objWriter.exportExcel(dataDump, full_file_name);

dataDump.Clear();
dataDump.Reset();
}
catch (Exception ex)
{
dataDump.Clear();
dataDump.Reset();
string logfileName = dr["SHEET_NAME"].ToString() + "_error.log";
StreamWriter logwriter = new StreamWriter(Path.Combine(foln, logfileName));
logwriter.Write(ex.ToString());
logwriter.Close();
}
finally {

dataDump.Clear();
dataDump.Reset();
}

-----

public void exportExcel(System.Data.DataTable tab,string filePath)
{
//create FileInfo object to read you ExcelWorkbook
FileInfo workBook = new FileInfo(filePath);

try
{
using (ExcelPackage xlPackage = new ExcelPackage(workBook))
{
//Fetch the worksheet to insert the data


if (tab.Rows.Count > 0)
{

ExcelWorksheet worksheet = xlPackage.Workbook.Worksheets[tab.TableName.ToString()];
if (worksheet == null)
worksheet = xlPackage.Workbook.Worksheets.Add(tab.TableName.ToString());
//Select a range of cells to insert the data and use the LoadFromDataTable method to write the
//data

worksheet.Cells[2, 1, tab.Rows.Count + 1, tab.Columns.Count + 1].LoadFromDataTable(tab, false);

//Then we save our changes so that they are reflected in ou excel sheet.
tab.Clear();
tab.Reset();
}

xlPackage.Save();
}
}
catch (Exception ex)
{
throw ex;
}
finally {

tab.Dispose();

}
}

Created Unassigned: How to Remove Gridlines from Excelsheet [14943]

$
0
0
Hi All,

I need to know how to remove grid lines from sheet using EP Plus.

can anyone help me.


Commented Unassigned: I can not able to add EPPlus reference in my WPF Applications [14940]

$
0
0
The currently targeted framework ".NETFramework,Version=v4.0,Profile=Client" does not include "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "EPPlus" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project.


This is the error message am getting.Please some one help me.Am using Visual studio 2010.

Comments: Are you using Targetframework __.NET Framework 4 Client__? Try to change it to __.NET Framework 4__

Created Unassigned: Many tests fail non-deterministically [14944]

$
0
0
Just cloned this project and running the tests with TestDriven.Net or the VS test runner I get somewhere like 134 successes 90 fails and 2 skips. Attached is output from a sample run.

Commented Unassigned: Unable to create mutex. (Exception from HRESULT: 0x80131464) [14877]

$
0
0
[IsolatedStorageException: Unable to create mutex. (Exception from HRESULT: 0x80131464)]
System.IO.IsolatedStorage.IsolatedStorageFile.Open(String infoFile, String syncName) +0
System.IO.IsolatedStorage.IsolatedStorageFile.Lock(Boolean& locked) +370
System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf) +468
System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, IsolatedStorageFile isf) +35
MS.Internal.IO.Packaging.SafeIsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, ReliableIsolatedStorageFileFolder folder) +102
MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(Int32 retryCount, String& fileName) +276
MS.Internal.IO.Packaging.SparseMemoryStream.EnsureIsolatedStoreStream() +31
MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary() +400
MS.Internal.IO.Packaging.CompressEmulationStream.Write(Byte[] buffer, Int32 offset, Int32 count) +76
MS.Internal.IO.Packaging.CompressStream.Write(Byte[] buffer, Int32 offset, Int32 count) +431
MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[] buffer, Int32 offset, Int32 count) +177
MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[] buffer, Int32 offset, Int32 count) +130
System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) +233
System.IO.StreamWriter.Write(String value) +147
OfficeOpenXml.ExcelWorksheet.UpdateRowCellData(StreamWriter sw) +3672
OfficeOpenXml.ExcelWorksheet.SaveXml() +554
OfficeOpenXml.ExcelWorksheet.Save() +280
OfficeOpenXml.ExcelWorkbook.Save() +651
OfficeOpenXml.ExcelPackage.Save() +67
Comments: I have the same issue on version 3.1.3.0. Do you have a working solution to this ?

Created Unassigned: Cannot save Excel sheet when using VLOOPUP formula [14945]

$
0
0
When using VLOOPUP formula when you open the generated Excel and try to save it you get the error message [One or more formulas in the workbook are longer that the allowed limit of 8192 characters. If you press F2 then Enter on the formula then apply this to the whole column you are then able to save.

Code used to create the formula in the table:
sheet.Cells[string.Format("P2:P{0}", sheet.Dimension.End.Row)].Formula = "VLOOKUP(E2,'Tag Link'!E:E,1,FALSE)";

Commented Unassigned: Changing any row height after inserting picture makes it square [14846]

$
0
0
After inserting picture I change some other row's height. The result is that picture is square. If I comment out row's height change, picture is rectangular as expected.

Image position and size does not have any impact on that issue. It does not have to be positioned in the row with changed height.

```
static void Main(string[] args)
{
var targetPath = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), ".xlsx"));

using (var package = new ExcelPackage())
{
var worksheet = package.Workbook.Worksheets.Add("new");

var image = new Bitmap(150, 50);
using(var g = Graphics.FromImage(image)) g.FillRectangle(Brushes.Black, 0, 0, 149, 49);

var picture = worksheet.Drawings.AddPicture("Picture", image);
worksheet.Row(1).Height = 5;

package.SaveAs(new FileInfo(targetPath));
}

Process.Start(targetPath);
}
```
Comments: I think we only need modify drawing code https://github.com/ylatuya/EPPlus/blob/master/EPPlus/Drawing/ExcelDrawings.cs maybe new constructor or new parameter inside ```AddPicture``` method to accept pictures as oneCellAnchor ```<xdr:oneCellAnchor editAs="oneCell">``` and compute related ext values here: ```<xdr:ext cx="3857625" cy="1047750" />```

Created Unassigned: Supplied properties in parameter Properties must be of the same type as T [14946]

$
0
0
First of all I'd like to thank you for this great plugin.

In the following method,

public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection, bool PrintHeaders, TableStyles TableStyle, BindingFlags memberFlags, MemberInfo[] Members)

Then following code is throwing an exception, when I pass a dynamic object T with known MemberInfos.

var type = typeof(T);
if (Members == null)
{
Members = type.GetProperties(memberFlags);
}
else
{
foreach (var t in Members)
{
if (t.DeclaringType != type)
{
throw (new Exception("Supplied properties in parameter Properties must be of the same type as T"));
}
}
}

Currently I have commented this code and importing the whole source code in my solution. If the 'else' part is commented out is commented out all is working well.

Do you think you could comment the else part and update the nuget? if not why do you have to check the types of individual properties? This would not allow dynamic objects to be passed using dynamic keyword.

Please let me know.

Thank you.

Edited Unassigned: Supplied properties in parameter Properties must be of the same type as T [14946]

$
0
0
First of all I'd like to thank you for this great plugin.

In the following file,

EPPlus\ExcelRangeBase.cs

the following method,

public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection, bool PrintHeaders, TableStyles TableStyle, BindingFlags memberFlags, MemberInfo[] Members)

There is this following code which is throwing an exception when passing a dynamic object T with known MemberInfos.

var type = typeof(T);
if (Members == null)
{
Members = type.GetProperties(memberFlags);
}
else
{
foreach (var t in Members)
{
if (t.DeclaringType != type)
{
throw (new Exception("Supplied properties in parameter Properties must be of the same type as T"));
}
}
}

Currently I have commented this code and importing the whole source code in my solution. If the 'else' part is commented out all is working well even with dynamic objects.

Do you think you could comment the else part and update the nuget? if not why do you have to check the types of individual properties? This would not allow dynamic objects to be passed using dynamic keyword.

Please let me know.

Thank you.

Commented Unassigned: Changing any row height after inserting picture makes it square [14846]

$
0
0
After inserting picture I change some other row's height. The result is that picture is square. If I comment out row's height change, picture is rectangular as expected.

Image position and size does not have any impact on that issue. It does not have to be positioned in the row with changed height.

```
static void Main(string[] args)
{
var targetPath = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), ".xlsx"));

using (var package = new ExcelPackage())
{
var worksheet = package.Workbook.Worksheets.Add("new");

var image = new Bitmap(150, 50);
using(var g = Graphics.FromImage(image)) g.FillRectangle(Brushes.Black, 0, 0, 149, 49);

var picture = worksheet.Drawings.AddPicture("Picture", image);
worksheet.Row(1).Height = 5;

package.SaveAs(new FileInfo(targetPath));
}

Process.Start(targetPath);
}
```
Comments: Check my solution here: http://stackoverflow.com/a/21776634/659223 (I don`t know if you can set then for pictures correct position and scale, but this fix dimensions for me)

Commented Unassigned: ExcelPackage Write + System.OutOfMemoryException [14942]

$
0
0
Hi,

We have been using EPPlus version 3.1.3.0 successfully quite for some time now. Thank you for this wonderful functionality. We used to have a 64 bit Win XP machine with a 8 GB RAM. It was indeed very satisfactory at that point. But now we are limited with 32 bit Win 7 machine with 3.39 GB usable RAM.
This limitation has also affected our tool functionality as well. We are getting the following error for quite some time now.

Exception Details : System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

While we check the file we found despite raising the error the file has been filled with all the records properly. ( approx 10 Lacs + record).

We have also monitored the program execution and found out that this error comes while it reads from c:\pagefile.sys and writes to the concerned excel file <filepath>.

Memory consumed during this time is almost full. ( only 6-100 MB is Free). We are very much limited with the Memory increment ( from 4 gb to 8 gb and 32 bit to going back to 64 bit again ). Could you please suggest if there is any other way to resolve this issue.

I have mentioned below the code we are using,

Calling Block :

try
{
Writer objWriter = new Writer();
objWriter.exportExcel(dataDump, full_file_name);

dataDump.Clear();
dataDump.Reset();
}
catch (Exception ex)
{
dataDump.Clear();
dataDump.Reset();
string logfileName = dr["SHEET_NAME"].ToString() + "_error.log";
StreamWriter logwriter = new StreamWriter(Path.Combine(foln, logfileName));
logwriter.Write(ex.ToString());
logwriter.Close();
}
finally {

dataDump.Clear();
dataDump.Reset();
}

-----

public void exportExcel(System.Data.DataTable tab,string filePath)
{
//create FileInfo object to read you ExcelWorkbook
FileInfo workBook = new FileInfo(filePath);

try
{
using (ExcelPackage xlPackage = new ExcelPackage(workBook))
{
//Fetch the worksheet to insert the data


if (tab.Rows.Count > 0)
{

ExcelWorksheet worksheet = xlPackage.Workbook.Worksheets[tab.TableName.ToString()];
if (worksheet == null)
worksheet = xlPackage.Workbook.Worksheets.Add(tab.TableName.ToString());
//Select a range of cells to insert the data and use the LoadFromDataTable method to write the
//data

worksheet.Cells[2, 1, tab.Rows.Count + 1, tab.Columns.Count + 1].LoadFromDataTable(tab, false);

//Then we save our changes so that they are reflected in ou excel sheet.
tab.Clear();
tab.Reset();
}

xlPackage.Save();
}
}
catch (Exception ex)
{
throw ex;
}
finally {

tab.Dispose();

}
}
Comments: We are still awaiting for your suggestions. A quick response will be much appreciated.

Created Unassigned: How to export to excel Hierarchical grid [14947]

$
0
0
I have a Grid which contains child grid, I want to export parent child (i.e.both) grids to excel. Please suggest how can i achieve this using EPPlus.

Created Unassigned: XmlException on loading some xlsx files. [14948]

$
0
0
If we load xlsx file created by some accounting software, access to Workbook.Worksheets lead to XmlException: Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 49, position 16.

One reason is that xml files created by this applications are formatted (with tabs and newlines).
In Worksheet.cs we have set of Load functions (LoadCells(xr);, etc.) whict are not expecting any whitespace.
For example, in LoadColumns we have following peace of code:
```
if (ReadUntil(xr, "cols", "sheetData"))
{
while(xr.Read())
{
if (xr.LocalName != "col") break;
if (xr.NodeType == XmlNodeType.Element)
```

This will not work if we have whitespace between "cols" and "col" nodes.
Possible solution is to skip all whitespace like this
```
while(xr.Read())
{
//skip whitespace
while (xr.NodeType == XmlNodeType.Whitespace) { xr.Read(); }
if (xr.LocalName != "col") break;
```





Created Unassigned: Bug when generating more than 65536 hyperlink rows [14949]

$
0
0
When generating many rows with a column containing hypelinks, Excel finds unreadable content when opening the file. I recover the file and Excel removes the hyperlinks.

If I choose to generate a file with less than 65000 rows it works fine.

Created Unassigned: PrinterSettings.RepeatRows [14950]

$
0
0
PrinterSettings.RepeatRows not work on Open Office

Commented Unassigned: Adding comments gives XmlException. [14856]

$
0
0
Opening XLSX with Excel and saving it resolves the file issue but when I run my program it somehow brokes the excel file again on the second time. It's weird. So this error comes in third time when I run the program.

CODE:

public static void SetComment(ExcelRange cell, string text)
{
if (text != "")
{

if (cell.Comment == null) cell.AddComment(text, "CRM"); else cell.Comment.Text = text.Replace("<","").Replace(">","");
cell.Comment.AutoFit = true;
}
}


TRACE:

Unhandled Exception: System.Xml.XmlException: Unexpected end tag. Line 8721, pos
ition 7.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean prese
rveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at OfficeOpenXml.XmlHelper.LoadXmlSafe(XmlDocument xmlDoc, Stream stream)
at OfficeOpenXml.Drawing.Vml.ExcelVmlDrawingBaseCollection..ctor(ExcelPackage
pck, ExcelWorksheet ws, Uri uri)
at OfficeOpenXml.Drawing.Vml.ExcelVmlDrawingCommentCollection..ctor(ExcelPack
age pck, ExcelWorksheet ws, Uri uri)
at OfficeOpenXml.ExcelWorksheet.CreateVmlCollection()
at OfficeOpenXml.ExcelWorksheet.get_Comments()
at OfficeOpenXml.ExcelRangeBase.get_Comment()
at CashflowUpdater.Program.SetComment(ExcelRange cell, String text)
at CashflowUpdater.Program.SaveData(ExcelWorkbook& wb)
at CashflowUpdater.Program.UpdateCashFlowXLS(DateTime StartDate, String FileP
ath)
at CashflowUpdater.Program.Main(String[] args)
Comments: I get the same error trying to access the Comment property of a Cell or trying to add a new comment using the AddComment(string, string) method. worksheet.Cells["A1:A1"].AddComment("Testing", "Testing")' threw an exception of type 'System.Xml.XmlException' base {System.SystemException}: {"The 'br' start tag on line 19 position 47 does not match the end tag of 'font'. Line 20, position 9."} LineNumber: 20 LinePosition: 9 Message: "The 'br' start tag on line 19 position 47 does not match the end tag of 'font'. Line 20, position 9." SourceUri: "" Yet I can add and remove comments in the same worksheet using Microsoft Excel without any problems. The full stack trace is: at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag) at System.Xml.XmlTextReaderImpl.ParseEndElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at OfficeOpenXml.XmlHelper.LoadXmlSafe(XmlDocument xmlDoc, Stream stream) at OfficeOpenXml.Drawing.Vml.ExcelVmlDrawingBaseCollection..ctor(ExcelPackage pck, ExcelWorksheet ws, Uri uri) at OfficeOpenXml.Drawing.Vml.ExcelVmlDrawingCommentCollection..ctor(ExcelPackage pck, ExcelWorksheet ws, Uri uri) at OfficeOpenXml.ExcelWorksheet.CreateVmlCollection() at OfficeOpenXml.ExcelWorksheet.get_Comments() at OfficeOpenXml.ExcelRangeBase.get_Comment() at (My code has been omitted from the trace) This code does work if I have a brand new empty workbook with a brand new empty worksheet. This workbook is an .xlsm with some VBA macro code and a button on the worksheet that activates the VBA macro code. It also has some drop-down menus with lookups to data tables in other sheets and some various color, border and cell background highlighting. The workbook doesn't really have anything too unusual and I don't know why EPPlus is choking when trying to read/write comments to a cell. Please look into this and if absolutely necessary, I could supply the Excel workbook and some sample code that causes the error. Thank you.

Created Unassigned: Is EPPlus Dead? [14951]

$
0
0
It does not look like any updates since 2012, despite the numerous items in the Issues tab. Has the main developers moved on to something else?
Viewing all 2262 articles
Browse latest View live


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