We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to add page layout in excel document using Aspose.cell .net

Hi Team,
how to add page layout in excel document using Aspose.cell .net
Steps:
1.How to add page layout to excel sheet
2.how to save after created layout excel sheet
3.And open that excel layout should be retain in excel sheet

Sample Excel document:
Sample Excel.zip (8.1 KB)

@thiru1711,

I guess you want to insert data and apply formattings (e.g add borders,set background/foreground color, apply fonts (bold, italic, etc.) and numbers formatting, etc.) to cells range. For your task, you may either use Tables/ListObjects (see the document with example code for your reference) or use normal/manual way to insert or import data into the cells and then apply formatting to your data set accordingly, see the document for your reference.

Also, you may check the following documents on how to set column widths and rows heights manually or automatically:
https://docs.aspose.com/display/cellsnet/Adjusting+Row+Height+and+Column+Width
https://docs.aspose.com/display/cellsnet/AutoFit+Rows+and+Columns

Hope, this helps a bit.

Thanks for Reply…
Please find the attachment for your reference. how to add layout header and footer in excel
Steps:
1.How to add page layout(header and footer) to excel sheet
2.how to save after created layout excel sheet
3.And open that excel layout should be retain in excel sheet

Attachment:
Pagelayout.png (75.0 KB)

@thiru1711,

Thanks for the screenshot.

See the sample code for your reference:
e.g
Sample code:

Workbook workbook = new Workbook();
            int i = workbook.Worksheets.Add();

            //Set the first worksheet's view type as page layout view.
            workbook.Worksheets[0].ViewType = ViewType.PageLayoutView;

            workbook.Save("e:\\test2\\out1.xlsx");

Regarding adding headers and footers, see the document with example code:
https://docs.aspose.com/display/cellsnet/Setting+Headers+and+Footers

Yes, the layout would be retained when you open the output file into MS Excel.