Hantera sidbrytningar

Sidbrytningar

Aspose.Cells tillhandahåller en klass Workbook som representerar en Excel-fil. Klassen Workbook innehåller en samling Worksheets som tillåter åtkomst till varje kalkylblad i Excel-filen.

Ett kalkylblad representeras av klassen Worksheet. Klassen Worksheet tillhandahåller ett brett utbud av metoder för att hantera kalkylblad. För att lägga till sidbrytningar, använd metoden AddPageBreaks av klassen Worksheet.

Lägga till sidbrytningar

//For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C
//Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
//Path of output excel file
U16String outputPageBreaks = outDir + u"outputManagingPageBreaks.xlsx";
//Instantiating a Workbook object
Workbook workbook;
//Add a page break at cell J20
workbook.GetWorksheets().Get(0).AddPageBreaks(u"J20");
//Save the Excel file.
workbook.Save(outputPageBreaks);