Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I'm using a simple chart with the chartingToolkit in System.Window.Control.DataVisualization.Charting in WPF & I want to export the chart to a PDF format. Do you have any sample to do it.

Greetings...
Posted
Comments
[no name] 15-Oct-12 11:46am    
There are plenty of samples around. What have you tried?
Jorge Heriberto 15-Oct-12 11:54am    
I'm just needing a sample that create a chart with this assembly and with an option I can to export this simple chart to pdf. I created a chart of this way in the XAML:

<chartingtoolkit:chart title="Test to PDF" name="Chart1">
<chartingtoolkit:chart.series>
<chartingtoolkit:pieseries
="" dependentvaluebinding="{Binding Lines}" independentvaluebinding="{Binding Name}">



In this moment is not a problem to fill a data... I'm just need the methods that I can export this little image.

Greetings
Jorge Heriberto 15-Oct-12 11:59am    
Observe that in the XAML at the end of the post there is not the fill of the data.

Greetings
Jorge Heriberto 15-Oct-12 12:00pm    
at this moment this is not important... the export is the only importance at that time.. if you have a sample that covered it I'm glad to study it.

Greetings

The easiest is just to use wpf printing (for example see http://www.switchonthecode.com/tutorials/printing-in-wpf[^]), then all you have to do is install something like cutepdf and let the user pring to a pdf file (http://cutepdf.com/[^]).
 
Share this answer
 
Comments
Wonde Tadesse 16-Oct-12 19:28pm    
5+
Clifford Nelson 17-Oct-12 12:34pm    
Thanks
This article will be very useful for you. How to Use C# to Create Excel Chart and Convert it to PDF[^]. The tool it uses is a third party, but it also has a WPF version, you can give it a try.
 
Share this answer
 
Probably you need to use iTextSharp[^] free software.

Please, see these:
WPF and iTextSharp[^] - similar question on social.msdn site.
Creating-PDF-documents-with-iTextSharp[^] - excellent article on CP site.
 
Share this answer
 
check out my article: Export WPF page to PDF file[^]

You can just add the simple chart ad control on a fixedpage, in a fixeddocument and export it into XPS and convert to PDF... no additional printers needed. Can completely be done in code, with one click !
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900