home *** CD-ROM | disk | FTP | other *** search
- unit PPage;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- DBTables, DREng, StdCtrls, DRList;
-
- type
- TFormPrintPage = class(TForm)
- DuckReport: TDuckReport;
- Memo1: TMemo;
- BPreview: TButton;
- procedure BPreviewClick(Sender: TObject);
- procedure DuckReportBeforePrintGroup(Sender: TObject; Canvas: TCanvas;
- RcPaper, RcGroup: TRect; SectionStyle: TDRSectionStyle;
- StField: String);
- procedure DuckReportAfterPrintPage(Sender: TObject; Canvas: TCanvas;
- RcPaper: TRect; lPageCount: Integer);
- private
- bPaint: Boolean;
- RcDetail: TRect;
- public
- { Public declarations }
- end;
-
- var
- FormPrintPage: TFormPrintPage;
-
- implementation
-
- {$R *.DFM}
- Procedure TFormPrintPage.BPreviewClick(Sender: TObject);
- Begin
- bPaint := FALSE;
- RcDetail := Rect (-1, -1, -1, -1);
- DuckReport.OpenFile;
- DuckReport.OpenDB;
- DuckReport.Preview;
- End;
- Procedure TFormPrintPage.DuckReportBeforePrintGroup(Sender: TObject;
- Canvas: TCanvas; RcPaper, RcGroup: TRect; SectionStyle: TDRSectionStyle;
- StField: String);
- Begin
- if SectionStyle <> gtDetial Then Exit;
-
- { Find Rect of Detial}
- if (RcDetail.Left = -1) or (RcDetail.Left > RcGroup.Left) Then
- RcDetail.Left := RcGroup.Left;
- if (RcDetail.Top = -1) or (RcDetail.Top > RcGroup.Top) Then
- RcDetail.Top := RcGroup.Top;
- if (RcDetail.Right = -1) or (RcDetail.Right < RcGroup.Right) Then
- RcDetail.Right := RcGroup.Right;
- if (RcDetail.Bottom = -1) or (RcDetail.Bottom < RcGroup.Bottom) Then
- RcDetail.Bottom := RcGroup.Bottom;
- End;
- Procedure TFormPrintPage.DuckReportAfterPrintPage(Sender: TObject;
- Canvas: TCanvas; RcPaper: TRect; lPageCount: Integer);
- Begin
- Canvas.Pen.Color := clBlack;
- Canvas.Pen.Width := 5;
- Canvas.Pen.Style := psSolid;
- Canvas.Brush.Style := bsClear;
- Canvas.RoundRect (RcDetail.Left, RcDetail.Top,
- RcDetail.Right, RcDetail.Bottom, 20, 20);
- End;
-
- End.
-