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

Free Support Forum - aspose.com

Hiding Printing dilalog with printing with SheetRenderer?

Hi,


I am using the following code to print a sheet. It works well except I would like to be able to hide the dialog “Printing page 1…”.
I found how to do it with Aspose.Words (overriding the PrintControler) but I don’t know how to find the equivalent on Cells ?

Thanks


Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(@“f:\temp\testprint.xlsx”);

Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();
options.PrintingPage = Aspose.Cells.PrintingPageType.Default;
options.CustomQueryPageSettingsEventHandler += new QueryPageSettingsEventHandler(AwpDoc_QueryPageSettings);
Aspose.Cells.Rendering.SheetRender sr = new Aspose.Cells.Rendering.SheetRender(wb.Worksheets[0], options);
sr.ToPrinter(@"\…");

Hi Daniel,


Thank you for contacting Aspose support.

If you wish to hide/disable the printing dialog while printing with SheetRender class, please try using the ImageOrPrintOptions.PrintWithStatusDialog property. When aforementioned property is set to false, the dialog to show the printing status will not appear. Here is a simplest code snippet for your reference.

C#

var workbook = new Workbook(dir + “book1.xlsx”);
var render = new SheetRender(workbook.Worksheets[0], new ImageOrPrintOptions() { PrintWithStatusDialog = false });
render.ToPrinter(“my printer”);

Hi

Thanks for the answer.
I understand better now : my Aspose,Cells,dll version is 8.2.1 … This property does not exist yet, I suppose.

Hi,


We recommend you to kindly upgrade to and try our latest version/fix (v17.1.x) which does has this attribute:
Aspose.Cells for .NET v17.1.7 (.NET 2.0) compiled in .NET Framework 2.0.
Aspose.Cells for .NET v17.1.7 (.NET 4.0) compiled in .NET Framework 4.0.

Thank you.

Thanks a lot.

I will !