Issue exporting to PDF

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
vk_nomura
Newbie
Newbie
Posts: 12
Joined: Mon May 17, 2010 12:00 am

Issue exporting to PDF

Post by vk_nomura » Fri Jun 18, 2010 2:46 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Issue exporting to PDF

Post by Narcís » Fri Jun 18, 2010 4:02 pm

Hi Vish,

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");
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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

vk_nomura
Newbie
Newbie
Posts: 12
Joined: Mon May 17, 2010 12:00 am

Re: Issue exporting to PDF

Post by vk_nomura » Mon Jun 21, 2010 3:29 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Issue exporting to PDF

Post by Narcís » Wed Jun 23, 2010 8:22 am

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?

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");
    }
  }
}
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Issue exporting to PDF

Post by Narcís » Mon Aug 23, 2010 8:01 am

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?

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");
    }
	}
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply