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

New Post: Splash Screen For excel

$
0
0
I need to put a splash screen on start up of excel window to show some terms and conditions to open excel sheet. If user agrees to terms & conditions, he/she can continue otherwise excel window should be closed automatically.
Is it possible with closedXML and how?

New Post: Splash Screen For excel

$
0
0
That's VBA. You need to create the file with the form in Excel as a template then open the template with ClosedXML to put your data.

New Post: Splash Screen For excel

$
0
0
Thank you MDeLeon for your prompt response. But I need this to be done using c# in a MVC controller, so any suggestion on that front would be great.

New Post: Splash Screen For excel

$
0
0
You need to create the file with the form in Excel as a template then open the template with ClosedXML to put your data using c# in a MVC controller.

Commented Unassigned: Lots of tests fails [9422]

$
0
0
Hi
When I clone the source (Git hash: 4cbcac89e85eb03c9cf31ad4162e729db69a596f) and run the tests 95 of the tests fails.
I have not analyzed all of them, just picked the first: AddingDataSet:
```
Test Name: AddingDataSet
Test FullName: ClosedXML_Tests.Examples.MiscTests.AddingDataSet
Test Source: c:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\Examples\MiscTests.cs : line 12
Test Outcome: Failed
Test Duration: 0:00:00.972

Result Message:
Actual file 'C:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\bin\Debug\Examples\Misc\AddingDataSet.xlsx' is different than the expected file 'Misc.AddingDataSet.xlsx'. The difference is: '/xl/styles.xml :NonEqual
/xl/worksheets/sheet.xml :NonEqual
/xl/worksheets/sheet2.xml :NonEqual
/xl/worksheets/sheet3.xml :NonEqual
'
Expected: True
But was: False
Result StackTrace:
at ClosedXML_Tests.TestHelper.RunTestExample[T](String filePartName) in c:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\TestHelper.cs:line 83
at ClosedXML_Tests.Examples.MiscTests.AddingDataSet() in c:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\Examples\MiscTests.cs:line 13
```

I unpacked the ClosedXML_Tests\bin\Debug\Examples\Misc\AddingDataSet.xlsx and ClosedXML_Tests\Resource\Examples\Misc\AddingDataSet.xlsx by renaming them to zip, unpacking and then comparing them.

In /xl/styles.xml applyNumberFormat="1" is in the Debug... and applyNumberFormat="0" in the Resource...
The same with applyAlignment="1" vs applyAlignment="0".

In /xl/worksheets/sheet.xml and /xl/worksheets/sheet2.xml and /xl/worksheets/sheet3.xml there is the same difference
<x:col min="4" max="4" width="9.4906250000000014" style="0" customWidth="1" /> in Debug... and
<x:col min="4" max="4" width="9.830625" style="0" customWidth="1" /> in Resource...

Any ideas what might be wrong?
I tried changing locale to both en-US and en-GB without success, but since there are no textual differences in the files I suppose that would not be the case anyway.
Seems something in the environment could be the issue. But what?
Framework/OS version? Screen resolution?

I attached the output from the test written to C:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\bin\Debug\Examples\Misc\AddingDataSet.xlsx
Comments: I made a pull request with updated test files https://closedxml.codeplex.com/SourceControl/network/forks/AlbinSunnanbo/closedxml/contribution/8055

Commented Unassigned: Lots of tests fails [9422]

$
0
0
Hi
When I clone the source (Git hash: 4cbcac89e85eb03c9cf31ad4162e729db69a596f) and run the tests 95 of the tests fails.
I have not analyzed all of them, just picked the first: AddingDataSet:
```
Test Name: AddingDataSet
Test FullName: ClosedXML_Tests.Examples.MiscTests.AddingDataSet
Test Source: c:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\Examples\MiscTests.cs : line 12
Test Outcome: Failed
Test Duration: 0:00:00.972

Result Message:
Actual file 'C:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\bin\Debug\Examples\Misc\AddingDataSet.xlsx' is different than the expected file 'Misc.AddingDataSet.xlsx'. The difference is: '/xl/styles.xml :NonEqual
/xl/worksheets/sheet.xml :NonEqual
/xl/worksheets/sheet2.xml :NonEqual
/xl/worksheets/sheet3.xml :NonEqual
'
Expected: True
But was: False
Result StackTrace:
at ClosedXML_Tests.TestHelper.RunTestExample[T](String filePartName) in c:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\TestHelper.cs:line 83
at ClosedXML_Tests.Examples.MiscTests.AddingDataSet() in c:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\Examples\MiscTests.cs:line 13
```

I unpacked the ClosedXML_Tests\bin\Debug\Examples\Misc\AddingDataSet.xlsx and ClosedXML_Tests\Resource\Examples\Misc\AddingDataSet.xlsx by renaming them to zip, unpacking and then comparing them.

In /xl/styles.xml applyNumberFormat="1" is in the Debug... and applyNumberFormat="0" in the Resource...
The same with applyAlignment="1" vs applyAlignment="0".

In /xl/worksheets/sheet.xml and /xl/worksheets/sheet2.xml and /xl/worksheets/sheet3.xml there is the same difference
<x:col min="4" max="4" width="9.4906250000000014" style="0" customWidth="1" /> in Debug... and
<x:col min="4" max="4" width="9.830625" style="0" customWidth="1" /> in Resource...

Any ideas what might be wrong?
I tried changing locale to both en-US and en-GB without success, but since there are no textual differences in the files I suppose that would not be the case anyway.
Seems something in the environment could be the issue. But what?
Framework/OS version? Screen resolution?

I attached the output from the test written to C:\Git\closedxml\ClosedXML\ClosedXML\ClosedXML_Tests\bin\Debug\Examples\Misc\AddingDataSet.xlsx
Comments: I made a few other pull request for minor issues with the tests. Now I can get all test to pass on all machines I have access to. I hope I don't create a to big mess with pull requests depending on each other. Just apply the pull requests in the order submitted and they should work OK. Please notify me if there is any trouble with merging and I can make a unified pull request. Sorry for the number of pull requests, but I prefer to make smaller pull requests with one clear purpose in each.

New Post: General performance improvements

$
0
0
Hi
Thanks for a great library.
I'm using ClosedXML in a project where we render quite large reports (500k cells) to Excel.
We're not quite satisfied with the creation times and I have started some work to improve performance. So far the results are promising, but there is still more work to do.

To make sure I don't break anything I started by submitting a few pull requests to fix some failing tests. I would appreciate if those pull requests could be reviewed and hopefully merged to master to give a stable base to validate the correctness of the performance improved code before sending those pull requests.

Best regards Albin Sunnanbo @ Kentor

New Post: IntegerExtension.ToStringLookup not threadsafe?

$
0
0
It looks like this is fixed in https://closedxml.codeplex.com/SourceControl/changeset/fdeab2de14a4cc0db3a799e01439bbfb0599dbc8 and that should be included in version 0.76.0 as far as I can tell from the source.
I quick look in the code finds no other obvious spots that wouldn't be thread safe when you work with different documents on each thread. However if you call different methods on the same document from different threads I wouldn't be surprised if you could mess up internal state in that document.

Created Unassigned: Export empty DataTable ignores DataColumn Caption [9423]

$
0
0
In the current implementation, when exporting a DataTable to excel via InserTable method, if a DataColumn.Caption is not null or whitespace then the DataColumn.Caption string is taken into account for Excel's column names instead of DataColumn.ColumnName.

However, if the exported DataTable has no rows, the DataColumnCaption field is not taken into account and DataColumn.ColumnName is used.

I believe it would be nice to have the same behaviour for column names for both cases.

Steps to reproduce:

1. Create a DataTable with no rows but with some DataColumns.
2. Fill the DataColumn.Caption field with some non-whiotespace string
3. Export the DataTable with worksheet.Cell("A1").InsertTable(dataTable);

Edited Unassigned: Export empty DataTable ignores DataColumn Caption [9423]

$
0
0
In the current implementation, when exporting a DataTable to excel via InserTable method, if a DataColumn.Caption is not null or whitespace then the DataColumn.Caption string is taken into account for Excel's column names instead of DataColumn.ColumnName.

However, if the exported DataTable has no rows, the DataColumnCaption field is not taken into account and DataColumn.ColumnName is used.

I believe it would be nice to have the same behaviour for column names for both cases.

Steps to reproduce:

1. Create a DataTable with no rows but with some DataColumns.
2. Fill the DataColumn.Caption field with some non-whitespace string
3. Export the DataTable with worksheet.Cell("A1").InsertTable(dataTable);

Edited Unassigned: Export empty DataTable ignores DataColumn Caption [9423]

$
0
0
In the current implementation, when exporting a DataTable to excel via InsertTable method, if a DataColumn.Caption is not null or whitespace then the DataColumn.Caption string is taken into account for Excel's column names instead of DataColumn.ColumnName.

However, if the exported DataTable has no rows, the DataColumnCaption field is not taken into account and DataColumn.ColumnName is used.

I believe it would be nice to have the same behaviour for column names for both cases.

Steps to reproduce:

1. Create a DataTable with no rows but with some DataColumns.
2. Fill the DataColumn.Caption field with some non-whitespace string
3. Export the DataTable with worksheet.Cell("A1").InsertTable(dataTable);

Created Unassigned: get column name from index [9424]

$
0
0
To get the name of a column based on it's index, I added the following function to XlWorksheet. This will return
"A3" for columnindex=1 and rowindex=3 -> the columnindex is 1-based
public static string GetColumnAddress(int columnIndex, int rowIndex)
{
string columnName = string.Empty;
while (columnIndex > 0)
{
int remainder = (columnIndex - 1) % 26;
columnName = Convert.ToChar(65 + remainder) + columnName;
columnIndex = (columnIndex - remainder) / 26;
}
return columnName + rowIndex.ToString();
}

Source code checked in, #b38a1f0218f08fe4056a7d269f21037dd5fcfed4

Source code checked in, #b72980e068a217d10879853c9add62d475063bb1

$
0
0
Merge branch 'FixTestsForSwedishCulture' of https://git01.codeplex.com/forks/albinsunnanbo/closedxml into AlbinSunnanbo/closedxml

Source code checked in, #def5150672689ecb1b3dc7a7766b854bb7929d2f

$
0
0
Merge branch 'AlbinSunnanbo/closedxml'

Source code checked in, #8eb17b7cf6b9611b112827fd51407c10ef59de7d

$
0
0
Merge branch 'DisposeFontFromFontCache' of https://git01.codeplex.com/forks/albinsunnanbo/closedxml into AlbinSunnanbo/closedxml

Source code checked in, #1f04e6fee571fa926a14c02d087f3f4bb645c075

$
0
0
Merge branch 'AlbinSunnanbo/closedxml'

Source code checked in, #891ae31920e4022bc997c0573418bbf799561aa3

$
0
0
Merge branch 'GitIgnorePackages' of https://git01.codeplex.com/forks/albinsunnanbo/closedxml into AlbinSunnanbo/closedxml

Source code checked in, #942f2c7d78c0c337d8fe583442a443d905669bd6

$
0
0
Merge branch 'AlbinSunnanbo/closedxml'

Source code checked in, #39fc56f05891d9b399e9bf80a37d62cc7e866860

Viewing all 1877 articles
Browse latest View live


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