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

Created Unassigned: Date Axis [14952]

$
0
0
I believe there currently is only support for valAx type. It'd be great to have support for dateAx so access to properties such as basetimeunit are available.

<c:dateAx>
<c:axId val="244914048"/>
<c:scaling>
<c:orientation val="minMax"/>
</c:scaling>
<c:axPos val="b"/>
<c:numFmt formatCode="mm/dd/yyyy" sourceLinked="0"/>
<c:tickLblPos val="nextTo"/>
<c:crossAx val="244915584"/>
<c:crosses val="autoZero"/>
<c:auto val="1"/>
<c:lblOffset val="100"/>
<c:baseTimeUnit val="months"/>
</c:dateAx>


Created Unassigned: Units of Measure [14953]

$
0
0
Hi everybody!! I'm trying to find out what unit of measure is used for set the witdh column and heigth row in EPPlus, i need to set the width in 5cm and the row in 2cm, but i don't know how to assign this exactly measure. I need to know if the measure is in pixels, centimeters, milimeters, and so on. Any help will be really apreciated!!

Thanks in advance.

Created Unassigned: insert image into excel [14954]

$
0
0
atiris has a nice solution which improves the way epplus inserts images in an excel sheet:
http://stackoverflow.com/a/21776634/169714

Commented Unassigned: Units of Measure [14953]

$
0
0
Hi everybody!! I'm trying to find out what unit of measure is used for set the witdh column and heigth row in EPPlus, i need to set the width in 5cm and the row in 2cm, but i don't know how to assign this exactly measure. I need to know if the measure is in pixels, centimeters, milimeters, and so on. Any help will be really apreciated!!

Thanks in advance.
Comments: I have the same issue. it seems like some kind of black magic voodoo. Some clarification/explanation would be great. I used a workaround: Set the column/row width in excel -> save -> change the extension of the file to .zip -> open it -> navigate to the worksheet/sheet1.xml -> open -> copy/paste the values from there hope this helps Mathias

Created Unassigned: Ascii value "Unit separator" problem [14955]

$
0
0
Hai,

I am using latest EPPlus dll..

I am having issue in showing exported data in Excel file


I have a data contains ASCII characters, it contains "Unit separator" when i export to Excel file, its exporting data but the problem is its failing to open that excel file. It showing Unable to open......

After open it contains only partial data

How to resolve this issue?


Attached excel file having this issue

Reply

Commented Unassigned: Ascii value "Unit separator" problem [14955]

$
0
0
Hai,

I am using latest EPPlus dll..

I am having issue in showing exported data in Excel file


I have a data contains ASCII characters, it contains "Unit separator" when i export to Excel file, its exporting data but the problem is its failing to open that excel file. It showing Unable to open......

After open it contains only partial data

How to resolve this issue?


Attached excel file having this issue

Reply
Comments: As asked in above comments "Unit Separator" is Ascii character Below is example of "A" character Decimal value : __65__ Hexadecimal value : __41__ Octal value : 101 HTML value : __&#65__ Character : A --------------------------------------------------------------------- Like A values for "Unit separator" has Decimal value : __31__ Hexadecimal value : __1F__ Octal value : __037__ Character : __US__ (Unit Separator) i am exporting data using EPPlus in that export by DataTable method, in datatable some value in some cell contains "Unit Separator", its exporting but data is not showing in excel

Commented Issue: Not Saving [13411]

$
0
0
FileStream fs = null;

ExcelPackage pck = null;
ExcelWorksheet ws = null;

fs = new FileStream("FILE_PATH", FileMode.Open, FileAccess.ReadWrite);

pck = new ExcelPackage(fs);

//ExcelWorksheet indexes are not zero based
ws = pck.Workbook.Worksheets[1];

ws.Cells["A1"].Value = Value;

//Save
pck.Save();



Comments: I'm running into the exact same problem. I can make changes to the ExcelWorksheet that register (if I look at the local variable while the program is running), but the changes are not saved to the spreadsheet. Attached the spreadsheet I'm using. The data in column 11 remains static. I'd like to update/remove the status' according to results of the job running.

Commented Issue: Indexing a cell in an ExcelRange modifies the ExcelRange [14827]

$
0
0
I create a cell range from an ExcelWorkSheet object, then reference a cell in that range.

```
var range = sheet.Cells[1, 1, 5, 5];

var a1 = range.Address;
var c = range['B2'];
var a2 = range.Address;

Assert.AreEqual(a1, a2); // THIS FAILS
```

However, while a1 is equal to "A1:E5", a2 is equal to "B2". This seems wrong. How am I supposed to go about accessing cells in a range without the index operator?

VS2012, Windows 7, .NET Framework 4.5
Comments: Workaround: var c = range.Worksheet.Cells['B2'];

Commented Issue: Indexing a cell in an ExcelRange modifies the ExcelRange [14827]

$
0
0
I create a cell range from an ExcelWorkSheet object, then reference a cell in that range.

```
var range = sheet.Cells[1, 1, 5, 5];

var a1 = range.Address;
var c = range['B2'];
var a2 = range.Address;

Assert.AreEqual(a1, a2); // THIS FAILS
```

However, while a1 is equal to "A1:E5", a2 is equal to "B2". This seems wrong. How am I supposed to go about accessing cells in a range without the index operator?

VS2012, Windows 7, .NET Framework 4.5
Comments: Sorry, that is wrong: you need to add range.Address as you point to the whole sheet.

Commented Issue: System.InvalidOperationException saving document with cloned sheet containing images [14776]

$
0
0
EPPlus is working fantastically for my project, except that I get an exception when saving a document that contains a cloned sheet with images.

If I leave the 'template' sheet in the document then it saves fine.

If I delete the template I get the following exception when saving:

[System.InvalidOperationException] = {"Specified part does not exist in the package."}
at OfficeOpenXml.ExcelPackage.Save()
at OfficeOpenXml.ExcelPackage.SaveAs(FileInfo file)


I have made the simplest template that shows the issue (attached).

Example code is:

public void DemonstrateError()
{
var templateFile = new FileInfo(Environment.CurrentDirectory + @"\Templates\Template.xlsx");
var outputDirectoryInfo = Directory.CreateDirectory(Environment.CurrentDirectory + @"\Reports\" + DateTime.UtcNow.ToFileTimeUtc());
var outputFile = new FileInfo(outputDirectoryInfo.FullName + @"\Report.xlsx");

using (var package = new ExcelPackage(templateFile))
{
//Copy the template sheet to a new one.
var newSheet = package.Workbook.Worksheets.Copy("Template", String.Format("Site {0}", 1));

/* Normally lots of processing goes here */

//We no longer need the template sheet.
package.Workbook.Worksheets.Delete("Template");

//Save the completed document (will generate an exception)
package.SaveAs(outputFile);
}
}
Comments: Calling the setter of the Image property was a workaround for me. ``` foreach (ExcelDrawing ed in nws.Drawings) { if (ed is ExcelPicture) { Image img = (ed as ExcelPicture).Image; (ed as ExcelPicture).Image = img; } } ```

Commented Issue: Using EPPlus to create Excel spreasheets [14751]

$
0
0
Hello, working in asp.net C#...initially i fell into the problem with the Excel.Interop not being able to open excel on Host pcìs due to the Microsoft limitations.

So i decided to try EPPlus to get round this problem. Very simple...followed the EPPlus samples and tried to create an excel file (.xlsx) ad open it at the same time...this is part of the code i got from the sample...

xlPackage.SaveAs(Response.OutputStream);
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", "attachment; filename=Sample1.xlsx");

no errors, but cannot find any Sample1.xlsx file anywhere...

I would just want to create the excel file from a template and then show this last...obviously this has to work on host pc's.
Please help, i'm stuck!
Thanks
Stefano
Comments: It can be solved by changing the code in to this... ``` Response.Clear(); //Response.Flush(); Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; Response.AddHeader("content-disposition", "attachment; filename=ExcelDemo.xlsx"); Response.BinaryWrite(pck.GetAsByteArray()); Response.End(); ```

Created 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!!

Created Unassigned: Chart Axis Crosses and CrossBetween bugs [14957]

$
0
0
Creating a chart with x-axis using Cross or CrossBetween options is inserting invalid values in the xml, and Excel can't parse the chart when opening the file.

Example:
<c:crossBetween val="etweenetween" />
or
<c:crossBetween val="idcatidCat" />

(Proper values are "between" and "midCat".)

This is caused by a simple mistake in file Drawing/Chart/ExcelChartAxis.cs on lines 251 and 269.

Currently these lines are:
v = v.Substring(1).ToLower() + v.Substring(1, v.Length - 1);
but they should be:
v = v.Substring(0,1).ToLower() + v.Substring(1, v.Length - 1);

(Notice only difference is v.Substring(__0__,1)

Created Unassigned: RepeatColumns and RepeatRows [14958]

$
0
0
This Test fails, but should not as I think:

```
[TestMethod]
public void TestRepeatRowsAndColumns()
{
var p = new ExcelPackage();
var w = p.Workbook.Worksheets.Add("RepeatRowsAndColumnsTest");

w.PrinterSettings.RepeatColumns = new ExcelAddress("A:A");
w.PrinterSettings.RepeatRows = new ExcelAddress("1:1");

Assert.IsNotNull(w.PrinterSettings.RepeatColumns);
Assert.IsNotNull(w.PrinterSettings.RepeatRows); // Fails!
}
```

It is possible to either set RepeatColumns or RepeatRows. When I set both, this Test fails an the PrinterSettings in the resulting document where corrupt.

Commented Issue: ExcelWorksheet.GetWorkSheetXml returns invalid XML [14788]

$
0
0
A try to open an XLSX file created by a 3rd party application, but reading the p.Workbook.Worksheets property fails with the following exception:

System.Xml.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 7, position 15.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParsePI(StringBuilder piInDtdStringBuilder)
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) in W:\System\Desktop\epplus-c7f28bd90c59\epplus_c7f28bd90c59\EPPlus\XmlHelper.cs:line 812
at OfficeOpenXml.XmlHelper.LoadXmlSafe(XmlDocument xmlDoc, String xml, Encoding encoding) in W:\System\Desktop\epplus-c7f28bd90c59\epplus_c7f28bd90c59\EPPlus\XmlHelper.cs:line 817
at OfficeOpenXml.ExcelWorksheet.CreateXml() in W:\System\Desktop\epplus-c7f28bd90c59\epplus_c7f28bd90c59\EPPlus\ExcelWorksheet.cs:line 565
at OfficeOpenXml.ExcelWorksheet..ctor(XmlNamespaceManager ns, ExcelPackage excelPackage, String relID, Uri uriWorksheet, String sheetName, Int32 sheetID, Int32 positionID, eWorkSheetHidden hide) in W:\System\Desktop\epplus-c7f28bd90c59\epplus_c7f28bd90c59\EPPlus\ExcelWorksheet.cs:line 184
at OfficeOpenXml.ExcelWorksheets..ctor(ExcelPackage pck, XmlNamespaceManager nsm, XmlNode topNode) in W:\System\Desktop\epplus-c7f28bd90c59\epplus_c7f28bd90c59\EPPlus\ExcelWorksheets.cs:line 83
at OfficeOpenXml.ExcelWorkbook.get_Worksheets() in W:\System\Desktop\epplus-c7f28bd90c59\epplus_c7f28bd90c59\EPPlus\ExcelWorkbook.cs:line 254

I traced down the issue and found that the GetWorkSheetXml method of the ExcelWorksheet class returns invalid XML. This is in Line 682 of the ExcelWorksshet.cs in the current version:

xml += "<sheetData/>" + s.Substring(endMatch.Index + endMatch.Length, s.Length - (endMatch.Index + endMatch.Length));

Before this line the value of the "xml" variable is a valid XML, but after this it contains duplicate XML declarations. See the attached screenshots that were created in the debugger before and after executing this line.

Thank your for creating and providing this library, and thanks in advance for fixing this issue.
Comments: Hi All, I'm also getting below error while reading excel generated by third party source.. 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 1, position 130. Please help me finding correct ExcelWorksheet.cs file which can resolve this issue. Thanks in advance.

Created Unassigned: Error copying cell number formats when copying worksheet to another workbook [14959]

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

Example attached.

Edited 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.

Commented Unassigned: RepeatColumns and RepeatRows [14958]

$
0
0
This Test fails, but should not as I think:

```
[TestMethod]
public void TestRepeatRowsAndColumns()
{
var p = new ExcelPackage();
var w = p.Workbook.Worksheets.Add("RepeatRowsAndColumnsTest");

w.PrinterSettings.RepeatColumns = new ExcelAddress("A:A");
w.PrinterSettings.RepeatRows = new ExcelAddress("1:1");

Assert.IsNotNull(w.PrinterSettings.RepeatColumns);
Assert.IsNotNull(w.PrinterSettings.RepeatRows); // Fails!
}
```

It is possible to either set RepeatColumns or RepeatRows. When I set both, this Test fails an the PrinterSettings in the resulting document where corrupt.
Comments: It works fine with EPPlus 4.0 Beta.

Commented Issue: Inserting Row doesn't update Addresses of NamedRanges [13628]

$
0
0
When you insert a row in Excel, named ranges that are in rows 'below' the inserted row get shifted appropriately. This doesn't seem to be the behavior in EPPlus. Shouldn't it be?

In the meantime, I'm going to try to manage the ranges programmatically.
Comments: Jees! Why is this low priority and been sitting around for two or three years. Note: This solution doesn't work the second time if you add another range of rows because 'Address' no longer refers to the full address. I fixed it for my case by changing this part of the code back to 'FullAddress' var ng = (from item in workBook.Names where item.Worksheet.Name.ToUpper() == workSheet.Name.ToUpper() && item.FullAddress.ToUpper().Contains(workSheet.Name.ToUpper()) && item.Start.Row >= rowStart select item).ToList(); I'm not sure of any new edge cases, but worked for me

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: I am seeing this exact same error. Any thoughts on when a fix might be available for this issue?
Viewing all 2262 articles
Browse latest View live


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