We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Printing in VB.NET

Thread ID:





117160 Aug 26,2014 12:36 PM UTC Sep 1,2014 12:47 PM UTC WinRT 6
Tags: SfDiagram
jim watterson
Asked On August 26, 2014 12:36 PM UTC

I'm trying to print a diagram vb.net VS2013 8.1 app. The statement;

Await Diagram1.PrintingService.RegisterForPrinting()

produces an error - expression does not produce a value.

Removing the await stops the error and allows the app to show the print dialog but then the print preview fails.

Any ideas?

jim watterson
Replied On August 26, 2014 11:16 PM UTC

fter further experimenation I have found that:

I have Diagram1PageSettings = Nothing - which I copied from the examples or documentation. If remove this and add

Diagram1PageSettings .PageWidth =500
Diagram1PageSettings .PageHeight=500

A reversed out block is drawn on top of my diagram corresponding to this size with the line colours inverted. This block then prints but is not what I want.  

All I want is to print my diagram as I see it. The documentation says that PageWiidth & PageHeight should be set by the contents?

Saranya Chandrasekaran [Syncfusion]
Replied On August 28, 2014 06:39 AM UTC

Hi Jim,

Sorry for the inconvenience caused.

Regarding “Printing in VB.NET” to your reported scenario, we have created simple sample to meet your requirement. Currently, we don’t have a support to directly print the Diagram content. We have used Pagesettings to print the Diagram with specified Size. We will update the documentation with necessary information in future. Please refer to the attached sample.

Please let us know if you have any concerns.


Saranya C

Attachment: PrintingSample_54cc1b5f.zip

jim watterson
Replied On August 28, 2014 07:02 AM UTC

Thank for your response. I am trying to fit the diagram onto the page if possible and only go to another page if it won't fit. 

If I could set the PageSettings to the printable area of the page then this would work but I cannot see how to retrieve this because i never have access to the printer context - is there an event I can override during the preview call to get the page size?

Saranya Chandrasekaran [Syncfusion]
Replied On August 29, 2014 11:04 AM UTC

Hi Jim,

We are working on your requirement. We will update you on Monday September 1,2014.

Please let us know if you have any concerns.
Saranya C

jim watterson
Replied On August 30, 2014 06:45 AM UTC

When I print anything it is hard up against the left and top in the preview. When I print the top and left are chopped off by a few pixels. PrintMargin has no effect. I've set a colour and thickness for the border but it is never displayed. I do not understand what OffPageMaxMargin is for.

Mohana Priya Raja [Syncfusion]
Replied On September 1, 2014 12:47 PM UTC

Hi Jim,

We have analyzed your query. We have provided some virtual method to override the printing functionality in PrintingService. The Print Margin property is used to define the Margin for PageBreaks.

Please refer to our online help documentation link for more details about printing.

Link: http://help.syncfusion.com/UG/winrt/documents/api.htm

It would be better for us, if you provide more details (sample, document or video) to represent your requirement. This helps us to serve you better.

Please let us know if you have any concerns.


Mohana Priya R


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon