0
votes

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

1
There's multiple articles out there available covering this with a quick trip to your favorite search engine like this one - Chris W.
Thank you again for your response! I'll have a look at this one to :). - Dave
I can't seem to get the printing working. I now use this code: 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; } That runs after I click on a print button. But nothing happends. - Dave

1 Answers

1
votes

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