You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SaveAsByTemplate support input IEnmerable<IDicionary<string,object>> or DapperRows parameters #201
varpath=Path.Combine(Path.GetTempPath(),$"{Guid.NewGuid().ToString()}.xlsx");vartemplatePath=@"..\..\..\..\..\samples\xlsx\TestTemplateComplex.xlsx";varconnection=Db.GetConnection("Data Source=:memory:");varvalue=newDictionary<string,object>(){["title"]="FooCompany",["managers"]=connection.Query("select 'Jack' name,'HR' department union all select 'Loan','IT'"),["employees"]=connection.Query(@"select 'Wade' name,'HR' department union all select 'Felix','HR' union all select 'Eric','IT' union all select 'Keaton','IT'")};MiniExcel.SaveAsByTemplate(path,templatePath,value);{varrows=MiniExcel.Query(path).ToList();Assert.Equal(9,rows.Count);Assert.Equal("FooCompany",rows[0].A);Assert.Equal("Jack",rows[2].B);Assert.Equal("HR",rows[2].C);Assert.Equal("Loan",rows[3].B);Assert.Equal("IT",rows[3].C);Assert.Equal("Wade",rows[5].B);Assert.Equal("HR",rows[5].C);Assert.Equal("Felix",rows[6].B);Assert.Equal("HR",rows[6].C);Assert.Equal("Eric",rows[7].B);Assert.Equal("IT",rows[7].C);Assert.Equal("Keaton",rows[8].B);Assert.Equal("IT",rows[8].C);vardemension=Helpers.GetFirstSheetDimensionRefValue(path);Assert.Equal("A1:C9",demension);}
Activity
shps951023 commentedon Apr 18, 2021
v 0.13.1 support this.
- [New] SaveAsByTemplate support input `IEnmerable<IDicionary<string,…
- [New] SaveAsByTemplate support input `IEnmerable<IDicionary<string,…