Click here to Skip to main content
12,956,197 members (57,304 online)
Rate this:
 
Please Sign up or sign in to vote.
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 15-Oct-12 5:44am
Comments
Wes Aday 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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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/[^]).
  Permalink  
Comments
Wonde Tadesse 16-Oct-12 19:28pm
   
5+
Clifford Nelson 17-Oct-12 12:34pm
   
Thanks
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

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.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

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 !
  Permalink  
v2

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,869
CHill60 3,550
Maciej Los 3,243
ppolymorphe 2,070
Jochen Arndt 1,973


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 5 Nov 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100