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

Edited Unassigned: Make ExcelDataValidation.Formula1 Public [15529]

$
0
0
In order to get the values from a drop-down menu I need to read the currently protected ExcelDataValidation.Formula1 parameter that contains the reference to the NamedRange.

So can you plase make ExcelDataValidation.Formula1 Public?

I got around this by reading the value from the WorksheetXml, but it's not pretty:

```
var cell = ws.Cells[1, 1];
var DataValidation = ws.DataValidations[cell.Address];
if (DataValidation != null)
{
field.Tooltip = DataValidation.Prompt;
//field.Formula1 = DataValidation.Formula1; //Protected parameter, read from WorksheetXml below

var nsmgr = new XmlNamespaceManager(ws.WorksheetXml.NameTable);
nsmgr.AddNamespace("ns", ws.WorksheetXml.SelectSingleNode("*").NamespaceURI);
var dataValidation = ws.WorksheetXml.SelectSingleNode("//ns:dataValidation[@sqref='" + DataValidation.Address.Address + "']", nsmgr);
string rangeName = null;
if (dataValidation != null) {
var formula1 = dataValidation.SelectSingleNode("ns:formula1", nsmgr);
if (formula1 != null)
rangeName = formula1.InnerText;
}
```

Created Unassigned: LoadFromDataTable returning null [15530]

$
0
0
In 4.0.5, when a datatable with no rows was passed to LoadFromDataTable, with the PrintHeader parameter set to true, the header row was returned.

On 4.1.0 it returns null.

Commented Unassigned: Sorting a PivotTable on Count (DataTable) [15313]

$
0
0
I can not find a way to sort the DataField colloumn in a PivotTable.
The RowField works fine.

Is there away?

More information take a look at the StackOverflow post:
http://stackoverflow.com/questions/25295921/epplus-sort-pivot-table-on-datafield-instead-of-just-rowfield

Comments: Any updates on this issue? Are there any workarounds?

Created Unassigned: Update worksheet data which is source of Pivot table in other worksheet using EPPlus [15531]

$
0
0
I have already code using EPPlus which loads data using `LoadFromDataTable` in worksheet. It first creates worksheet named `Result`. if worksheet already exists in the Workbook, it deletes only Result worksheet and creates new one with same name. Every time loading data in workbook may have different number of column but few required column will always be there
user can add/edit same workbook and upload again on server. Now I am facing problem that if user add `Pivot Table` referring table in `Result` worksheet and upload on server, it throws exception `object reference not set instance of object` while saving by above said procedure.
I think its probably because Pivot Table points to the table in old worksheet. but I tried to create worksheet with same name and table with same name in it but no luck.
With [ClosedXML](https://www.nuget.org/packages/ClosedXML/) it is working fine. I mean removing worksheet and adding new automatically does not affect Pivot Table. but because of some reason I have to use EPPlus only.

Same issue I have posted on [http://stackoverflow.com/questions/39377619/](http://stackoverflow.com/questions/39377619/)

``` VB
Private Sub SaveExcelFile(ByVal strFileName As String, ByVal dtData As DataTable)
Using pck As New OfficeOpenXml.ExcelPackage(New FileInfo(strFileName))

Dim ws As OfficeOpenXml.ExcelWorksheet = pck.Workbook.Worksheets("Result")

'If "Result" worksheet exists, remove it
If ws IsNot Nothing Then
pck.Workbook.Worksheets.Delete(ws) '-- deleting source worksheet of Pivot
End If

'--Add new worksheet with same name
ws = pck.Workbook.Worksheets.Add("Result")
ws.Cells("A1").LoadFromDataTable(dtData, True, OfficeOpenXml.Table.TableStyles.Light13)

pck.Save() '--Error occurs while saving
End Using
End Sub
```

I am attaching error
![Image](http://i.stack.imgur.com/qUUFw.png)

Commented Unassigned: LookupColor seems to always return black [15438]

$
0
0
Hi

Am checking 4.0.5 as replacement to 4.0.4.
Not sure if I'm using the ExcelColor.LookupColor method in the right context.

It always seems to return Black as the colour for either Font or Fill for coloured/shaded cells in a Source sheet.
e.g. LookupColor(sht.Cells[stRow, ii].Style.Font.Color)
Under the covers the theColor.Indexed is always 0;

So I switched to using
"#" + sht.Cells[stRow, ii].Style.Font.Color.Rgb
to get a HTML colour string.

Any clues as to what is wrong? (Maybe I have corrupted the source Cells in some way? The code looks to try to handle the old XLS limited colour palette - but why is that necessary?)

Cheers Andrew
PS. THANKS for a Great product anyway!



Comments: Hi Has this bug resurfaced again in the latest version? I've just downloaded 4.1 and experiencing this behavior? I always seem to get "#FF000000" when calling LookupColor? While trying to get some help I posted a stack-overflow question: [How to get Excel cells range font color using EPPlus 4.1 and LookupColor method?](http://stackoverflow.com/questions/39389334/how-to-get-excel-cells-range-font-color-using-epplus-4-1-and-lookupcolor-method) I also experienced strange behavior using the binaries from PowerShell between the 3.5 & 4.0 runtime versions also mentioned in my post, but my main issue is obtaining the foreground color reliably... Thanks! Emil

Created Unassigned: ExcelWorksheet.Calculate() takes long time to calcuate [15532]

$
0
0
Coding Language-C#.Net 4.5
Version-EPPlus 4.1
I have generated Excel using EPPlus.
Excel has 7,20,000 rows and 43 columns and 20 columns have formulas.
When ExcelWorksheet.Calculate() is executed it takes more than 3 hours to complete the calculation of excel.
Please help that Calculation part is executed fast.

Created Unassigned: LookupColor always returns black [15533]

$
0
0
Hi

Has this bug resurfaced again in the latest version? I've just downloaded 4.1 and experiencing this behavior?

I found [the same issue](https://epplus.codeplex.com/workitem/15438) that was fixed on the past and now I wonder if it has made a return in this recent 4.1 release?

While trying to get some help I also posted a stack-overflow question: [How to get Excel cells range font color using EPPlus 4.1 and LookupColor method?](http://stackoverflow.com/questions/39389334/how-to-get-excel-cells-range-font-color-using-epplus-4-1-and-lookupcolor-method)

I also experienced some strange method behavior using PowerShell to call the method with the .NET 4.0 runtime version. I mentioned this in the same post, but my main issue is obtaining the foreground color...

Thanks for the great library - it is great work!

Thanks!
Emil

Created Unassigned: Page Break Problem [15534]

$
0
0
Hi, i might be wrong about this.

I tried creating a row page break in EPPLUS and it looks like this in XML:

<x:rowBreaks count="2" manualBreakCount="2" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:brk id="11" max="1048575" man="1" />
<x:brk id="25" max="1048575" man="1" />
</x:rowBreaks>

But when i created a row page break in Excel Application it looks like this XML:
<x:rowBreaks count="2" manualBreakCount="2" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:brk id="4" max="16383" man="1" />
<x:brk id="11" max="16383" man="1" />
</x:rowBreaks>

the 'max' values are different. now i tried converting the EPPLUS generated file using syncfusions' Excel to PDF converter and i encountered the error 'the value was either too large or too small for a UInt16'.

Any thoughts? i may be wrong.


Commented Unassigned: Page Break Problem [15534]

$
0
0
Hi, i might be wrong about this.

I tried creating a row page break in EPPLUS and it looks like this in XML:

<x:rowBreaks count="2" manualBreakCount="2" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:brk id="11" max="1048575" man="1" />
<x:brk id="25" max="1048575" man="1" />
</x:rowBreaks>

But when i created a row page break in Excel Application it looks like this XML:
<x:rowBreaks count="2" manualBreakCount="2" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:brk id="4" max="16383" man="1" />
<x:brk id="11" max="16383" man="1" />
</x:rowBreaks>

the 'max' values are different. now i tried converting the EPPLUS generated file using syncfusions' Excel to PDF converter and i encountered the error 'the value was either too large or too small for a UInt16'.

Any thoughts? i may be wrong.

Comments: workaround: I had to load the excel file to OPENXML and navigate to the row pagebreaks and change the MAX attribute value to 16383 for rows and 1048575 for column pagebreaks. Its now able to convert after that. I hope this is fixed soon so i can remove that extra code.

Commented Unassigned: Page Break Problem [15534]

$
0
0
Hi, i might be wrong about this.

I tried creating a row page break in EPPLUS and it looks like this in XML:

<x:rowBreaks count="2" manualBreakCount="2" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:brk id="11" max="1048575" man="1" />
<x:brk id="25" max="1048575" man="1" />
</x:rowBreaks>

But when i created a row page break in Excel Application it looks like this XML:
<x:rowBreaks count="2" manualBreakCount="2" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:brk id="4" max="16383" man="1" />
<x:brk id="11" max="16383" man="1" />
</x:rowBreaks>

the 'max' values are different. now i tried converting the EPPLUS generated file using syncfusions' Excel to PDF converter and i encountered the error 'the value was either too large or too small for a UInt16'.

Any thoughts? i may be wrong.

Comments: Update: syncfusion had already made changes to their excel api as per request and both libraries now play well. if this is not a STANDARDS issue then consider this WorkItem closed.

Created Unassigned: Response.AddHeader - Value does not fall within the expected range [15535]

$
0
0
Hello All,

I am trying to export a file following the code and examples provided here. Using VS 2015. It continually errors at the Response.AddHeader line, stating "Value does not fall within the expected range". This happens both when I append my variable to the filename or have it hardcoded. I am currently debugging the code, so the "server" is my localhost.

Any help is greatly appreciated!

Here is my sub:

Private Sub ExportToExcel(ByVal dtTemp As System.Data.DataTable, ByVal FName As String, ByVal colNum As Integer)

Dim dt As System.Data.DataTable = dtTemp
Dim ws As ExcelWorksheet
Using pck As New ExcelPackage()
ws = pck.Workbook.Worksheets.Add("Test")
ws.Cells("A1").LoadFromDataTable(dt, True)

Select Case colNum
Case 2
Using rng As ExcelRange = ws.Cells("A1:B1")
rng.Style.Font.Bold = True
End Using
Case 3
Using rng As ExcelRange = ws.Cells("A1:C1")
rng.Style.Font.Bold = True
End Using
Case 4
Using rng As ExcelRange = ws.Cells("A1:D1")
rng.Style.Font.Bold = True
End Using
Case 5
Using rng As ExcelRange = ws.Cells("A1:E1")
rng.Style.Font.Bold = True
End Using
End Select

Me.Context.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
Me.Context.Response.AddHeader("content-disposition", "attachment; filename=" & FName)
Me.Context.Response.BinaryWrite(pck.GetAsByteArray())
Me.Context.Response.End()
End Using
End Sub


Created Unassigned: New file corrupt [15536]

$
0
0
Hi guys,

I'm new to EEPlus and already running into beginner issues. I want to use EPPlus for local use, no ASP.NET.

Simply creating a file and adding a worksheet creates a corrupted file. I followed some tutorials and ended up all corrupted. While their comments are all good.

I've included the basic method I use to test EPPlus. Please review it.

```
static void Main(string[] args)
{
var fi = new FileInfo("example.xlsx");
if (fi.Exists) fi.Delete();
fi.Create().Close();

// Create the package and make sure you wrap it in a using statement
using (var package = new ExcelPackage(fi))
{
// add a new worksheet to the empty workbook
var sheet = package.Workbook.Worksheets.Add("Sheet1");

// save our new workbook and we are done!
package.Save();
}
}
```

Created Unassigned: ExcelDataValidation missing showDropDown attribute [15537]

$
0
0
When using List validation, it is sometimes beneficial to *not* provide a drop-down menu for the options.

Unfortunately, the "showDropDown" attribute is not recognized by ExcelDataValidation and ExcelDataValidationList, so this setting is always set to the default (true).

Docs:
https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.datavalidation(v=office.15).aspx

Commented Unassigned: New file corrupt [15536]

$
0
0
Hi guys,

I'm new to EEPlus and already running into beginner issues. I want to use EPPlus for local use, no ASP.NET.

Simply creating a file and adding a worksheet creates a corrupted file. I followed some tutorials and ended up all corrupted. While their comments are all good.

I've included the basic method I use to test EPPlus. Please review it.

```
static void Main(string[] args)
{
var fi = new FileInfo("example.xlsx");
if (fi.Exists) fi.Delete();
fi.Create().Close();

// Create the package and make sure you wrap it in a using statement
using (var package = new ExcelPackage(fi))
{
// add a new worksheet to the empty workbook
var sheet = package.Workbook.Worksheets.Add("Sheet1");

// save our new workbook and we are done!
package.Save();
}
}
```
Comments: While examining the differences between a working file and the created one, I noticed that the _/_rel/.rel_ misses the relation to _/xl/workbook.xml_ Anyone known with this issue?

Edited Unassigned: New file corrupt [15536]

$
0
0
-- EDIT --
Apparently the library takes everything from an existing file, this includes empty files. (Line 5 of my code.)
So for some reason, using an empty file the relation between _root_ and _/xl/workbook.xml_ isn't created.

__I propose a better check when writing the file away.__

-- ORIGINAL --
Hi guys,

I'm new to EEPlus and already running into beginner issues. I want to use EPPlus for local use, no ASP.NET.

Simply creating a file and adding a worksheet creates a corrupted file. I followed some tutorials and ended up all corrupted. While their comments are all good.

I've included the basic method I use to test EPPlus. Please review it.

```
static void Main(string[] args)
{
var fi = new FileInfo("example.xlsx");
if (fi.Exists) fi.Delete();
fi.Create().Close();

// Create the package and make sure you wrap it in a using statement
using (var package = new ExcelPackage(fi))
{
// add a new worksheet to the empty workbook
var sheet = package.Workbook.Worksheets.Add("Sheet1");

// save our new workbook and we are done!
package.Save();
}
}
```

Created Unassigned: EPPlus Breaks Table Formulas [15538]

$
0
0
I have an xlsx file with two worksheets. The first worksheet has a table that is populated by the second worksheet. With just opening it as an EPPlus package and saving the package, the table is broken and each field in a column references the same cell. Looking at the underlying xml files, it appears that worksheet1.xml has the bad formulas associated with it, while table1.xml has the correct ones.

For example, column A, row 1 is ='Sheet2'!A1 and column A, row 2 = 'Sheet2'A2. After opening and saving it in EPPlus, we then have both cells in column A are ='Sheet2'A2. I have attached a before and after of the workbook. The C# code is below:

```
namespace WorkbookManager
{
class Program
{
static void Main(string[] args)
{
var options = new Options();
if (Parser.Default.ParseArguments(args, options))
{
var file = new FileInfo(@"C:\Temp\TableIssue-BeforeEPPlus.xlsx");

using (var excelPackage = new ExcelPackage(file))
{
excelPackage.SaveAs(new FileInfo(@"C:\tmp\TableIssue-AfterEPPlus.xlsx"));
}
}
}
}
}

```

Edited Unassigned: EPPlus Breaks Table Formulas [15538]

$
0
0
I have an xlsx file with two worksheets. The first worksheet has a table that is populated by the second worksheet. With just opening it as an EPPlus package and saving the package, the table is broken and each field in a column references the same cell. Looking at the underlying xml files, it appears that worksheet1.xml has the bad formulas associated with it, while table1.xml has the correct ones.

For example, column A, row 1 is ='Sheet2'!A1 and column A, row 2 = 'Sheet2'A2. After opening and saving it in EPPlus, we then have both cells in column A are ='Sheet2'A2. I have attached a before and after of the workbook. The C# code is below:

```
namespace WorkbookManager
{
class Program
{
static void Main(string[] args)
{
var options = new Options();
if (Parser.Default.ParseArguments(args, options))
{
var file = new FileInfo(@"C:\Temp\TableIssue-BeforeEPPlus.xlsx");

using (var excelPackage = new ExcelPackage(file))
{
excelPackage.SaveAs(new FileInfo(@"C:\tmp\TableIssue-AfterEPPlus.xlsx"));
}
}
}
}
}

```

Created Unassigned: Get all the VBA macros of a workbook [15539]

$
0
0
Hello,

In "Sample15.cs", I see that EPPlus can write/inject VBA macros. However, I don't see how to read all the VBA macros from a workbook.

Does EPPlus support this functionality?

Thank you

Timur

Commented Unassigned: Excel in email attachment gets filtered [15294]

$
0
0
I am using EPPLUS version 4.0.0.0 for excel automation

I have tried using file signature as .xlsx for the automatically created excel and saved in the disk.

Excel file is getting created with the contents but when I attach it in email, the attachment turns into a text file with the text "This attachment was removed".

I can't use some other versions of EPPLUS in my application as I use this version for excel export functionality.

So please let me know the file signature to be used for the excel in email attachment using EPPLUS 4.0.0.0.


Comments: Why is this issue still not solved in version 4.1? It should be easy...

Created Unassigned: Excel cannot open password protected package [15540]

$
0
0
When I try to open a password protected file, after typing the password into the pop-up Excel then displays the error message:

"Excel cannot open the file 'myfile.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."

Recreate it with code like this:

```
ExcelPackage package = new ExcelPackage();

var sheet = package.Workbook.Worksheets.Add("Sheet 1");

package.Encryption.Password = "mypassword";

using (var fs = new FileStream("C:\\my\\path\\myFile.xlsx", FileMode.Create))
{
package.SaveAs(fs);
}
```

package.Encryption.Version is set to EncryptionVersion.Agile, but I did try changing it to EncryptionVersion.Standard with

```
package.Encryption.Version = EncryptionVersion.Standard;
```

and that didn't help either. Nor did using the alternative SaveAs signature of

```
package.SaveAs(fs, "myPassword");
```

I'm using Excel 2013 on Windows 10 Pro 64-bit. This was working fine: maybe there has been a recent Windows or Excel update that broke it?
Viewing all 2262 articles
Browse latest View live


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