📄 unit1.pas
字号:
unit Unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, SctBtn, SctVar, AcePage, SctRep,
SctCtrl, DB, DBTables, ExtCtrls;
type
TForm1 = class(TForm)
SctReport1: TSctReport;
ReportPage: TSctGrouppage;
ReportHeaderBand: TSctBand;
ReportHeaderBandlevel: TSctLevel;
PageHeaderBand: TSctBand;
PageHeaderBandlevel: TSctLevel;
DetailBand: TSctBand;
DetailBandlevel: TSctLevel;
PageFooterBand: TSctBand;
PageFooterBandlevel: TSctLevel;
ReportFooterBand: TSctBand;
ReportFooterBandlevel: TSctLevel;
DataSource1: TDataSource;
Table1: TTable;
Sctvarlabel1: TSctvarlabel;
svarDateTime: TSctDateTimeVar;
svarPage: TSctPageVar;
DataSourceGuide: TSctDataSourceGuide;
table1CustNoVar: TSctDBVar;
table1CompanyVar: TSctDBVar;
table1Addr1Var: TSctDBVar;
table1Addr2Var: TSctDBVar;
table1CityVar: TSctDBVar;
table1StateVar: TSctDBVar;
table1ZipVar: TSctDBVar;
table1CountryVar: TSctDBVar;
table1PhoneVar: TSctDBVar;
table1FAXVar: TSctDBVar;
table1TaxRateVar: TSctDBVar;
table1ContactVar: TSctDBVar;
table1LastInvoiceDateVar: TSctDBVar;
SctReportButton1: TSctReportButton;
Sctvarlabel2: TSctvarlabel;
varlabel: TSctvarlabel;
varlabel1: TSctvarlabel;
varlabel2: TSctvarlabel;
SctShape1: TSctShape;
procedure DetailBandBeforePrint(Band: TSctBand);
procedure SctReport1BeforePrint(Report: TSctReport);
procedure ReportPageBeforeNewPage(Page: TSctPage;
var DoNewPage: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Col, MarkYPos: Integer;
LastRow: Boolean;
implementation
{$R *.DFM}
procedure TForm1.DetailBandBeforePrint(Band: TSctBand);
begin
band.page.xPos := Trunc(band.page.pagesetup.LeftMargin *
band.page.pixelsperinch) + Col * 200;
if (Col > 0) and (not LastRow) then band.page.YPos := MarkYPos;
Inc(Col);
if Col > 2 then Col := 0;
MarkYPos := band.page.YPos;
end;
procedure TForm1.SctReport1BeforePrint(Report: TSctReport);
begin
Col := 0;
LastRow := False;
end;
procedure TForm1.ReportPageBeforeNewPage(Page: TSctPage;
var DoNewPage: Boolean);
begin
DoNewPage := (Col = 0);
if not DoNewPage then Page.YPos := MarkYPos
else Page.xPos := Trunc(page.pagesetup.LeftMargin *
page.pixelsperinch);
LastRow := not DoNewPage;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -