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

Free Support Forum - aspose.com

How to print the workbook using server side code?


I export the gridweb to the xlsx format with style.

Q1 : How can i import the xlsx with style?

Q2 : How to print the workbook from server side(without using javascript)?

thanks in advance



Thanks for your interest in Aspose.Cells for GridWeb.

1) To import excel file inside a gridweb, you can use WebWorksheets.ImportExcelFile() method.

Please refer to this document for code example: ImportExcelFile Method (Stream)

2) Can you please explain more, what do you mean by printing on server side? Do you want to display images of your worksheets [readonly] on your web application?

thank you for your quick reply. import xls is successfully working.

i can take print out using javascript pringGrid() function. but there is no ‘FitToPageTall/ wise’ options. so i export the grid web into excel using following method

string filename = “f:\one1.xls”;
Workbook workbook = new Workbook(filename);
workbook.Worksheets[0].PageSetup.FitToPagesWide = 1;
workbook.Worksheets[0].PageSetup.PrintArea = “A3:V75”;
workbook.Worksheets[0].PageSetup.Orientation = PageOrientationType.Landscape;
workbook.Worksheets[0].PageSetup.PaperSize = PaperSizeType.PaperA4;
workbook.Save(“f:\final.xls”, SaveFormat.Xlsx);

It works fine. my question is
Q. i want to print the grid using aspose.net code

i try
worksheet.SheetToPrinter(“HP1018”); but not working
i attached my source code for your reference


To print the Excel workbook/worksheet using Aspose.Cells library’s API, you may use:
WorkbookRender/SheetRender class.

See the topic for your reference:

Thank you.