改ページの管理

改ページ

Aspose.Cells はクラスを提供しますIワークブックこれは Excel ファイルを表します。のIワークブッククラスにはワークシートExcel ファイル内の各ワークシートにアクセスできるコレクション。

ワークシートは、Iワークシートクラス。のIワークシートクラスには、ワークシートの管理に使用されるさまざまなメソッドが用意されています。改ページを追加するには、AddPageBreaksの方法Iワークシートクラス。

改ページの追加

//For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C
//Output directory path
StringPtr outDir = new String("..\\Data\\02_OutputDirectory\\");
//Path of output excel file
StringPtr outputPageBreaks = outDir->StringAppend(new String("outputManagingPageBreaks.xlsx"));
//Instantiating a Workbook object
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
//Add a page break at cell J20
workbook->GetIWorksheets()->GetObjectByIndex(0)->AddPageBreaks(new String("J20"));
//Save the Excel file.
workbook->Save(outputPageBreaks);