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

Free Support Forum - aspose.com

How can i print the document in the aspose.cells?

How can i print the document in the aspose.cells ?
not use the Microsoft Excel to open the .xls ,then use Ctrl+p to print.
eg:in a .aspx page,the page has some data display in Gridview .,if i put a Button on the page, then how can i click the Button to print the data immediately?

Hi Peihua,

Yes! it is possible to send the print command using Aspose.Cells kit. Please follow the links below for details:

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/aspose.cells.rendering.sheetrender.toprinter.html
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/aspose.cells.rendering.workbookrender.toprinter.html

Thanks,

Also, check the document for your reference:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/printing-workbooks.html


Thank you.

Thanks for you post,
but this can’t resolve my problem.
because the Method ToPrint() must have a printer Name for theactualParameter. how Can i do?

Hi,

Well, you may try:

//…
SheetRender sr = new SheetRender(worksheet, options);

System.Drawing.Printing.PrinterSettings printSettings = new System.Drawing.Printing.PrinterSettings();
string defaultPrinterName = printSettings.PrinterName;
sr.ToPrinter(defaultPrinterName);


Thank you.

Thanks again,the method you give above is only can recieve the printer Name of the current computer,which deploy in it.

when i’m printing the report from other clients,how could it?

oh,sorry,i thought i misunderstanding you means.

in the same time,i want the printing function be more powerful.like can preview the report in a page,zomm it,and then have a print button to printing,not only printing the data.

Hi,

I am afraid, Aspose.Cells does not provide any user interface for this, it is actually MS Excel spreadsheet management library/component.

Thank you.