设置打印标题

Aspose.Cells - 设置打印标题

Aspose.Cells 允许您指定行和列标题以在打印的工作表的所有页面上重复。为此,请使用页面设置类的 setPrintTitleColumns 和 setPrintTitleRows 属性。

将重复的行或列通过传递它们的行号或列号来定义。例如,行定义为 $1:$2,列定义为 $A:$B。

Java

 //Obtaining the reference of the PageSetup of the worksheet

PageSetup pageSetup = sheet.getPageSetup();

//Defining column numbers A & B as title columns

pageSetup.setPrintTitleColumns("$A:$B");

//Defining row numbers 1 & 2 as title rows

pageSetup.setPrintTitleRows("$1:$2");

下载运行代码

下载示例代码