Exporting Chart's Data in Excel Format.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Gianni Pani
Newbie
Newbie
Posts: 2
Joined: Mon Feb 02, 2004 5:00 am

Exporting Chart's Data in Excel Format.

Post by Gianni Pani » Fri Mar 05, 2004 11:09 am

1. I have a DateTime X Axis which displays correctly in runtime, but when I look at the exported Excel file find that DateTime values has become Doubles. Is there a way to prevent this?

2. I name my DataSeries using the Title propery and I set the IncludeHeader property to true before exporting in Excel format. I can't, anyway see in the excel file the series title. Is there a way to show them in the excel file?

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Mar 09, 2004 12:24 pm

Hi,

( copy from our newsgroups : post by Christopher)
-----------------------------------------------------------
Hi Alessandro,
1. I have a DateTime X Axis which displays correctly in runtime, but when I look at the exported Excel file find that DateTime values has become Doubles. Is there a way to prevent this?
This is because the Excel cells are all in "General" format. You can change this in Excel by right clicking over the cells containing the double DateTime values and selecting the Date, Time or Custom formats.
2. I name my DataSeries using the Title propery and I set the includeHeader property to true before exporting in Excel format. I can't, anyway see in the excel file the series title. Is there a way to show them in the excel file?
In the TeeChart for .NET Help file it says:
Steema.TeeChart.Export.DataExportFormat.IncludeHeader Property Include the Series valuelist name with exported data

An example of this would be:

Code: Select all

  private void Form1_Load(object sender, System.EventArgs e) {
   tChart1.Aspect.View3D = false;
   Random rnd = new Random();
   DateTime dateTime = DateTime.Now;
   char c = new char();
   for(int i=0;i<10;++i) {
    c = (char)(i + 65);
    bar1.Add(dateTime, rnd.Next(100),c.ToString(),Color.Red);
    dateTime = dateTime.AddSeconds(15);
   }

   ((Steema.TeeChart.Styles.ValueList)bar1.ValuesLists[0]).Name = "My XValue
Name";
   bar1.YValues.Name = "My YValue Name";
  }

  private void button1_Click(object sender, System.EventArgs e) {
   Steema.TeeChart.Export.ExcelFormat excel = tChart1.Export.Data.Excel;
   excel.IncludeHeader = true;
   excel.IncludeIndex = true;
   excel.IncludeLabels = true;
   excel.Series = bar1;
   excel.TextLineSeparator = ";";
   excel.Save(@"C:\TEMP\test.xls");
  }

Post Reply