//以下操作Excel的頁首,這個大家用的比較少吧,是列印是需要的。
oSheets =(Excel.Worksheet) oBook.Worksheets[1];
oSheets.PageSetup.PrintTitleRows = "";
oSheets.PageSetup.PrintTitleColumns = "";
oSheets.PageSetup.PrintArea = "";
oSheets.PageSetup.LeftHeader="";
string str="\"";
string fontstr="&"+str+"Times New Roman,粗體"+str+"&13";
string tab="&"+str+"Times New Roman,粗體"+str+"&12";
oSheets.PageSetup.CenterHeader=fontstr+"Unimicron HSF Test Report\n欣興電子HSF 測試報告\n";
oSheets.PageSetup.RightHeader=tab+"Test Date : "+this.TxtDate.Value.Trim();
oSheets.PageSetup.LeftFooter="";
oSheets.PageSetup.CenterFooter="";
oSheets.PageSetup.RightFooter ="";
设置打印Excel
最新推荐文章于 2021-01-08 09:49:11 发布