Dim options As New Aspose.Cells.Rendering.ImageOrPrintOptions() options.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg options.PrintingPage = PrintingPageType.Default Dim wr As New SheetRender(Sheet- options) wr.ToPr

Am using the following code:


Dim options As New Aspose.Cells.Rendering.ImageOrPrintOptions()
options.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg
options.PrintingPage = PrintingPageType.Default
Dim wr As New SheetRender(Sheet, options)
wr.ToPrinter(My.Settings.DefaultPrinter)
When executed it bring up the little print dialog as if it is trying to print and then i get message
nothing prints

"Object reference not set to an instance of an object"

Using version 8.4.1.0 and run time version v2.0.50727

Thanks
Bob


Hi Bob,


Thank you for contacting Aspose support.

I have tried this scenario while using the latest version of Aspose.Cells for .NE 8.7.0.2 and a sample spreadsheet on my own. Unfortunately, I am not able to replicate the said exception on my side. I believe the problem could be either in your current version of the API or the sample it self therefore you may troubleshoot this scenario further by testing the case against latest revision (attached). In case the problem persists, please provide us an executable sample application along with the source spreadsheet for further investigation.

VB.NET

Dim book = New Workbook(dir & “book1.xlsx”)
Dim sheet = book.Worksheets(0)
Dim options = New ImageOrPrintOptions()
options.ImageFormat = ImageFormat.Jpeg
options.PrintingPage = PrintingPageType.Default
Dim render = New SheetRender(sheet, options)
render.ToPrinter(“Microsoft Print to PDF”)

hello Babar Raza,

By Using the new Dll I no longer get an error messsage and the document now goes to the windows
document print que but will not print
I am attaching the spreadsheet that i am attempting to render for your review

also i am no longer getting email notifications when you respond to me, do you know why

Thanks,
bob

Hi Bob,


It is good to know that you are not able to observe the said exception any more. Regarding your recent concerns, I am able to print your provided spreadsheet without any problem. It seems that the said problem is more related to you printer settings/configurations as it is not able to process the printing queue. You should check with your system administrator in order to resolve this problem. Furthermore, you can troubleshoot the scenario by sending the printing request to a virtual printer such as PDF or XPS printer which do not have a queue and prints instantly.
bobm:

also i am no longer getting email notifications when you respond to me, do you know why

You are the owner of the thread so you should be receiving notifications for this thread. Please check if the emails are not being sent to your spam folder. If so, you may add this domain/email address to your white list in order to avoid such problems in future.

Babar Raza

thanks for all your help i can now move forward the Aspose Team provides the best support of any organization i have ever dealt with
Sincerely,
bob

Hi Bob,


Thank you for the nice gesture. It is good to know that you are able to resolve the printing problem on your side. Please feel free to contact us back in case you need our further assistance with Aspose APIs.