C#,NPOI2.2.1版本,设值打印区域,打印标题,设值筛选

2021-06-21 01:04

阅读:412

标签:excel   版本   ati   save   fir   row   exce   stream   work   

1,  NPOI2.2.1版本,设值打印区域,打印标题,设值筛选。

 

string tpath = "d:\\BM.xls");

FileStream filewrite = new FileStream(tpath, FileMode.Open, FileAccess. Write);

HSSFWorkbook book2 = new HSSFWorkbook(filewrite);

HSSFSheet CPS ;

//设置打印标题

CPS.RepeatingRows = new CellRangeAddress(0, 8, 0, 8);

// (int first row,int last row,int first col,int last col)

//设置Excel的自动筛选

CellRangeAddress c = CellRangeAddress.ValueOf("A9:K9");

CPS.SetAutoFilter(c);

//设置打印区域

book2.SetPrintArea(sheetnum, int first row,int last row,int first col,int last col);

book2.Write(fileSave2);

filewrite.Close();

C#,NPOI2.2.1版本,设值打印区域,打印标题,设值筛选

标签:excel   版本   ati   save   fir   row   exce   stream   work   

原文地址:https://www.cnblogs.com/fangen/p/10253760.html


评论


亲,登录后才可以留言!