Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all 1877 articles
Browse latest View live

Commented Unassigned: Changing a Column Header's text [9383]

$
0
0
I am trying to change the text of cells in the first row of the spreadsheet, essentially the column header.

This example is just changing the first cell in row 1.

```
Dim l_sValue As String
l_sValue = "test"
wb.Worksheets(0).Cell(1, 1).DataType = XLCellValues.Text
wb.Worksheets(0).Cell(1, 1).Value = l_sValue
```

However, when I do this the spreadsheet needs to be repaired when I open it. If I change any cell other than a cell in row 1 I have no issues.

I need to modify the column headers so they have a better meaning and can't do this in the DataTable that I am importing from.
Comments: Pick up the source code and use table.Field(strOldName or intFieldIndex).Name = strNewName There are a few things I have to do before creating a release.

Commented Unassigned: Failed to create a very large file [9384]

$
0
0
Failed to create a very large file

When I have more than 100000 rows gives me the following error

__Row = 183 706__ - System.OutOfMemoryException: An unhandled exception of type 'System.OutOfMemoryException'. in DocumentFormat.OpenXml.OpenXmlChildElements.GetEnumerator () in DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml .OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlPartRootElement .WriteTo (XmlWriter xmlWriter) in DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart (OpenXmlPart openXmlPart) in DocumentFormat.OpenXml.OpenXmlPartRootElement.Save () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage .TrySavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose (Boolean disposing) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose () in ClosedXML.Excel.XLWorkbook .CreatePackage (String filePath) at ClosedXML.Excel.XLWorkbook.SaveAs (String file) in WebApplication.Reporte12.Obsolecencia.GenerarExcel (Int64 IdSociedad) in ....

according to the program when I add a new sheet the range is __[ClosedXML.Excel.XLWorksheet] = {'Sheet1'! A1: XFD1048576} __

the error is when __wb.SaveAs(file);__
Comments: hi manuel ... thanks for your answers, but Assemble the application, has AnyCPU and the error remains the same Version of ClosedXML 0.75.0.0 Version of DocumentFormat.OpenXml 2.5.5631.0 System.OutOfMemoryException: Se produjo una excepción de tipo 'System.OutOfMemoryException'. en System.Number.FormatUInt32(UInt32 value, String format, NumberFormatInfo info) en System.Xml.XmlConvert.ToString(UInt32 value) en DocumentFormat.OpenXml.UInt32Value.get_InnerText() en DocumentFormat.OpenXml.OpenXmlElement.WriteAttributesTo(XmlWriter xmlWriter) en DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter) en DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w) en DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter) en DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w) en DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter) en DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w) en DocumentFormat.OpenXml.OpenXmlPartRootElement.WriteTo(XmlWriter xmlWriter) en DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart(OpenXmlPart openXmlPart) en DocumentFormat.OpenXml.OpenXmlPartRootElement.Save() en DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContent(OpenXmlPart part) en DocumentFormat.OpenXml.Packaging.OpenXmlPackage.TrySavePartContent(OpenXmlPart part) en DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents() en DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose(Boolean disposing) en DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose() en ClosedXML.Excel.XLWorkbook.CreatePackage(String filePath, SpreadsheetDocumentType spreadsheetDocumentType) en ClosedXML.Excel.XLWorkbook.SaveAs(String file)

Commented Unassigned: Failed to create a very large file [9384]

$
0
0
Failed to create a very large file

When I have more than 100000 rows gives me the following error

__Row = 183 706__ - System.OutOfMemoryException: An unhandled exception of type 'System.OutOfMemoryException'. in DocumentFormat.OpenXml.OpenXmlChildElements.GetEnumerator () in DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml .OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlPartRootElement .WriteTo (XmlWriter xmlWriter) in DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart (OpenXmlPart openXmlPart) in DocumentFormat.OpenXml.OpenXmlPartRootElement.Save () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage .TrySavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose (Boolean disposing) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose () in ClosedXML.Excel.XLWorkbook .CreatePackage (String filePath) at ClosedXML.Excel.XLWorkbook.SaveAs (String file) in WebApplication.Reporte12.Obsolecencia.GenerarExcel (Int64 IdSociedad) in ....

according to the program when I add a new sheet the range is __[ClosedXML.Excel.XLWorksheet] = {'Sheet1'! A1: XFD1048576} __

the error is when __wb.SaveAs(file);__
Comments: did you remove the "Prefer 32Bit" flag?

Commented Unassigned: Failed to create a very large file [9384]

$
0
0
Failed to create a very large file

When I have more than 100000 rows gives me the following error

__Row = 183 706__ - System.OutOfMemoryException: An unhandled exception of type 'System.OutOfMemoryException'. in DocumentFormat.OpenXml.OpenXmlChildElements.GetEnumerator () in DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml .OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlPartRootElement .WriteTo (XmlWriter xmlWriter) in DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart (OpenXmlPart openXmlPart) in DocumentFormat.OpenXml.OpenXmlPartRootElement.Save () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage .TrySavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose (Boolean disposing) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose () in ClosedXML.Excel.XLWorkbook .CreatePackage (String filePath) at ClosedXML.Excel.XLWorkbook.SaveAs (String file) in WebApplication.Reporte12.Obsolecencia.GenerarExcel (Int64 IdSociedad) in ....

according to the program when I add a new sheet the range is __[ClosedXML.Excel.XLWorksheet] = {'Sheet1'! A1: XFD1048576} __

the error is when __wb.SaveAs(file);__
Comments: in visual studio 2010 select AnyCPU

Created Unassigned: Cross-Site Scripting (Insufficient Entropy (CWE ID 331) issues in ColsedXml.dll [9386]

$
0
0
We are using ColsedXml.dll In our application. We are mandated by our organization to scan our code in Veracode Site for security scan. While running the scan we got __"Cross site scripting flaws in ColsedXml.dll"__
Please advise to fix/overcome these flaws.

__Issues Details:

Cross-Site Scripting - Insufficient Entropy (CWE ID 331) - Cryptographic Issues

Module: ClosedXML.dll (Product Version 0.69.1.0)__

1) In closedxml_dll.
File name : ClosedXML.Excel.CalcEngine.MathTrig
Method Name : RandBetween

2) In closedxml_dll.
File name : ClosedXML.Excel.CalcEngine.MathTrig
Method Name : Rand


Commented Unassigned: Failed to create a very large file [9384]

$
0
0
Failed to create a very large file

When I have more than 100000 rows gives me the following error

__Row = 183 706__ - System.OutOfMemoryException: An unhandled exception of type 'System.OutOfMemoryException'. in DocumentFormat.OpenXml.OpenXmlChildElements.GetEnumerator () in DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml .OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlPartRootElement .WriteTo (XmlWriter xmlWriter) in DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart (OpenXmlPart openXmlPart) in DocumentFormat.OpenXml.OpenXmlPartRootElement.Save () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage .TrySavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose (Boolean disposing) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose () in ClosedXML.Excel.XLWorkbook .CreatePackage (String filePath) at ClosedXML.Excel.XLWorkbook.SaveAs (String file) in WebApplication.Reporte12.Obsolecencia.GenerarExcel (Int64 IdSociedad) in ....

according to the program when I add a new sheet the range is __[ClosedXML.Excel.XLWorksheet] = {'Sheet1'! A1: XFD1048576} __

the error is when __wb.SaveAs(file);__
Comments: Ah, it has been introduced with VS2012 [TEXT](http://www.shujaat.net/2013/09/prefer-32-bit-with-any-cpu-platform.html) Please try the x64 option instead of the AnyCPU for test purposes.

Commented Unassigned: Cross-Site Scripting (Insufficient Entropy (CWE ID 331) issues in ColsedXml.dll [9386]

$
0
0
We are using ColsedXml.dll In our application. We are mandated by our organization to scan our code in Veracode Site for security scan. While running the scan we got __"Cross site scripting flaws in ColsedXml.dll"__
Please advise to fix/overcome these flaws.

__Issues Details:

Cross-Site Scripting - Insufficient Entropy (CWE ID 331) - Cryptographic Issues

Module: ClosedXML.dll (Product Version 0.69.1.0)__

1) In closedxml_dll.
File name : ClosedXML.Excel.CalcEngine.MathTrig
Method Name : RandBetween

2) In closedxml_dll.
File name : ClosedXML.Excel.CalcEngine.MathTrig
Method Name : Rand


Comments: Find out the fastest way to generate the following two random numbers using RNGCryptoServiceProvider and I'll include it. 1) A double >= 0 and < 1 See http://office.microsoft.com/en-us/excel-help/rand-HP005209229.aspx 2) An integer between two given integers. Floor and ceiling are included and can accept negative numbers. See http://office.microsoft.com/en-us/excel-help/randbetween-HP005209230.aspx

New Post: Unable to get format data cell using closexml

$
0
0
I'm having problems getting Excel to format cells using closedxml.

My Excel cell is formatted as short date however when I check datatype it gives me string instead of date (or datetime).

I have tried to get format type in this way:

foreach (var item in wRange.Rows())
{
  var array = new object[wCol];
                for (int y = 1; y <= wCol; y++)
                {
                    try
                    {
                        var t = item.Cell(y).Value;
and item.Cell(y) gives me string instead of datetime.

Why is my cell not DateTime type? How do I get it to format as short date?

Thanks

New Post: Unable to get format data cell using closexml

$
0
0
            cell.GetDateTime();

            cell.GetValue<DateTime>();

            DateTime dateTime;
            cell.TryGetValue(out dateTime);

Commented Unassigned: Failed to create a very large file [9384]

$
0
0
Failed to create a very large file

When I have more than 100000 rows gives me the following error

__Row = 183 706__ - System.OutOfMemoryException: An unhandled exception of type 'System.OutOfMemoryException'. in DocumentFormat.OpenXml.OpenXmlChildElements.GetEnumerator () in DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml .OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlPartRootElement .WriteTo (XmlWriter xmlWriter) in DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart (OpenXmlPart openXmlPart) in DocumentFormat.OpenXml.OpenXmlPartRootElement.Save () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage .TrySavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose (Boolean disposing) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose () in ClosedXML.Excel.XLWorkbook .CreatePackage (String filePath) at ClosedXML.Excel.XLWorkbook.SaveAs (String file) in WebApplication.Reporte12.Obsolecencia.GenerarExcel (Int64 IdSociedad) in ....

according to the program when I add a new sheet the range is __[ClosedXML.Excel.XLWorksheet] = {'Sheet1'! A1: XFD1048576} __

the error is when __wb.SaveAs(file);__
Comments: I tried changing to a new application on visual studio 2012 but when under the x64 platform, the application does not compile. ASP.NET Framework 4 Description: An unhandled exception while executing the current web request. Check the stack trace for more information about the error and where it originated in the code.   Exception Details: System.BadImageFormatException: Could not load file or assembly 'pruebaBosch' or one of its dependencies. An attempt was made to load a program with an incorrect format. x64 always gives System.BadImageFormatException:

New Post: Unable to get format data cell using closexml

$
0
0
but in this way i obtain datetime as a datetime value but if you check format cell using item.Cell(y).DataType is string and not datetime.
why is it string datatype?

Commented Issue: "Unreadable content" when editing and reopening generated file in Excel 2010 [8466]

$
0
0
The problem is described in the discussions in the following thread: http://closedxml.codeplex.com/discussions/403797
When I open an existing Excel file using ClosedXml and save it (even without performing any actions), the file gets corrupted when it is edited using Excel 2010 afterwards. Excel 2007 and Excel 2013 do not produce the problem on my Systems (tested with WinXP and Win8).
I've attached the following small sample program:

```
namespace ClosedXml_Template_Test
{
using System.IO;
using ClosedXML.Excel;
class Program
{
static void Main(string[] args)
{
string inFilepath = "Template.xlsx";
string outFilepath = "Generated.xlsx";
byte[] fileContent;
using (FileStream fileStream = File.OpenRead(inFilepath))
{
// Read from file
fileContent = new byte[fileStream.Length];
fileStream.Read(fileContent, 0, fileContent.Length);
}
using (MemoryStream memStream = new MemoryStream())
{
// Write to MemoryStream
memStream.Write(fileContent, 0, fileContent.Length);
// Create ClosedXml instances
using (XLWorkbook workbook = new XLWorkbook(memStream, XLEventTracking.Disabled))
{
// Save the workbook to the stream
workbook.Save();
}
// Get the content from the stream
fileContent = memStream.ToArray();
}
if (File.Exists(outFilepath))
{
// Delete existing generated file
File.Delete(outFilepath);
}
using (FileStream fileStream = File.OpenWrite(outFilepath))
{
// Save the new file
fileStream.Write(fileContent, 0, fileContent.Length);
}
}
}
}
```

EDIT: Reformatted the post (CodePlex somehow killed the layout...)
Comments: Have you checked the thread at https://closedxml.codeplex.com/discussions/403797 ? Are you opening and saving the files with Excel 2010? In Excel 2013 the error doesn't occur.

Commented Issue: "Unreadable content" when editing and reopening generated file in Excel 2010 [8466]

$
0
0
The problem is described in the discussions in the following thread: http://closedxml.codeplex.com/discussions/403797
When I open an existing Excel file using ClosedXml and save it (even without performing any actions), the file gets corrupted when it is edited using Excel 2010 afterwards. Excel 2007 and Excel 2013 do not produce the problem on my Systems (tested with WinXP and Win8).
I've attached the following small sample program:

```
namespace ClosedXml_Template_Test
{
using System.IO;
using ClosedXML.Excel;
class Program
{
static void Main(string[] args)
{
string inFilepath = "Template.xlsx";
string outFilepath = "Generated.xlsx";
byte[] fileContent;
using (FileStream fileStream = File.OpenRead(inFilepath))
{
// Read from file
fileContent = new byte[fileStream.Length];
fileStream.Read(fileContent, 0, fileContent.Length);
}
using (MemoryStream memStream = new MemoryStream())
{
// Write to MemoryStream
memStream.Write(fileContent, 0, fileContent.Length);
// Create ClosedXml instances
using (XLWorkbook workbook = new XLWorkbook(memStream, XLEventTracking.Disabled))
{
// Save the workbook to the stream
workbook.Save();
}
// Get the content from the stream
fileContent = memStream.ToArray();
}
if (File.Exists(outFilepath))
{
// Delete existing generated file
File.Delete(outFilepath);
}
using (FileStream fileStream = File.OpenWrite(outFilepath))
{
// Save the new file
fileStream.Write(fileContent, 0, fileContent.Length);
}
}
}
}
```

EDIT: Reformatted the post (CodePlex somehow killed the layout...)
Comments: Let us know if you still can't reproduce this issue. We've stumbled upon it recently and would really like to get it solved. If we can help in some way let us know please.

New Post: Unable to get format data cell using closexml

$
0
0
Because you're formatting the cell as date/time but the contents of the cell is a string.

Commented Issue: Closed XML does not handle all ConditionalFormatting properties [8412]

$
0
0
Closed XML XLConditionalFormat does not support properties like StopIdTrue, Priority, Rank, EqualAverage, StdDev, etc.,

This is crutial because it alters the order and stop-if-true states of the conditional formats in the excel spreadsheet (.xlsx file).

To duplicate the issue. Use MS excel and do the following:

1. Create a xlsx file with many sets of conditional formats, each set doing a format change on a specific range of cells.
2. Set the "Stop if true" property to true, by checking the checkbox. Save this xlsx file.
3. Use "ClosedXML.Excel.XLWorkbook" to load the saved xlsx file; use a variable to load the workbook object (say var wb = ...).
4. Save the workbook as a new workbook, using wb.SaveAs();
5. Open the saved workbook and check the conditional formats. The order is all changed and stop if true is not checked!!
Comments: I seem to be having this exact problem, but for some reason it seems to only happen the *second* time I invoke ClosedXML in my particular software. For whatever reason, the first time I process a file through it, the conditional formatting is all preserved. Just the second (and further) times, the conditional formatting sequence gets all out of whack. Because it works right the first time and not subsequent, it feels like some kind of memory leak issue or something. I dunno. I am continuing to try memory cleanup operations in the hopes that can provide some kind of workaround. The issue seems to happen regardless if I stuff any data into the source file or not. Simply instantiating the workbook and immediately saving it is enough to butcher up the conditional formatting. I'm using the latest ClosedXML from 9/2014.

Commented Unassigned: Cross-Site Scripting (Insufficient Entropy (CWE ID 331) issues in ColsedXml.dll [9386]

$
0
0
We are using ColsedXml.dll In our application. We are mandated by our organization to scan our code in Veracode Site for security scan. While running the scan we got __"Cross site scripting flaws in ColsedXml.dll"__
Please advise to fix/overcome these flaws.

__Issues Details:

Cross-Site Scripting - Insufficient Entropy (CWE ID 331) - Cryptographic Issues

Module: ClosedXML.dll (Product Version 0.69.1.0)__

1) In closedxml_dll.
File name : ClosedXML.Excel.CalcEngine.MathTrig
Method Name : RandBetween

2) In closedxml_dll.
File name : ClosedXML.Excel.CalcEngine.MathTrig
Method Name : Rand


Comments: I am not sure how I feel about this. ClosedXML is not a crypto service by any means, we are not using random numbers for any anything secure. According to this page http://www.dotnetperls.com/rngcryptoserviceprovider the crypto service is WAY slower then just random. I don't think we should change our code. Ultimately these security scans should not trump everything, any review by a decent developer and you can clearly see this is not an issue. Even the screen shot says it is unlikely to be exploited. I think if you are using ClosedXML's random function in a cryptographic algorithm you have way bigger problems.

New Post: Data Validations

$
0
0
Is it possible to add data validations that come from a data source? I want to have the dropdown list come from my database lookup tables, as opposed to a range of existing cells.

I am creating a template, so the data validation would have to apply to the entire column, not just a cell.

Nice library!

Garth

New Post: Data Validations

Commented Unassigned: Failed to create a very large file [9384]

$
0
0
Failed to create a very large file

When I have more than 100000 rows gives me the following error

__Row = 183 706__ - System.OutOfMemoryException: An unhandled exception of type 'System.OutOfMemoryException'. in DocumentFormat.OpenXml.OpenXmlChildElements.GetEnumerator () in DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml .OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlPartRootElement .WriteTo (XmlWriter xmlWriter) in DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart (OpenXmlPart openXmlPart) in DocumentFormat.OpenXml.OpenXmlPartRootElement.Save () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage .TrySavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose (Boolean disposing) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose () in ClosedXML.Excel.XLWorkbook .CreatePackage (String filePath) at ClosedXML.Excel.XLWorkbook.SaveAs (String file) in WebApplication.Reporte12.Obsolecencia.GenerarExcel (Int64 IdSociedad) in ....

according to the program when I add a new sheet the range is __[ClosedXML.Excel.XLWorksheet] = {'Sheet1'! A1: XFD1048576} __

the error is when __wb.SaveAs(file);__
Comments: Cree una nueva aplicación winform. en x64 y AnyCpu genera el archivos excel y en x86 no. Eso es bueno Ahora en una webform en AnyCPU no funciona. Porque? Lo probaron?

Commented Unassigned: Failed to create a very large file [9384]

$
0
0
Failed to create a very large file

When I have more than 100000 rows gives me the following error

__Row = 183 706__ - System.OutOfMemoryException: An unhandled exception of type 'System.OutOfMemoryException'. in DocumentFormat.OpenXml.OpenXmlChildElements.GetEnumerator () in DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml .OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlElement.WriteTo (XmlWriter xmlWriter) at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo (XmlWriter w) at DocumentFormat.OpenXml.OpenXmlPartRootElement .WriteTo (XmlWriter xmlWriter) in DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart (OpenXmlPart openXmlPart) in DocumentFormat.OpenXml.OpenXmlPartRootElement.Save () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage .TrySavePartContent (OpenXmlPart part) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents () in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose (Boolean disposing) in DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose () in ClosedXML.Excel.XLWorkbook .CreatePackage (String filePath) at ClosedXML.Excel.XLWorkbook.SaveAs (String file) in WebApplication.Reporte12.Obsolecencia.GenerarExcel (Int64 IdSociedad) in ....

according to the program when I add a new sheet the range is __[ClosedXML.Excel.XLWorksheet] = {'Sheet1'! A1: XFD1048576} __

the error is when __wb.SaveAs(file);__
Comments: Sorry. in English Create a new winform application. x64 and AnyCPU generates excel files and not x86. That's good Now in a webform in AnyCPU does not work. Because? They tested?
Viewing all 1877 articles
Browse latest View live


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