本人傾精力,時間使用DELPHI開發了一套報表處理組件,適合各種軟件系統復雜的
報表處理功能,尤其是其提供的報表編輯,打印預覽及數據導入接口等功能可以迅
速滿足客戶提出的有關報表處理的各種需求。
1.設計原則:
1.1 由抽象到具體的類層次管理簡化報表處理對象的復雜性。
1.2 報表編輯、原始數據導入到打印預覽一體化處理流程。
1.3 靈活的數據訪問接口,程序代碼與報表設計無關。
2.主要功能:
2.1 類EXCEL的設計界面,提供多種可編輯對象,包括普通文本、公式計算、數據 導入等不同屬性單元格,以及圖形、圖像、圖表、文本框、數據視圖、定制表
格等對象。
2.2 客戶可以自由設計定制報告單格式,如普通式、彩色印刷式、圖表一體式等。
2.3 美觀的報表預覽器,多種打印輸出格式。
3.應用對象:
3.1 電網監控系統報表處理分系統(各種運行日報,月報,年報等)。
3.2 醫院管理信息系統(各種統計分析報表)。
3.3 酒店管理信息系統(各種查詢統計報表)。
3.4 檢驗管理系統(各種格式報告單)。
4.申明:
本人對本套組件擁有全部自主版權。
5.類樹:
{ Forward declarations }
TGridCoordinate = class;
TGridCoordinates = class;
TCustomObject = class; {Abstract Class}
{1}
TActiveObject = class;
TActiveObjectClass = class of TActiveObject;
TGridCellObject = class;
TGridCellGroup = class;
//TDataViewParams = class
TDataView = class;
TDataTable = class;
TTileDataView = class;
TCascadeBand = class;
TCascadeBands = class;
TCascadeDataView = class;
TPlate = class;
TPlateClass = class of TPlate;
TChartPlate = class;
TImagePlate = class;
TTextPlate = class;
TActiveObjects = class;
TSelectedObjects = class;
{2}
TSparsePointerArray = class;
TSparseList = class;
TGridCellText = class;
TGridCellFrame = class;
TGridCell = class;
TGridCellClass = class of TGridCell;
TTextCell = class;
TDBCell = class;
TFormulaCell = class;
TRowCells = class;
TGridCells = class;
TGridCellEdit = class;
TSelectedCoord = class;
TSelectedCoords = class;
TTitleWindow = class;
TColumnWindow = class;
TRowWindow = class;
TClientWindow = class;
TTool = class;
{TSpreadsheetTool = class;}
TCoolScrollBar = class;
TCoolScrollControl = class;
TReportGrid = class;
歡迎公司或個人與我聯系。
也希望各位同仁多多指教。
Email:[email protected]。
6.附:
一個可以書寫任意文本的Procedure,包括旋轉字體。
TTextAlign = (taLeft,taRight,taHorzCenter,
taTop,taBottom,taVertCenter);
TTextAligns = set of TTextAlign;
TTextControl = (tcNormal,tcWordBreak,tcSelfAdapt,tcCalcRect);
TTextDirection = tdVertChinese..90;{Angles of text}
procedure WriteText(ACanvas: TCanvas;var ARect: TRect;AText: string; Aligns: TTextAligns;
Control: TTextControl;Direction: TTextDirection{; BeErase: Boolean = TRUE});
var S: String;
TempStr: WideString;
ColorRef: TColorRef;
DitheredFlag: Boolean;
LogicFont: TLogFont;
Scaler: Extended;
I,J,X,Y: Integer;
Interval,MaxExtent:Integer;
TextMetric: TTextMetric;
TempExtent: TSize;
TempRect: TRect;
procedure SetLogicFont(W: Integer = 0;H: Integer = 0);
begin
with LogicFont,ACanvas.Font do
begin
if H = 0 then lfHeight := Height
else lfHeight := H;
lfWidth := W;
lfEscapement := 10*Direction;
lfOrientation := 10*Direction;
lfWeight := FW_NORMAL;//FW_BOLD;
lfItalic := BYTE(fsItalic in Style);
lfUnderline := BYTE(fsUnderline in Style);
lfStrikeOut := BYTE(fsStrikeOut in Style);
lfCharSet := Charset;
lfOutPrecision := OUT_TT_PRECIS;
lfClipPrecision := CLIP_DEFAULT_PRECIS;
lfQuality := DEFAULT_QUALITY;
lfPitchAndFamily := DEFAULT_PITCH or FF_DONTCARE;
StrCopy(lfFaceName,PChar(Name));
end;
ACanvas.Font.Handle := Windows.CreateFontIndirect(LogicFont);
end;
procedure DrawDitheredText(BeginX,BeginY: Integer; TheText: String);
begin
DrawBitmap.Canvas.Lock; {Must have it !!}
try
with DrawBitmap do
begin
//Windows.ExtTextOut(Handle,0,0,ETO_OPAQUE,@TempRect, Nil,0,Nil);
Windows.ExtTextOut(Canvas.Handle, BeginX - ARect.Left , BeginY - ARect.Top,
{ETO_OPAQUE or }ETO_CLIPPED, @TempRect, PChar(TheText), Length(TheText),Nil);
ACanvas.CopyRect(ARect,Canvas,TempRect);
end;
finally
DrawBitmap.Canvas.Unlock;
end;
end;
begin
{if BeErase then
if ACanvas.Brush.Style <> bsSolid then
begin
ACanvas.Pen.Style := psClear;
ACanvas.Rectangle(ARect);
ACanvas.Pen.Style := psSolid;
end else ACanvas.FillRect(ARect);
//Windows.ExtTextOut(ACanvas.Handle,0,0,ETO_OPAQUE,@ARect, Nil,0,Nil);
}
if AText = then Exit;
ColorRef := ColorToRGB(ACanvas.Brush.Color);
DitheredFlag := //(ACanvas = Printer.Canvas) or
(Windows.GetNearestColor(ACanvas.Handle, ColorRef) <> ColorRef);
if DitheredFlag then
begin
with DrawBitmap,ARect do { Use offscreen bitmap to eliminate flicker and }
begin { brush origin tics in painting / scrolling. }
Width := Max(Width, Right - Left);
Height := Max(Height, Bottom - Top);
Canvas.Font := ACanvas.Font;
Canvas.Brush := ACanvas.Brush;
Canvas.Brush.Style := bsSolid;
TempRect := Rect(0, 0, Right - Left, Bottom - Top);
Windows.ExtTextOut(Canvas.Handle,0,0,{ETO_OPAQUE or }ETO_CLIPPED,@TempRect, Nil,0,Nil)
end;
end;
{Prepare parameters for below process}
case Direction of
tdVertChinese:
begin
{More special,use the equivalent width font}
ACanvas.Font.Pitch := fpFixed;
Scaler := 1;
MaxExtent := ARect.Bottom - ARect.Top ;
end;
0:{Horizontal}
begin
Scaler := 1;
MaxExtent := ARect.Right - ARect.Left ;
end;
1..45:
begin
SetLogicFont;
&