2014-10-02 158 views
0

我希望能夠打印我使用silverlight-toolkit製作的圖表。
該應用程序是用Silverlight 4編寫的。
但是我不知道如何完成這件事。
有人知道這是如何工作或有教程的地方?
我一直在谷歌搜索,看看我能找到什麼東西,但我沒有找到任何對我有用的東西。打印圖表(工具包)

在此先感謝。

編輯:
我期運用下面的代碼後,我點擊打印按鈕,但沒有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; 
} 

編輯:
事情我已經嘗試:
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

這裏有多篇文章,可以快速瀏覽您最喜歡的搜索引擎[像這樣] [http://gergelyorosz.com/2010/05/printing-in-silverlight-printing-charts-and-自動縮放/) – 2014-10-02 16:00:50

+0

再次感謝您的回覆!我會看看這個:)。 – Dave 2014-10-03 06:04:18

+0

我似乎無法使打印工作。我現在用這個代碼: Chart chartToPrint; //要打印的元素 PrintDocument doc = new PrintDocument(); //創建將執行打印的PrintDocument對象 doc.PrintPage + =(s,args)=> { //設置需要打印的圖表。 //只要設置此項,打印開始 args.PageVisual = chartToPrint; } 在點擊打印按鈕後運行。但沒有事情發生。 – Dave 2014-10-03 07:24:52

回答

1

看看本站:http://kb.yworks.com/article507.html。希望這可以幫助你!

+0

謝謝你的回覆,但是這對我來說不起作用:(。它似乎無法識別ContextConfigurator。 – Dave 2014-10-03 11:56:27