Page 1 of 1

Issue exporting to PDF

Posted: Fri Jun 18, 2010 2:46 pm
by 16056172
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

Re: Issue exporting to PDF

Posted: Fri Jun 18, 2010 4:02 pm
by narcis
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.

Re: Issue exporting to PDF

Posted: Mon Jun 21, 2010 3:29 pm
by 16056172
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

Re: Issue exporting to PDF

Posted: Wed Jun 23, 2010 8:22 am
by narcis
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.

Re: Issue exporting to PDF

Posted: Mon Aug 23, 2010 8:01 am
by narcis
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.