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

  1. unit Export_HTML;
  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.   TExportHTMLForm = class(TBaseForm)
  11.     Series1: TBarSeries;
  12.     Series2: TBarSeries;
  13.     Series3: TBarSeries;
  14.     Series4: TBarSeries;
  15.     Button1: TButton;
  16.     SaveDialog1: TSaveDialog;
  17.     Button2: TButton;
  18.     CheckBox1: TCheckBox;
  19.     CheckBox2: TCheckBox;
  20.     procedure Button1Click(Sender: TObject);
  21.     procedure Button2Click(Sender: TObject);
  22.     procedure FormCreate(Sender: TObject);
  23.   private
  24.     { Private declarations }
  25.     Procedure ShowSavedFile;
  26.   public
  27.     { Public declarations }
  28.   end;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. Uses TeeStore, TeExport, TeeAbout;
  35.  
  36. procedure TExportHTMLForm.Button1Click(Sender: TObject);
  37. begin
  38.   if SaveDialog1.Execute then
  39.   begin
  40.    { nil = all series in Chart1 }
  41.     with TSeriesDataHTML.Create(Chart1,nil) do
  42.     try
  43.       IncludeIndex:=CheckBox1.Checked;
  44.       IncludeHeader:=CheckBox2.Checked;
  45.  
  46.       SaveToFile(SaveDialog1.FileName);
  47.       ShowSavedFile;
  48.     finally
  49.       Free;
  50.     end;
  51.   end;
  52. end;
  53.  
  54. procedure TExportHTMLForm.Button2Click(Sender: TObject);
  55. begin
  56.   TeeExport(Self,Chart1)
  57. end;
  58.  
  59. procedure TExportHTMLForm.FormCreate(Sender: TObject);
  60. begin
  61.   inherited;
  62.   Series1.FillSampleValues(6);
  63.   Series2.FillSampleValues(6);
  64.   Series3.FillSampleValues(6);
  65.   Series4.FillSampleValues(6);
  66. end;
  67.  
  68. Procedure TExportHTMLForm.ShowSavedFile;
  69. begin
  70.   GoToURL(Handle,SaveDialog1.FileName);
  71. end;
  72.  
  73. initialization
  74.   RegisterClass(TExportHTMLForm);
  75. end.
  76.