home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Delphi / TeeChartPro / TeeChart5Delphi5Eval.exe / %MAINDIR% / Examples / Features / Export_XML.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-09-10  |  1.5 KB  |  74 lines

  1. unit Export_XML;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Base, ExtCtrls, TeeProcs, TeEngine, Chart, StdCtrls, Series;
  8.  
  9. type
  10.   TExportXMLForm = class(TBaseForm)
  11.     Button1: TButton;
  12.     CheckBox1: TCheckBox;
  13.     Button2: TButton;
  14.     SaveDialog1: TSaveDialog;
  15.     Series1: TPointSeries;
  16.     Series2: TPointSeries;
  17.     Series3: TPointSeries;
  18.     Series4: TPointSeries;
  19.     procedure Button2Click(Sender: TObject);
  20.     procedure FormCreate(Sender: TObject);
  21.     procedure Button1Click(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.     Procedure ShowSavedFile;
  25.   public
  26.     { Public declarations }
  27.   end;
  28.  
  29. implementation
  30.  
  31. {$R *.DFM}
  32.  
  33. Uses TeeStore, TeExport, TeeAbout;
  34.  
  35. procedure TExportXMLForm.Button2Click(Sender: TObject);
  36. begin
  37.   TeeExport(Self,Chart1)
  38. end;
  39.  
  40. procedure TExportXMLForm.FormCreate(Sender: TObject);
  41. begin
  42.   inherited;
  43.   Series1.FillSampleValues(6);
  44.   Series2.FillSampleValues(6);
  45.   Series3.FillSampleValues(6);
  46.   Series4.FillSampleValues(6);
  47. end;
  48.  
  49. Procedure TExportXMLForm.ShowSavedFile;
  50. begin
  51.   GoToURL(Handle,SaveDialog1.FileName);
  52. end;
  53.  
  54. procedure TExportXMLForm.Button1Click(Sender: TObject);
  55. begin
  56.   if SaveDialog1.Execute then
  57.   begin
  58.    { nil = all series in Chart1 }
  59.     with TSeriesDataXML.Create(Chart1,nil) do
  60.     try
  61.       IncludeIndex:=CheckBox1.Checked;
  62.  
  63.       SaveToFile(SaveDialog1.FileName);
  64.       ShowSavedFile;
  65.     finally
  66.       Free;
  67.     end;
  68.   end;
  69. end;
  70.  
  71. initialization
  72.   RegisterClass(TExportXMLForm);
  73. end.
  74.