简体   繁体   中英

Print a chart (toolkit)

I would like to be able to print the chart I make with silverlight-toolkit.
The application is written in Silverlight 4.
However I have no idea how to get this done.
Does anybody know how this works or has a tutorial somewhere?
I have been searching at Google to see if I could find something, but I didn't find anything that worked for me.

Thanks in advance.

EDIT:
I'm useing the following code after I click on the print button but nothing happends:

Chart chartToPrint; // The element to be printed
PrintDocument doc = new PrintDocument(); // Create the PrintDocument  object that will do the printing
doc.PrintPage += (s, args) =>
{
  // Set the chart that needs to be printed.
  // As soon as this is set, printing starts
  args.PageVisual = chartToPrint;
}

Edit:
Things I have tried:
http://gergelyorosz.com/2010/05/printing-in-silverlight-printing-charts-and-auto-scaling/
http://kb.yworks.com/article507.html
http://www.visiblox.com/blog/2010/05/advanced-printing-in-silverlight-printing-charts-and-auto-scaling
http://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.landscape(v=vs.110).aspx
printing an image in landscape orientation?
http://msdn.microsoft.com/en-us/magazine/hh148152.aspx

Have a look at this site: http://kb.yworks.com/article507.html . Hope this helps you!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM