Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.13.0 #96

Merged
merged 10 commits into from
Nov 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<VersionMajor>1</VersionMajor>
<VersionMinor>12</VersionMinor>
<VersionMinor>13</VersionMinor>
<VersionPatch>0</VersionPatch>
<VersionRevision>0</VersionRevision>
<VersionPrefix Condition="'$(VersionRevision)'=='0'">$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
Expand Down
4 changes: 4 additions & 0 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# WeihanLi.Npoi Release Notes

## [1.13.0](https://www.nuget.org/packages/WeihanLi.Npoi/1.13.0)

- add support for `EntityList`/`DataTable` export auto split sheets when needed

## [1.12.0](https://www.nuget.org/packages/WeihanLi.Npoi/1.12.0)

- refact `ExcelSetting` and `SheetSetting`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="EPPlus.Core.Extensions" Version="2.3.2" />
</ItemGroup>

Expand Down
52 changes: 27 additions & 25 deletions samples/DotNetCoreSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using WeihanLi.Common.Helpers;
using WeihanLi.Extensions;
using WeihanLi.Npoi;
Expand All @@ -21,8 +23,8 @@ public static void Main(string[] args)
// {
// sheet.CellFilter = cell => cell.ColumnIndex <= 10;
// });
var tempExcelPath = Path.Combine(tempDirPath, "testdata.xlsx");
var t_list = ExcelHelper.ToEntityList<ppDto>(tempExcelPath);
//var tempExcelPath = Path.Combine(tempDirPath, "testdata.xlsx");
//var t_list = ExcelHelper.ToEntityList<ppDto>(tempExcelPath);
//var tempTable = ExcelHelper.ToDataTable(tempExcelPath);

//using (var conn = new SqlConnection("server=.;uid=liweihan;pwd=Admin888;database=Reservation"))
Expand Down Expand Up @@ -53,32 +55,32 @@ public static void Main(string[] args)

//Console.WriteLine("Press Enter to continue...");
//Console.ReadLine();

//var list2 = new List<TestEntity2>();
//list2.Add(null);
//for (var i = 0; i < 10; i++)
//{
// list2.Add(new TestEntity2
// {
// Id = i + 1,
// Title = $"Title_{i}",
// Description = $"{Enumerable.Range(1, 200).StringJoin(",")}__{i}",
// });
//}
//list2.Add(new TestEntity2()
//{
// Id = 999,
// Title = $"{Enumerable.Repeat(1, 10).StringJoin(",")}",
// Description = null
//});

//list2.ToExcelFile($@"{tempDirPath}\testEntity2.xlsx");

var list2 = new List<TestEntity2>();
list2.Add(null);
for (var i = 0; i < 100_000; i++)
{
list2.Add(new TestEntity2
{
Id = i + 1,
Title = $"Title_{i}",
Description = $"{Enumerable.Range(1, 200).StringJoin(",")}__{i}",
});
}
list2.Add(new TestEntity2()
{
Id = 999,
Title = $"{Enumerable.Repeat(1, 10).StringJoin(",")}",
Description = null
});
var watch = Stopwatch.StartNew();
list2.ToExcelFile($@"{tempDirPath}\testEntity2.xls");
watch.Stop();
Console.WriteLine($"ElapsedMilliseconds: {watch.ElapsedMilliseconds}ms");
//var listTemp = ExcelHelper.ToEntityList<TestEntity2>($@"{tempDirPath}\testEntity2.xlsx");
//var dataTableTemp = ExcelHelper.ToDataTable($@"{tempDirPath}\testEntity2.xlsx");

//Console.WriteLine("Press Enter to continue...");
//Console.ReadLine();
Console.WriteLine("Press Enter to continue...");
Console.ReadLine();

var entities = new List<TestEntity>()
{
Expand Down
2 changes: 1 addition & 1 deletion src/WeihanLi.Npoi/FluentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class FluentSettings
/// Fluent Setting For TEntity
/// </summary>
/// <typeparam name="TEntity">TEntity</typeparam>
/// <returns></returns>
/// <returns>excel configuration for entity</returns>
public static IExcelConfiguration<TEntity> For<TEntity>() => InternalHelper.GetExcelConfigurationMapping<TEntity>();
}
}
9 changes: 5 additions & 4 deletions src/WeihanLi.Npoi/InternalConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
{
internal static class InternalConstants
{
/// <summary>
/// Workbook中最多Sheet
/// </summary>
public const int MaxSheetNum = 256;
public const int MaxSheetCountXls = 256;
public const int MaxSheetCountXlsx = 16384;

public const int MaxRowCountXls = 65536;
public const int MaxRowCountXlsx = 1_048_576;

/// <summary>
/// DefaultPropertyNameForBasicType
Expand Down
Loading