Tutorial for .Net creating PDF from Charg
Tutorial for .Net creating PDF from Charg
For the .Net tutuorial we did not see mention of how to create PDF from the charts. The is an explanation for other areas platforms. Does anyone know where to find info on how to create PDF from TeeChart .Net? Thank you.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Tutorial for .Net creating PDF from Charg
Hello!
yes, there's an example of how to export to PDF in the Features Demo shipped with the TeeChart.NET Pro version:
the code in the 'Save to PDF' button looks like this:
yes, there's an example of how to export to PDF in the Features Demo shipped with the TeeChart.NET Pro version:
the code in the 'Save to PDF' button looks like this:
Code: Select all
private void button1_Click(object sender, System.EventArgs e)
{
saveFileDialog1.DefaultExt = tChart1.Export.Image.PDF.FileExtension;
saveFileDialog1.FileName = tChart1.Name+ "."+saveFileDialog1.DefaultExt;
saveFileDialog1.Filter=Texts.PDFFilter;
if (this.saveFileDialog1.ShowDialog() == DialogResult.OK)
{
tChart1.Export.Image.PDF.Save( saveFileDialog1.FileName );
}
}
Best Regards,
Christopher Ireland / 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: Tutorial for .Net creating PDF from Charg
Christopher
Thank you very much for your detailed response.
We were able to get the PDF to work; however, we are trying to capture a color teechart with a legend. The resulting PDF contains only one part of the legend. The legend has 2 parts and then there is the chart. Here is a link to a screen shot. Only the part shaded yellow is included in PDF. Is each part considered an image. If so, what is the code for multiple images.
https://www.dropbox.com/s/tlqs3js19ffpw ... t.jpg?dl=0
Thank you.
Thank you very much for your detailed response.
We were able to get the PDF to work; however, we are trying to capture a color teechart with a legend. The resulting PDF contains only one part of the legend. The legend has 2 parts and then there is the chart. Here is a link to a screen shot. Only the part shaded yellow is included in PDF. Is each part considered an image. If so, what is the code for multiple images.
https://www.dropbox.com/s/tlqs3js19ffpw ... t.jpg?dl=0
Thank you.
Re: Tutorial for .Net creating PDF from Charg
P.S. I just wanted to clarify we are using this for a web application and not a desktop.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Tutorial for .Net creating PDF from Charg
Hello,
is there any chance you can pass me the code you use to create your Chart? It would be much easier to help you if I could reproduce your issue here.
is there any chance you can pass me the code you use to create your Chart? It would be much easier to help you if I could reproduce your issue here.
Best Regards,
Christopher Ireland / 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: Tutorial for .Net creating PDF from Charg
Below is a link to a Word Document containing code for 2 graphs using TeeChart. Highlighted in yellow is what we are using to get the PDF.
I hope this is what you need. If you need the entire code for the application, providing that would not be easy.
I hope you can help, we would really like to use TeeChart for the chart and creating a PDF.
Here is link to the document:
https://www.dropbox.com/s/gzy8rebuh7fi8 ... .docx?dl=0
Thank you,
Joe
I hope this is what you need. If you need the entire code for the application, providing that would not be easy.
I hope you can help, we would really like to use TeeChart for the chart and creating a PDF.
Here is link to the document:
https://www.dropbox.com/s/gzy8rebuh7fi8 ... .docx?dl=0
Thank you,
Joe
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Tutorial for .Net creating PDF from Charg
Hello Joe,
thanks for the code. With respect to reproducing your issue here, when you say, 'the legend has 2 parts and then there is the chart,' which two parts of the legend are you referring to? I'm afraid I can't see any code in your images which refers to a second part of the legend.
thanks for the code. With respect to reproducing your issue here, when you say, 'the legend has 2 parts and then there is the chart,' which two parts of the legend are you referring to? I'm afraid I can't see any code in your images which refers to a second part of the legend.
Best Regards,
Christopher Ireland / 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: Tutorial for .Net creating PDF from Charg
Here is a screen shot of the chart: https://www.dropbox.com/s/k3zeh4q3hs9jo ... t.jpg?dl=0
I have labled the three parts. The big part is #1, the score/can't do/wont do is part 2, and below average--average, above avg, is part 3.
When we use your code we only get part 2 the part marked in yellow. So the teechart may create all 3 as ONE part but we only get what I have labeld part 2 when creating a pdf of the chart that shows all 3 parts on the page.
Make sense?
Thanks for staying with us on this.
I have labled the three parts. The big part is #1, the score/can't do/wont do is part 2, and below average--average, above avg, is part 3.
When we use your code we only get part 2 the part marked in yellow. So the teechart may create all 3 as ONE part but we only get what I have labeld part 2 when creating a pdf of the chart that shows all 3 parts on the page.
Make sense?
Thanks for staying with us on this.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Tutorial for .Net creating PDF from Charg
I think so. If I understand you correctly, your issue is that the graphical objects with the labels "Above Average", "Average", and "Below Average" are appearing in your WebForm chart but not in your pdf.synapcent wrote: Make sense?
My issue is that the image of the code you linked to in this post does not contain the words "Above Average", "Average", nor "Below Average". I've looked half a dozen times at the image but I cannot see any reference to these words: if this code was text instead of an image I could search it for these terms to be absolutely sure they are not there. Even so, I'm pretty sure the code you sent me makes no reference to these words and so makes no reference to how these graphical objects got painted on your Chart.
This is what I meant when I said, "I'm afraid I can't see any code in your images which refers to a second part of the legend."
Best Regards,
Christopher Ireland / 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: Tutorial for .Net creating PDF from Charg
It is not so important to include parts 2 and 3 which are something like a legend. We want to get part 1 which is the main chart in the PDF. We can go without the other two parts. Currently we are getting only one part and that is not the main chart. Thank you!
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Tutorial for .Net creating PDF from Charg
Using the code you posted I can successfully export parts 1 and 2 to pdf. Which version of TeeChart.dll are you using?synapcent wrote:It is not so important to include parts 2 and 3 which are something like a legend. We want to get part 1 which is the main chart in the PDF. We can go without the other two parts. Currently we are getting only one part and that is not the main chart. Thank you!
Best Regards,
Christopher Ireland / 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: Tutorial for .Net creating PDF from Charg
We are using this build teechart .net pro
TeeChart.Net build 4.1.2015.08065
We have downloaded but have not installed this version: TeeChartNET2017_4.1.2017.10190.exe
Are these versions capable of producing PDF from TeeCharat?
Thank you
TeeChart.Net build 4.1.2015.08065
We have downloaded but have not installed this version: TeeChartNET2017_4.1.2017.10190.exe
Are these versions capable of producing PDF from TeeCharat?
Thank you
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Tutorial for .Net creating PDF from Charg
Hello!
Using the 2017 version, I use the following code:
and obtain the following result:
Using the 2017 version, I use the following code:
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
//Let's work with the Chart object for convenience
Steema.TeeChart.Chart Chart1 = WebChart1.Chart;
//Add in a series and fill it
Chart1.Aspect.View3D = false;
for (int i = 0; i < 3; i++)
{
Chart1.Series.Add(typeof(Line)).FillSampleValues();
}
Chart1.Header.Text = typeof(Chart).Assembly.GetName().Version.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
string path = @"C:\tmp\webchart.pdf";
Steema.TeeChart.Chart Chart1 = WebChart1.Chart;
Chart1.Export.Image.PDF.Save(path);
Process.Start(path);
}
Best Regards,
Christopher Ireland / 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 |