大家好(对不起,我的英语不好)。我需要xlsx使用模板中的数据制作 excel 文件 ( )。我有一个模板

和测试数据
public class MyC
{
public String AAA { get; private set; }
public String BBB { get; private set; }
public String CCC { get; private set; }
public MyC(String a, String b, String c)
{
AAA = a;
BBB = b;
CCC = c;
}
}
var my = new List<MyC>
{
new MyC("a1", "b1", "c1"),
new MyC("a2", "b2", "c2"),
new MyC("a3", "b3", "c3"),
};
Run Code Online (Sandbox Code Playgroud)
我需要在模板中找到名称为 DataField: 的标签并替换我的数据。得到这样的东西

并且需要像模板一样保存样式。
PS我尝试自己做,但我不能。请帮帮我。
我有#temp 表,我需要对该表中的所有数据进行分页。表格分页的最佳方式是什么?
create table #temp (
Id int
,SomeName nvarchar(100)
)
create table #tempPage (
Id int
,SomeName nvarchar(100)
,PageIndex int
)
--Test data
insert #temp (Id, SomeName) values
(1,'A'),
(2,'B'),
(3,'C'),
(4,'D'),
(5,'F'),
(6,'G'),
(7,'H'),
(8,'A1'),
(9,'B1'),
(10,'C1'),
(11,'D1'),
(12,'F1'),
(13,'G1'),
(14,'H1');
--Page size
declare @PageSize int = 5
--Max page count
declare @MaxPages float = (
select
case when count(Id)%@PageSize>0 then count(Id)/@PageSize+1 else count(Id)/@PageSize end
from #temp
)
declare @PageFrom int = 0
declare @CurrentPage int = 1 …Run Code Online (Sandbox Code Playgroud)