📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
SctVar, ExtCtrls, SctRep, StdCtrls, Buttons, SctBtn, SctCtrl, AcePage,
Db, DBTables;
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;
svarDateTime: TSctDateTimeVar;
svarPage: TSctPageVar;
DataSourceGuide: TSctDataSourceGuide;
table1Species_NoVar: TSctDBVar;
table1CategoryVar: TSctDBVar;
table1Common_NameVar: TSctDBVar;
table1Species_NameVar: TSctDBVar;
table1Length__cm_Var: TSctDBVar;
table1Length_InVar: TSctDBVar;
table1NotesVar: TSctDBVar;
table1GraphicVar: TSctDBVar;
varlabel: TSctvarlabel;
SctReportButton1: TSctReportButton;
procedure DetailBandBeforePrint(Band: TSctBand);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.DetailBandBeforePrint(Band: TSctBand);
var
Spot, currY, NewY, posStart, lineHeight, lineCount: Integer;
begin
currY := TSctPage(Band.Parent).yPos;
{This example forces the detail band to print on one of}
{22 available lines on a preprinted form}
{The first line is at 4.79 inches from the top}
{each line is 1/4 inch tall}
posStart := TRUNC(TSctPage(Band.Parent).PixelsPerInch * 4.79);
lineHeight := TRUNC(TSctPage(Band.Parent).PixelsPerInch * 0.25);
lineCount := 22;
Spot := 0;
NewY := PosStart;
While (spot < lineCount) and (NewY < currY)
do begin
NewY := NewY + LineHeight;
Spot := Spot + 1;
end;
if Spot = LineCount then NewY := 20000; {force new page}
TSctPage(Band.Parent).yPos := NewY;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -