转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 软件开发 >> Delphi程序 >> 正文
报表处理组件 BY DELPHI         ★★★★

报表处理组件 BY DELPHI

作者:闵涛 文章来源:闵涛的学习笔记 点击数:2863 更新时间:2009/4/23 18:44:18

本人倾精力,时间使用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:lmis@sina.com。

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;
      Scaler :=  Cos(Direction * Pi / 180);
      MaxExtent := Floor((ARect.Right - ARect.Left)/Scaler);
    end;
    46..90:
    begin
      SetLogicFont;
      Scaler  := Sin(Direction * Pi / 180);
      MaxExtent := Floor((ARect.Bottom - ARect.Top)/ Scaler);
    end;
    -90..-46:
    begin
      SetLogicFont;
      Scaler  := Sin(-Direction * Pi / 180);
      MaxExtent := Floor((ARect.Bottom - ARect.Top)/ Scaler);
    end;
    -45..-1:
    begin
      SetLogicFont;
      Scaler :=  Cos(-Direction * Pi / 180);
      MaxExtent := Floor((ARect.Right - ARect.Left)/Scaler);
    end;
  end;

  {Get control text}
  case Control of
    tcWordBreak:
    begin
      J := 0;
      X := 0;
      TempStr := WideString(AText);
      for I := 1 to Length(WideString(AText)) do
      begin
        S := WideString(AText)[I];
        if (S = #13) or (S = #10) then
        J := 0
        else begin
          Windows.GetTextExtentPoint32(ACanvas.Handle, PChar(S), Length(S), TempExtent);
          //TempExtent := ACanvas.TextExtent(S);
          if Direction = tdVertChinese then
          begin
            Inc(J,TempExtent.CY);
            if J > MaxExtent then
            begin
              J := TempExtent.CY;
              Insert(#13#10,TempStr,I+X); {Soft return}
              Inc(X,2);
            end;
          end else
          begin
 

[1] [2] [3] [4]  下一页


[系统软件]交叉编译sshd for IXP425 ARM  Platform by MVL 3…  [Delphi程序]Delphi Winsock Hooking Example by Aphex
[Delphi程序]Delphi for .Net 编译器预览 - by John Kaster  [Delphi程序]如何给ActiveX数字签名(Step by Step, Delphi)
[Delphi程序]Simple Programming Tip #1 by Charlie Calvert  [Delphi程序]Delphi NT Service Skeleton by Aphex
[Web开发]Step By Step 制作XML的Javascript树形目录  [Web开发]ASP.NET组件编程step by step
[Web开发]ASP.NET组件设计Step by Step(8)  [Web开发]ASP.NET组件设计Step by Step(6)
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · C语言系列  · VB.NET程序
    · JAVA开发  · Delphi程序
    · 脚本语言
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台