亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? crctrls.pas

?? 企業智能(ERP)管理系統
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
//ReportControl.pas
{*************************************************/
*  表格式報表處理系統 of  DELPHI
*  簡稱:CReport
*  原創:郭家駿、王寒松

*  優化(Ver 4.02):宋科(Godman)
*  優化內容:
   1、增加對流的支持
   2、將生成臨時文件改為用內存流
   3、優化了一些代碼,更OO
   4、將部分全局變量改為類域
   5、修改了因為找不到數據集或字段而報錯
   6、整理了代碼的縮進
   7、整理了代碼的一些大小寫

    大家修改后最好是發布到Internet,這樣大家共同完善,保護了別人的努力也同時
    保護了自已的努力。

  請將修改后的源碼發我一份:Godman138@163.com

宋科(Godman)
珠海 2003.11.27


* 修改(ver 4.01): 李澤倫,內容:

   1.按國人習慣的表格設計,未滿一頁自動以空表格補齊 (可選)
   2.對預覽窗口進行了重新設計,在預覽時可重設邊距及紙張(增加了用戶調用頁面設置等內容),更加美觀和實用.
   3.完全重寫了PreparePrint過程,不再出現打印空頁或有時不能完全打印數據等問題
   4.新增部份函數和過程,可在預覽時由最終用戶通過拖動邊框線立即永久性修改某一單元格寬.
   5.修改了報表模板編輯器(再不需要EXE文件了),與控件為一體,雙擊即可調用。pageNo有3種樣式可選(第?頁,第?/?頁,第?-?頁)
   6.增加了數據表字段列表按健,可通過拖動字段自動填入模板單元格中.
   7.增加了在模板中控制數值顯示格式的功能,不用在字段屬性中設置,由此也可不必再設置永久字段了。
   8.更正了拆分單元格后,不能對齊的問題。
   9.增加了在IDE中的預覽和模板編輯器調用功能.
  10.增加了兩個函數,可實現每一頁及整個表的每列匯總功能,各列的和還可做加減運算并將結果填入任意列中。
  11.增加了圖片功能(.bmp.jpg.ico類型均可),包括對數據庫中的圖像字段均可預覽打印.
  12.可打印DBGrid.
  13.新增及完善了動態報表的支持功能,可對單個cell或成批cell進行設置或賦值.

  2003.8.8
***************************************************}
unit CRCtrls;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls,
  Forms, Dialogs, ExtCtrls, Math, Printers, Menus, DBGrids,
  Db, jpeg,
  dbtables, DesignEditors, DesignIntf, ShellAPI, REPmess;
//dsgnintf d5
const
  // Horz Align
  TEXT_ALIGN_LEFT = 0;
  TEXT_ALIGN_CENTER = 1;
  TEXT_ALIGN_RIGHT = 2;

  // Vert Align
  TEXT_ALIGN_TOP = 0;
  TEXT_ALIGN_VCENTER = 1;
  TEXT_ALIGN_BOTTOM = 2;

  // 斜線定義
  LINE_LEFT1 = 1; // left top to right bottom
  LINE_LEFT2 = 2; // left top to right
  LINE_LEFT3 = 4; // left top to bottom

  LINE_RIGHT1 = $100; // right top to left bottom
  LINE_RIGHT2 = $200; // right top to left
  LINE_RIGHT3 = $400; // right top to bottom

type
  TReportCell = class;
  TReportLine = class;
  TReportControl = class;

  TReportCell = class(TObject)
  private
    { Private declarations }
    FLeftMargin: Integer; // 左邊的空格
    FOwnerLine: TReportLine; // 隸屬行
    FOwnerCell: TReportCell; // 隸屬的單元格
    FCellsList: TList; // 覆蓋的Cell

    // Index
    FCellIndex: Integer; // Cell在行中的索引

    // size & position
    FCellLeft: Integer;
    FCellWidth: Integer;

    FCellRect: TRect; // 計算得來
    FTextRect: TRect;

    FDragCellHeight: Integer;
    FMinCellHeight: Integer;
    FRequiredCellHeight: Integer;

    // Cell的Top屬性從隸屬的行中取得
    // int GetCellTop();
    // Cell的Height屬性從隸屬行和跨越行中取得
    // int GetCellHeight();

    // border
    FLeftLine: Boolean;
    FLeftLineWidth: Integer;

    FTopLine: Boolean;
    FTopLineWidth: Integer;

    FRightLine: Boolean;
    FRightLineWidth: Integer;

    FBottomLine: Boolean;
    FBottomLineWidth: Integer;

    // 斜線
    FDiagonal: UINT;

    // color
    FTextColor: COLORREF;
    FBackGroundColor: COLORREF;

    // align
    FHorzAlign: Integer;
    FVertAlign: Integer;

    // string
    FCellText: string;
    FCellDispFormat: string;

    FBmp: TBitmap; // add 李澤倫
    FBmpYn: boolean; // add 李澤倫
    // font
    FLogFont: TLOGFONT;
    function GetCellHeight: Integer;
    function GetCellTop: Integer;
    function GetOwnerLineHeight: Integer;
  protected
    { Protected declarations }
    procedure SetLeftMargin(LeftMargin: Integer);
    procedure SetOwnerLine(OwnerLine: TReportLine);

    procedure SetOwnerCell(Cell: TReportCell);
    function GetOwnedCellCount: Integer;

    procedure SetCellLeft(CellLeft: Integer);
    procedure SetCellWidth(CellWidth: Integer);

    procedure SetLeftLine(LeftLine: Boolean);
    procedure SetLeftLineWidth(LeftLineWidth: Integer);

    procedure SetTopLine(TopLine: Boolean);
    procedure SetTopLineWidth(TopLineWidth: Integer);

    procedure SetRightLine(RightLine: Boolean);
    procedure SetRightLineWidth(RightLineWidth: Integer);

    procedure SetBottomLine(BottomLine: Boolean);
    procedure SetBottomLineWidth(BottomLineWidth: Integer);

    procedure SetCellText(CellText: string);
    procedure SetCellDispFormat(CellDispFormat: string);
    procedure SetLogFont(NewFont: TLOGFONT);

    procedure SetBackGroundColor(BkColor: COLORREF);
    procedure SetTextColor(TextColor: COLORREF);

  public
    { Public declarations }
    procedure AddOwnedCell(Cell: TReportCell);
    procedure RemoveAllOwnedCell;
    procedure RemoveOwnedCell(Cell: TReportCell);
    function IsCellOwned(Cell: TReportCell): Boolean;
    procedure CalcCellRect;
    procedure CalcMinCellHeight;
    procedure PaintCell(hPaintDC: HDC; bPrint: Boolean);
    procedure CopyCell(Cell: TReportCell; bInsert: Boolean);

    constructor Create;
    destructor Destroy; override;

    // Properties
    property LeftMargin: Integer read FLeftMargin write SetLeftMargin;
    property OwnerLine: TReportLine read FOwnerLine write SetOwnerLine;
    property OwnerCell: TReportCell read FOwnerCell write SetOwnerCell;
    property OwnedCellCount: Integer read GetOwnedCellCount;

    property CellIndex: Integer read FCellIndex write FCellIndex;

    // size & position
    property CellLeft: Integer read FCellLeft write SetCellLeft;
    property CellWidth: Integer read FCellWidth write SetCellWidth;
    property CellTop: Integer read GetCellTop;
    property CellHeight: Integer read GetCellHeight;

    property CellRect: TRect read FCellRect;
    property TextRect: TRect read FTextRect;

    property DragCellHeight: Integer read FDragCellHeight;
    // or protected property ?
    property MinCellHeight: Integer read FMinCellHeight write FMinCellHeight;
    property RequiredCellHeight: Integer read FRequiredCellHeight;
    property OwnerLineHeight: Integer read GetOwnerLineHeight;

    // border
    property LeftLine: Boolean read FLeftLine write SetLeftLine default True;
    property LeftLineWidth: Integer read FLeftLineWidth write SetLeftLineWidth default 1;

    property TopLine: Boolean read FTopLine write SetTopLine default True;
    property TopLineWidth: Integer read FTopLineWidth write SetTopLineWidth default 1;

    property RightLine: Boolean read FRightLine write SetRightLine default True;
    property RightLineWidth: Integer read FRightLineWidth write SetRightLineWidth default 1;

    property BottomLine: Boolean read FBottomLine write SetBottomLine default True;
    property BottomLineWidth: Integer read FBottomLineWidth write SetBottomLineWidth default 1;

    // 斜線
    property Diagonal: UINT read FDiagonal write FDiagonal;

    // color
    property TextColor: COLORREF read FTextColor write SetTextColor default clBlack;
    property BkColor: COLORREF read FBackGroundColor write SetBackGroundColor default clWhite;

    // align
    property HorzAlign: Integer read FHorzAlign write FHorzAlign default 1;
    property VertAlign: Integer read FVertAlign write FVertAlign default 1;

    // string
    property CellText: string read FCellText write SetCellText;
    property CellDispFormat: string read FCellDispFormat write SetCellDispFormat;


    // font
    property LogFont: TLOGFONT read FLogFont write SetLogFont;
  end;

  TReportLine = class(TObject)
  private
    { Private declarations }
    FReportControl: TReportControl; // Report Control的指針
    FCells: TList; // 保存所有在該行中的CELL
    FIndex: Integer; // 行的索引

    FMinHeight: Integer;
    FDragHeight: Integer;
    FLineTop: Integer;
    FLineRect: TRect;
    function GetLineHeight: Integer;
    function GetLineRect: TRect;
    procedure SetDragHeight(const Value: Integer);
    procedure SetLineTop(const Value: Integer);
  protected
    { Protected declarations }
  public
    { Public declarations }
    property ReportControl: TReportControl read FReportControl write FReportControl;
    property Index: Integer read FIndex write FIndex;
    property LineHeight: Integer read GetLineHeight write SetDragHeight;
    property LineTop: Integer read FLineTop write SetLineTop;
    property LineRect: TRect read GetLineRect;
    property PrevLineRect: TRect read FLineRect;

    procedure CalcLineHeight;
    procedure CreateLine(LineLeft, CellNumber, PageWidth: Integer);
    procedure CopyLine(Line: TReportLine; bInsert: Boolean);

    constructor Create;
    destructor Destroy; override;
  end;

  TReportControl = class(TWinControl)
  private
    FCreportEdit: boolean; //// add 李澤倫
    { Private declarations }
    FPreviewStatus: Boolean;

    FLineList: TList;
    FSelectCells: TList;
    FEditCell: TReportCell;

    FReportScale: Integer;
    FPageWidth: Integer;
    FPageHeight: Integer;

    FLeftMargin: Integer; // 1
    FRightMargin: Integer;
    FTopMargin: Integer;
    FBottomMargin: Integer;

    FcellFont: TlogFont;
    FcellFont_d: TlogFont;

    FLeftMargin1: Integer;
    FRightMargin1: Integer;
    FTopMargin1: Integer;
    FBottomMargin1: Integer;

    FHootNo: Integer; //表尾的第一行在整個頁的第幾行 李澤倫


    // 換頁加表頭(不加表頭)
    FNewTable: Boolean;

    // 定義打印多少行后從新加表頭
    FDataLine: Integer;

    FTablePerPage: Integer;

    // 鼠標操作支持
    FMousePoint: TPoint;

    // 編輯、顏色及字體
    FEditWnd: HWND;
    FEditBrush: HBRUSH;
    FEditFont: HFONT;
    //procedure SetScale(const Value: Integer);

    //FReportMenu : TPopupMenu;

    procedure setCreportEdit(const value: boolean); //// add 李澤倫
  protected
    { Protected declarations }
    procedure CreateWnd; override;
  public
    { Public declarations }
    CPreviewEdit: boolean;

    FprPageNo: Integer; //打印文件的紙張序號  李澤倫
    FprPageXy: Integer; //打印文件的紙張縱橫方向  李澤倫
    fPaperLength: Integer;
    fPaperWidth: Integer;

    cp_pgw, cp_pgh, scale: Integer;

    CellsWidth: array of array of Integer; //李澤倫 存用戶在預覽時拖動表格后新的單元格寬度,
    NhasSumALl: Integer; //有合計的行在模板中是第幾行 lzl.

    cp_prewYn: Boolean; //代表是否處于預覽狀態, 李澤倫 
    //EditEpt:Boolean; //是否充許用戶在預覽時調用編輯程序修改模板

    cellline_d: TReportCell; //用于保存選中單元格的屬性
    celldisp: TReportCell; //用于顯示Mouse位置的單元格屬性

    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    //procedure setSaveToFile(callRow,lenk:Integer;RcallText:array of string);
    procedure SaveToStream(Stream: TStream;const APosition:Integer=0);
    procedure SaveToFile(FileName: string);
    procedure LoadFromStream(Stream: TStream;const APosition:Integer=0);
    procedure LoadFromFile(FileName: string);

    procedure SetCellFocus(row, col: Integer); //add 李澤倫 選擇單元格
    procedure SetCellSFocus(row1, col1, row2, col2: Integer); //add 李澤倫 選擇單元格

    procedure SaveBmp(ThisCell: Treportcell; filename: string); //lzl add
    function LoadBmp(ThisCell: Treportcell): TBitmap; //lzl add
    procedure FreeBmp(ThisCell: Treportcell); //lzl add
    procedure SetLineHegit(row, h: Integer); // lzl add

    procedure PrintIt;
    procedure ResetContent;
    procedure SetScale(const Value: Integer);

    property cellFont: TlogFont read Fcellfont write Fcellfont; //default True;
    property cellFont_d: TlogFont read Fcellfont_d write Fcellfont_d; //default True;

    // Message Handler
    procedure WMLButtonDown(var Message: TMessage); message WM_LBUTTONDOWN;
    procedure WMLButtonDBLClk(var Message: TMessage); message WM_LBUTTONDBLCLK;
    procedure WMMouseMove(var Message: TMessage); message WM_MOUSEMOVE;
    procedure WMContextMenu(var Message: TMessage); message WM_CONTEXTMENU;
    procedure WMPaint(var Message: TMessage); message WM_PAINT;
    procedure WMCOMMAND(var Message: TMessage); message WM_COMMAND;
    procedure WMCtlColor(var Message: TMessage); message WM_CTLCOLOREDIT;


    // Window size
    procedure CalcWndSize;
    procedure SetWndSize(w, h: Integer); //add 李澤倫 在定義動態報表時,設置紙的大小 不調用windows的打印設置對框時
    procedure SetPageSize(w, h: Integer); //add 李澤倫 動態報表設置紙張大小


    procedure NewTable(ColNumber, RowNumber: Integer);

    procedure InsertLine;
    function CanInsert: Boolean;
    procedure AddLine;
    function CanAdd: Boolean;
    procedure DeleteLine;

    procedure InsertCell;
    procedure DeleteCell;
    procedure AddCell;

    procedure SetCallText(cRow, ccoln: Integer; RcallText: string); //add李澤倫
    procedure GetCellsWadth(HasDataNo: Integer); //add 李澤倫
    procedure SetFileCellWidth(filename: string; HasDataNo: Integer); //add 李澤倫
    procedure SetStreamCellWidth(Stream: TStream; HasDataNo: Integer);

    procedure CombineCell;

    procedure SplitCell;
    procedure VSplitCell(Number: Integer);
    function CanSplit: Boolean;

    function CountFcells(crow: Integer): Integer; //李澤倫

    procedure SetCellLines(bLeftLine, bTopLine, bRightLine, bBottomLine: Boolean;
      nLeftLineWidth, nTopLineWidth, nRightLineWidth, nBottomLineWidth: Integer);

    procedure SetCellDiagonal(NewDiagonal: UINT);
    procedure SetCellTextColor(NewTextColor: COLORREF);
    procedure SetCellColor(NewTextColor, NewBackColor: COLORREF);
    procedure SetCellBackColor(NewBackColor: COLORREF);

    procedure SetCellDispFormt(mek: string);
    procedure SetCellSumText(mek: string);

    procedure SetCellFont(CellFont: TLOGFONT);
    procedure SetCellAlign(NewHorzAlign, NewVertAlign: Integer);

    procedure SetCellAlignHorzAlign(NewHorzAlign: Integer);
    procedure SetCellAlignNewVertAlign(NewVertAlign: Integer);

    procedure SetMargin(nLeftMargin, nTopMargin, nRightMargin, nBottomMargin: Integer);
    function GetMargin: TRect;

    function getcellfont: TFont; // add wang hang song

    procedure UpdateLines;

    procedure FreeEdit; //取銷編輯狀態  李澤倫

    procedure StartMouseDrag(point: TPoint);
    procedure StartMouseSelect(point: TPoint; bSelectFlag: Boolean; shift_down: byte);
    procedure MouseMoveHandler(message: TMSG);

    // 選中區的操作
    function AddSelectedCell(Cell: TReportCell): Boolean;
    function RemoveSelectedCell(Cell: TReportCell): Boolean;
    procedure RemoveAllSelectedCell;

    function IsCellSelected(Cell: TReportCell): Boolean;
    function CellFromPoint(point: TPoint): TReportCell;

    property IsPreview: Boolean read FPreviewStatus write FPreviewStatus default False;
    property ReportScale: Integer read FReportScale write SetScale default 100;
    property IsNewTable: Boolean read FNewTable write FNewTable default True;
    property DataLine: Integer read FDataLine write FDataLine default 2147483647;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美成aⅴ人在线观看| 成人黄页毛片网站| 亚洲国产成人午夜在线一区| 99久久99久久精品免费观看| 日韩av成人高清| √…a在线天堂一区| 精品美女在线播放| 在线看不卡av| 成人h动漫精品一区二| 免费观看成人鲁鲁鲁鲁鲁视频| 中文字幕精品一区二区精品绿巨人| 欧美日本在线观看| 不卡区在线中文字幕| 久久99精品久久久久婷婷| 亚洲精品国产精品乱码不99| 久久综合av免费| 毛片av一区二区三区| 一区二区三区精品视频在线| 久久精品在线观看| 欧美一级久久久久久久大片| 色哟哟国产精品| 亚洲精品一卡二卡| 久久久99免费| 欧美成人在线直播| 欧美精品欧美精品系列| 日本高清无吗v一区| 国产一区二区三区黄视频 | 亚洲女子a中天字幕| 久久色视频免费观看| 日韩一区二区在线观看| 欧美乱妇15p| 欧美午夜影院一区| 亚洲福利视频一区二区| 亚洲另类春色国产| 中文欧美字幕免费| 欧美一卡二卡三卡四卡| 欧美日韩成人综合天天影院| 色婷婷av一区二区三区之一色屋| av在线不卡网| 91亚洲国产成人精品一区二三| av高清久久久| 色综合网站在线| 日本高清不卡视频| 日韩国产高清影视| 天堂久久一区二区三区| 香蕉av福利精品导航| 亚洲国产综合在线| 无吗不卡中文字幕| 日本aⅴ免费视频一区二区三区| 香蕉影视欧美成人| 亚洲国产精品尤物yw在线观看| 亚洲成人777| 三级不卡在线观看| 久久精品国产一区二区三| www久久久久| 久久综合99re88久久爱| 精品国产一区久久| 精品久久久久久亚洲综合网| 精品日韩一区二区三区| 国产调教视频一区| 久久久精品综合| 日本视频一区二区| 欧美日产国产精品| 成熟亚洲日本毛茸茸凸凹| 欧美日韩性生活| 偷窥少妇高潮呻吟av久久免费| 亚洲.国产.中文慕字在线| 亚洲电影激情视频网站| 国产福利91精品一区| 久久综合视频网| 欧美激情一区在线| 国产成人av一区二区三区在线 | 一级日本不卡的影视| 亚洲成a人v欧美综合天堂下载 | 亚洲国产精品视频| 毛片av中文字幕一区二区| 欧美日韩在线精品一区二区三区激情| 亚洲美女少妇撒尿| 欧美性欧美巨大黑白大战| 日韩av网站在线观看| 一本久道中文字幕精品亚洲嫩| 欧美日韩美女一区二区| 欧美一a一片一级一片| 午夜精品久久久久久久久久| 日韩电影在线免费观看| 午夜激情一区二区三区| 91国产免费观看| 91麻豆精品国产91久久久久久 | 一本大道久久a久久综合| 免费观看成人鲁鲁鲁鲁鲁视频| 色吧成人激情小说| 高清免费成人av| 精品国产免费久久| 香蕉加勒比综合久久| av电影在线观看一区| 亚洲精品一区二区三区福利| 亚洲欧美怡红院| 国产在线一区观看| 69精品人人人人| 亚洲午夜在线观看视频在线| 成人黄色免费短视频| 日韩三级免费观看| 午夜精品久久久久久久久| 成人激情开心网| 久久女同互慰一区二区三区| 日韩电影在线观看网站| 色综合久久66| 亚洲综合一区二区| 国产精品美女久久久久久久久| 亚洲午夜一区二区三区| 不卡的av在线播放| 国内精品国产成人国产三级粉色 | 久久婷婷综合激情| 亚洲精品v日韩精品| av不卡在线播放| 国产a区久久久| 久久久不卡网国产精品一区| 色婷婷综合激情| 欧美色图免费看| 色婷婷亚洲一区二区三区| 国产传媒日韩欧美成人| 激情图片小说一区| 六月丁香婷婷久久| 国产一区欧美一区| 久久久久久9999| 麻豆91在线观看| 国产精品久久久久久久久久久免费看 | 亚洲精品一卡二卡| 激情图区综合网| 国产调教视频一区| 91麻豆成人久久精品二区三区| 国产精品亚洲成人| 91小视频免费看| 99久久99久久精品免费观看| 成人激情黄色小说| 久久精品一区二区| 韩国女主播一区| 精品国产制服丝袜高跟| 精品一区二区精品| 日韩亚洲欧美中文三级| 蜜臀久久99精品久久久久久9| 91精品国模一区二区三区| 日韩精品色哟哟| 欧美美女网站色| 日日噜噜夜夜狠狠视频欧美人| 欧美日韩在线不卡| 五月天激情综合网| 日韩一级二级三级精品视频| 在线观看一区日韩| 久久99精品久久久久久动态图 | 国产精品夫妻自拍| 色婷婷亚洲综合| 成人av中文字幕| 欧美色涩在线第一页| 国产精品美女一区二区三区| 日本亚洲最大的色成网站www| 不卡的av电影在线观看| 久久综合九色综合97婷婷| 亚洲国产综合91精品麻豆| 成人精品视频一区| 精品国产免费久久| 麻豆国产欧美一区二区三区| 国产精品理论片| 国内精品视频666| 日韩三级视频在线看| 日韩激情一二三区| 国产精品初高中害羞小美女文| 国产无一区二区| 久久久美女艺术照精彩视频福利播放| 久久九九99视频| 亚洲女同女同女同女同女同69| 欧美日韩专区在线| 精品一二线国产| 欧美老女人在线| 午夜a成v人精品| 在线观看免费亚洲| 亚洲人成7777| 色94色欧美sute亚洲线路一ni| 久久精品视频网| 成人免费视频一区二区| 国产亚洲欧美一级| 成人精品gif动图一区| 国产精品三级视频| 一本在线高清不卡dvd| 日韩美女视频一区二区| 91捆绑美女网站| 亚洲成人手机在线| 日韩一区二区三区观看| 蜜臀久久99精品久久久画质超高清 | 亚洲精品一区二区三区精华液| 国产激情偷乱视频一区二区三区| 久久精品夜色噜噜亚洲aⅴ| 成人免费精品视频| 一区二区三区日本| 日韩欧美综合一区| 93久久精品日日躁夜夜躁欧美| 亚洲成人在线观看视频| 久久一区二区三区四区| 日本精品一区二区三区四区的功能| 午夜亚洲国产au精品一区二区|