home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Cell Control / DATA1.CAB / DELPHIDM / UPrint.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-01-11  |  3.3 KB  |  112 lines

  1. unit UPrint;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Tempunit, ComCtrls, StdCtrls, Buttons, OleCtrls, CELLLib_TLB, ExtCtrls;
  8.  
  9. type
  10.   TFPrint = class(TTemplate)
  11.     BitBtn2: TBitBtn;
  12.     BitBtn3: TBitBtn;
  13.     procedure FormShow(Sender: TObject);
  14.     procedure BitBtn2Click(Sender: TObject);
  15.     procedure BitBtn3Click(Sender: TObject);
  16.   private
  17.     { Private declarations }
  18.   public
  19.     { Public declarations }
  20.   end;
  21.  
  22. var
  23.   FPrint: TFPrint;
  24.  
  25. implementation
  26.  
  27. {$R *.DFM}
  28.  
  29. procedure TFPrint.FormShow(Sender: TObject);
  30. begin
  31.   inherited;
  32.   Cell1.DoSetCellString( 0, 0, 'Rate');
  33.   Cell1.DoSetCellString( 1, 0, '3 months');
  34.   Cell1.DoSetCellString( 2, 0, '6 mouths');
  35.   Cell1.DoSetCellString( 3, 0, '1 year');
  36.   Cell1.DoSetCellString( 4, 0, '2 years');
  37.   Cell1.DoSetCellString( 5, 0, '3 years');
  38.   Cell1.DoSetCellString( 6, 0, '5 years');
  39.  
  40.   Cell1.DoSetCellString( 0, 1, 'Rate of mouth');
  41.   Cell1.DoSetCellValue( 1, 1, 2.4);
  42.   Cell1.DoSetCellValue( 2, 1, 3.45);
  43.   Cell1.DoSetCellValue( 3, 1, 4.725);
  44.   Cell1.DoSetCellValue( 4, 1, 4.95);
  45.   Cell1.DoSetCellValue( 5, 1, 5.175);
  46.   Cell1.DoSetCellValue( 6, 1, 5.55);
  47.  
  48.   Cell1.DoSetCellString( 0, 2, 'Rate of year');
  49.   Cell1.DoSetCellValue(1, 2, 2.88);
  50.   Cell1.DoSetCellValue(2, 2, 4.14);
  51.   Cell1.DoSetCellValue(3, 2, 5.67);
  52.   Cell1.DoSetCellValue(4, 2, 5.94);
  53.   Cell1.DoSetCellValue(5, 2, 6.21);
  54.   Cell1.DoSetCellValue(6, 2, 6.66);
  55.  
  56.  
  57.   Cell1.DoJoinCells( 1, 4, 5, 8);
  58.   Cell1.DoSetRefChart( 1, 4, 0, 0, 6, 2);
  59.  
  60.   Cell1.DoJoinCells( 1, 10, 5, 14);
  61.   Cell1.DoSetChart( 1, 10, 5, 5);
  62.  
  63.   Cell1.DoSetChartStringData( 1, 10, 0, 0, 'Region');
  64.   Cell1.DoSetChartStringData( 1, 10, 1, 0, 'Peking');
  65.   Cell1.DoSetChartStringData( 1, 10, 2, 0, 'Hongkong');
  66.   Cell1.DoSetChartStringData( 1, 10, 3, 0, 'Mocao');
  67.   Cell1.DoSetChartStringData( 1, 10, 4, 0, 'Taipei');
  68.  
  69.   Cell1.DoSetChartStringData( 1, 10, 0, 1, '1 quarter');
  70.   Cell1.DoSetChartStringData( 1, 10, 0, 2, '2 quarter');
  71.   Cell1.DoSetChartStringData( 1, 10, 0, 3, '3 quarter');
  72.   Cell1.DoSetChartStringData( 1, 10, 0, 4, '4 quarter');
  73.  
  74.   Cell1.DoSetChartValueData( 1, 10, 1, 1, 29876);
  75.   Cell1.DoSetChartValueData( 1, 10, 1, 2, 34123);
  76.   Cell1.DoSetChartValueData( 1, 10, 1, 3, 42221);
  77.   Cell1.DoSetChartValueData( 1, 10, 1, 4, 52123);
  78.  
  79.   Cell1.DoSetChartValueData( 1, 10, 2, 1, 32365);
  80.   Cell1.DoSetChartValueData( 1, 10, 2, 2, 35432);
  81.   Cell1.DoSetChartValueData( 1, 10, 2, 3, 30283);
  82.   Cell1.DoSetChartValueData( 1, 10, 2, 4, 45322);
  83.  
  84.   Cell1.DoSetChartValueData( 1, 10, 3, 1, 32007);
  85.   Cell1.DoSetChartValueData( 1, 10, 3, 2, 23481);
  86.   Cell1.DoSetChartValueData( 1, 10, 3, 3, 40624);
  87.   Cell1.DoSetChartValueData( 1, 10, 3, 4, 34528);
  88.  
  89.   Cell1.DoSetChartValueData( 1, 10, 4, 1, 31232);
  90.   Cell1.DoSetChartValueData( 1, 10, 4, 2, 30345);
  91.   Cell1.DoSetChartValueData( 1, 10, 4, 3, 27943);
  92.   Cell1.DoSetChartValueData( 1, 10, 4, 4, 32109);
  93.  
  94.   Cell1.DoSetChartGeneralData( 1, 10, 1, False, 'Sales', 'chart 2', 'ten thousand');
  95.   Cell1.DoRefreshChart( 1, 10);
  96.   Cell1.PageLabelVisible := False;
  97. end;
  98.  
  99. procedure TFPrint.BitBtn2Click(Sender: TObject);
  100. begin
  101.   inherited;
  102.      Cell1.DoPrint(True);
  103. end;
  104.  
  105. procedure TFPrint.BitBtn3Click(Sender: TObject);
  106. begin
  107.   inherited;
  108.      Cell1.DoPrintPreview(True);
  109. end;
  110.  
  111. end.
  112.