When converting the chart to PDF, I get the following exception:
"Unable to cast object of type 'Steema.TeeChart.WPF.Drawing.Graphics3DPDF' to type 'Steema.TeeChart.WPF.Drawing.Graphics3DWPF'.
I am using WPF version of the TChart.
Please advise.
Regards,
Vish
Issue exporting to PDF
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Issue exporting to PDF
Hi Vish,
I'm not to reproduce this one using latest TeeChart for .NET 2010 release and the code here:
Does this work fine for you? However, I have just found that using our latest code exporting to PDF creates a blank file. I have added this defect (TW16014985) to the bug-list to be fixed ASAP.
I'm not to reproduce this one using latest TeeChart for .NET 2010 release and the code here:
Code: Select all
Steema.TeeChart.WPF.Styles.Line line1 = new Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
tChart1.Export.Image.PDF.Save(@"C:\Temp\TeeChartWPF.pdf");
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Issue exporting to PDF
When I tried your code:
this.tChart.Export.Image.PDF.Save(@"C:\Temp\TeeChartWPF.pdf");
in my test app, it did work fine.
The only difference between my test app (where the export works) and in the production app is the following:
Test App:
the control is hosted in a Window - Export to PDF works
Production App:
the control is hosted in a UserControl, the userControl is hosted in a Window. - Export to PDF fails.
Regards,
Vish
this.tChart.Export.Image.PDF.Save(@"C:\Temp\TeeChartWPF.pdf");
in my test app, it did work fine.
The only difference between my test app (where the export works) and in the production app is the following:
Test App:
the control is hosted in a Window - Export to PDF works
Production App:
the control is hosted in a UserControl, the userControl is hosted in a Window. - Export to PDF fails.
Regards,
Vish
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Issue exporting to PDF
Hi Vish,
Implementing a UserControl as shown below and using it in a Windows Form works fine for me here using latest TeeChart for .NET 2010 release. Which TeeChart version are you using? Can you please modify the code below so that we can reproduce the issue here?
Thanks in advance.
Implementing a UserControl as shown below and using it in a Windows Form works fine for me here using latest TeeChart for .NET 2010 release. Which TeeChart version are you using? Can you please modify the code below so that we can reproduce the issue here?
Code: Select all
namespace WindowsFormsControlLibrary1
{
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
private void UserControl1_Load(object sender, EventArgs e)
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
}
private void button1_Click(object sender, EventArgs e)
{
tChart1.Export.Image.PDF.Save(@"C:\temp\UserControlChart.pdf");
}
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Issue exporting to PDF
Hi Vish,
Regarding TW16014985, we have been investigating the issue further and found that it works fine using the code snippet below. Can you please confirm this solves the problem at your end?
Thanks in advance.
Regarding TW16014985, we have been investigating the issue further and found that it works fine using the code snippet below. Can you please confirm this solves the problem at your end?
Code: Select all
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Series.Add(typeof(Steema.TeeChart.WPF.Styles.Line));
tChart1[0].FillSampleValues();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
tChart1.Export.Image.PDF.Save(@"C:\Temp\TeeChartWPF.pdf");
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |