Click here to Skip to main content
12,952,277 members (43,860 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.

Posted 15-Oct-12 5:44am
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">
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.

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.

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.

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

The easiest is just to use wpf printing (for example see[^]), then all you have to do is install something like cutepdf and let the user pring to a pdf file ([^]).
Wonde Tadesse 16-Oct-12 19:28pm
Clifford Nelson 17-Oct-12 12:34pm
Rate this: bad
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.
Rate this: bad
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.
Rate this: bad
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 !

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,239
CHill60 3,490
Maciej Los 3,083
Jochen Arndt 1,975
ppolymorphe 1,880

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