C# NPOI保留EXCEL模板格式
使用NPOI操作EXCEL时,单元格内相关公式需要执行特定代码去保留,同时针对模板写入数据后导出的文件,需要通过代码执行,否则导出内容不会触发公式的计算 核心代码1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 using (var file = new FileStream(strTemplate, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)){ // 直接读取模板的完整Workbook,包含所有样式、公式、格式 xssfWorkbook = new XSSFWorkbook(file); }/// <summary>/// 核心赋值方法(保留模板格式和公式)/// </summary>/...
TypeScript Declaration Merging(声明合并)
最近在进行前端开发的时候,为了拓展引用,使用了TS声明合并的特性,完整的了解了一下该特性,特此记录成笔记。声明合并指在TypeScript里面,编译器将两个或者多个独立的相同名称的声明合并到一起。合并后的定义同时包含所有声明。可以理解为声明的拓展 接口合并最常见的合并就是接口合并,接口合并后的成员会整合到一起。 接口中的非函数成员应该是唯一的,如果不是唯一,那他们必须有相同的类型,如果声明了两个同名但是类型不通的非函数成员会报错 对于函数成员而言,每一个同名函数成员都相当于当前函数成员的一个版本,第一个接口A和第二个接口A合并的时候,第二个接口声明对象的优先级会高于第一个 eg: 12345678910interface Cloner { clone(animal: Animal): Animal;}interface Cloner { clone(animal: Sheep): Sheep;}interface Cloner { clone(animal: Dog): Dog; clone(animal: Cat):...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment
