动态创建Fastreport(delphi)
动态创建Fastreport分以下几个步骤:
1.首先清空Fastreport,定义全局变量,并加载数据集
frReport.Clear;
frReport.DataSets.Add(frxDBDataset1);
DataHeight :=28;
DataWidth :=80;
FirstTop := 50;
FirstLeft := 15;
2.创建frxReportPage,并设置纸张大小
Page := TfrxReportPage.Create(frReport);
Page.CreateUniqueName;
page.Orientation := poLandscape;
Page.SetDefaults; //默认大小
//Page.PaperWidth := 210;
//Page.PaperHeight := 297;
//以下为动态设置纸张大小
{if
(qryPrn.FieldCount-4)<=6 then //当列小于6
begin
Page.PaperWidth := 210;
Page.PaperHeight := 279.4;
page.Orientation := poPortrait;
end
else
begin
page.Orientation := poLandscape;
iWidth := 40+85+90+(qryPrn.FieldCount-4)*84+30;
//fr01cm=3.77953;
if iWidth<297*fr01cm then
//fr01cm为frxClass中定义的常量,为每毫米像素值,或PerMillPix
:= 25.38/Screen.PixelsPerInch;(25.38为每英寸毫米数)
begin
Page.PaperSize :=DMPAPER_A4; //设置为A4,因为激光打印机不支持自定义纸张的横打
end
else
begin
Page.PaperWidth :=iWidth/fr01cm;
Page.PaperHeight := 210;
end;
end;}
3.生成PageBand,并指定高度
Band :=
TfrxPageHeader.Create(Page); //页首
Band.Top := 10;
Band.Height := 150;
BandFoot := TfrxColumnFooter.Create(Page); //页脚
BandFoot.Top := 10;
BandFoot.Height := 50;
4.画页脚栏
//画操作员
memFoot := TfrxMemoView.Create(BandFoot);
with memFoot do
begin
CreateUniqueName;
HAlign := haLeft;
VAlign := vaCenter;
Memo.Text := '操作员:程序员';
SetBounds(40, 10, 150, 20);
ParentFont := False;
Font.Name := '宋体';
Font.Size := 10;
end;
//画打印时间
memFoot := TfrxMemoView.Create(BandFoot);
with memFoot do
begin
CreateUniqueName;
Align := baLeft;
HAlign := haLeft;
VAlign := vaCenter;
Memo.Text := '打印时间:' + FormatDateTime('yyyy-mm-dd hh:mm:ss', Now);
SetBounds(280, 10, 270, 20);
ParentFont := False;
Font.Name := '宋体';
Font.Size := 11;
end;
5.画标题栏
//画标题
Memo := TfrxMemoView.Create(Band);
with Memo do
begin
CreateUniqueName;
Align := baCenter;
Memo.Text := '******余额汇总表';
Frame.Typ :=[ftBottom];
Frame.BottomLine.Style :=fsDouble; //行类型
Top := FirstTop;
Height := 30;
AutoWidth :=True;
HAlign := haCenter;
ParentFont := False;
Font.Name := '黑体';
Font.Size := 16;
end;
//画单位
Memo := TfrxMemoView.Create(Band);
with Memo do
begin
CreateUniqueName;
HAlign := haLeft;
VAlign := vaCenter;
Memo.Text := '单位:************';
FirstTop := FirstTop + 40;
FirstWidth := 200;
FirstHeight := 30;
SetBounds(40, FirstTop, FirstWidth, FirstHeight);
ParentFont := False;
Font.Name := '宋体';
Font.Size := 10;
end;
//画日期
Memo := TfrxMemoView.Create(Band);
with Memo do
begin
CreateUniqueName;
Align := baLeft;
VAlign := vaCenter;
HAlign := haLeft;
Memo.Text := '日期:' + FormatDateTime('yyyy-mm-dd', Date);
FirstWidth := 10 + FirstWidth + 200;
FirstLeft := FirstLeft + FirstWidth;
SetBounds(FirstLeft, FirstTop, 200, FirstHeight);
ParentFont := False;
Font.Name := '宋体';
Font.Size := 10;
end;
//画页码
Memo := TfrxMemoView.Create(Band);
with Memo do
begin
CreateUniqueName;
Align := baLeft;
HAlign := haLeft;
VAlign := vaCenter;
Memo.Text := '第[Page#]/[TotalPages#]页'; //[]中括起来的是FastReport系统变量
FirstWidth := 10 + FirstWidth;
FirstLeft := FirstLeft + 200;
SetBounds(FirstLeft, FirstTop, 100, FirstHeight);
HAlign := haCenter;
ParentFont := False;
Font.Name := '宋体';
Font.Size := 10;
end;
for i := 1 to qryPrn.FieldCount - 4 do
begin
//画数据集的标题
Memo := TfrxMemoView.Create(Band);
Memo.CreateUniqueName;
Memo.ParentFont := False;
Memo.Font.Name := '宋体';
Memo.Font.Size := 10;
Memo.Text := qryPrn.Fields[i + 3].FieldName;
Memo.Frame.Typ := [ftTop, ftBottom, ftRight];
Memo.SetBounds(220 + (i - 1) * DataWidth, Band.Height -
DataHeight, DataWidth, DataHeight);
Memo.HAlign := haCenter;
Memo.VAlign := vaCenter;
end;
6.画数据集
DataBand := TfrxMasterData.Create(Page);
DataBand.CreateUniqueName;
DataBand.DataSet := frxDBDataset1;
DataBand.Top := 200;
DataBand.Height := DataHeight;
Memo1 := TfrxMemoView.Create(DataBand);
with Memo1 do
begin
CreateUniqueName;
ParentFont := False;
SetBounds(30, 0, 90, DataHeight);
VAlign := vaCenter;
HAlign := haLeft;
Font.Name := '宋体';
Font.Size := 10;
DataSet := frxDBDataset1;
DataField := 'locus';
Frame.Typ := [ftRight, ftBottom, ftLeft];
end;
Memo1 := TfrxMemoView.Create(DataBand);
with Memo1 do
begin
CreateUniqueName;
ParentFont := False;
SetBounds(120, 0, 100, DataHeight);
VAlign := vaCenter;
HAlign := haRight;
Font.Name := '宋体';
Font.Size := 10;
DataSet := frxDBDataset1;
DataField := 'TotalMoney';
Frame.Typ := [ftRight, ftBottom]; //加上右边和底部的边框
end;
for i := 1 to qryPrn.FieldCount - 4 do
begin
Memo1 := TfrxMemoView.Create(DataBand);
Memo1.CreateUniqueName;
Memo1.ParentFont := False;
Memo1.SetBounds(220 + (i - 1) * DataWidth, 0, DataWidth,
DataHeight);
Memo1.DisplayFormat.DecimalSeparator := '.';
//Memo1.ExpressionDelimiters := ',';
//Memo1.DisplayFormat.FormatStr := '%2.2f'; 定义显示格式
//Memo1.DisplayFormat.Kind := fkNumeric;
Memo1.VAlign := vaCenter;
Memo1.HAlign := haRight;
Memo1.Font.Name := '宋体';
Memo1.Font.Size := 10;
Memo1.DataSet := frxDBDataset1;
Memo1.DataField := qryPrn.Fields[i + 3].FieldName;
Memo1.Frame.Typ := [ftRight, ftBottom];
end;
7.显示
frReport.PrepareReport();
frReport.ShowReport();
8.将以上代码用函数表示
(1)定义
TBandType=(PageHeader,PageFooter);
procedure
CreatePage(var Page:TfrxReportPage;frxReport:TfrxReport;iWidth,iHeight:Double;pDirect:TPrinterOrientation);
procedure CreateBand(var
band:TfrxBand;Page:TfrxReportPage;iTop,iHeight:Double;BandType:TBandType);
procedure CreateDataBand(var
band:TfrxMasterData;Page:TfrxReportPage;DbSet:TfrxDBDataset;iTop,iHeight:Integer);
procedure CreateMemoData(var memView: TfrxMemoView; Band:
TfrxBand;
iLeft, iTop, iWidth, iHeight: Extended;
fontname: string; fontsize: Integer;
Halign: TfrxHAlign; Valign: TfrxVAlign; frxData:
TfrxDBDataset; DField: string;
FrameType: TfrxFrameTypes; Delimiters, ForStr:
string; fkKind: TfrxFormatKind);
procedure CreateMemo(var memView: TfrxMemoView; Band:
TfrxBand;
iLeft, iTop, iWidth, iHeight: Extended;
fontname: string; fontsize: Integer;
Halign: TfrxHAlign; Valign: TfrxVAlign; FrameType:
TfrxFrameTypes; sText: string);
(2)实现
procedure
TForm1.CreatePage(var Page: TfrxReportPage;
frxReport: TfrxReport; iWidth, iHeight: Double;
pDirect: TPrinterOrientation);
begin
Page := TfrxReportPage.Create(frxReport);
Page.CreateUniqueName;
Page.PaperWidth :=iWidth;
Page.Height :=iHeight;
Page.Orientation :=pDirect;
end;
procedure
TForm1.CreateBand(var band: TfrxBand; Page: TfrxReportPage; iTop,
iHeight:Double;BandType:TBandType);
begin
case BandType of
PageHeader: band :=TfrxPageHeader.Create(Page);
PageFooter: band :=TfrxPageFooter.Create(Page);
end;
band.CreateUniqueName;
band.Top :=iTop;
band.Height :=iHeight;
end;
procedure
TForm1.CreateDataBand(var band: TfrxMasterData;
Page: TfrxReportPage; DbSet: TfrxDBDataset; iTop, iHeight: Integer);
begin
band :=TfrxMasterData.Create(Page);
band.CreateUniqueName;
band.DataSet := DbSet;
band.Top :=iTop;
band.Height :=iHeight;
end;
procedure
TForm1.CreateMemo(var memView: TfrxMemoView; Band: TfrxBand;
iLeft, iTop, iWidth, iHeight: Extended; fontname: string;
fontsize: Integer; Halign: TfrxHAlign; Valign: TfrxVAlign;
FrameType: TfrxFrameTypes; sText: string);
begin
memView := TfrxMemoView.Create(Band);
memView.CreateUniqueName;
memView.ParentFont := False;
memView.Font.Name := fontname;
memView.Font.Size := fontsize;
memView.SetBounds(iLeft, iTop, iWidth, iHeight);
memView.HAlign := Halign;
memView.VAlign := Valign;
memView.Frame.Typ := FrameType;
memView.Memo.Text := sText;
end;
procedure
TForm1.CreateMemoData(var memView: TfrxMemoView; Band: TfrxBand;
iLeft, iTop, iWidth, iHeight: Extended; fontname: string;
fontsize: Integer; Halign: TfrxHAlign; Valign: TfrxVAlign;
frxData: TfrxDBDataset; DField: string; FrameType: TfrxFrameTypes;
Delimiters, ForStr: string; fkKind: TfrxFormatKind);
begin
memView := TfrxMemoView.Create(Band);
memView.CreateUniqueName;
memView.ParentFont := False;
memView.Font.Name := fontname;
memView.Font.Size := fontsize;
memView.SetBounds(iLeft, iTop, iWidth, iHeight);
memView.HAlign := Halign;
memView.VAlign := Valign;
memView.DataSet := frxData;
memView.DataField := DField;
memView.Frame.Typ := FrameType;
memView.ExpressionDelimiters := Delimiters;
memView.DisplayFormat.FormatStr := ForStr;
memView.DisplayFormat.Kind := fkKind;
end;
(3)引用代码
const
arrFields:array[1..12,1..2] of string=(('Quantity_Start','数量'),('Expense_Start','金额'),
('Quantity_Buy_Add','数量'),('Quantity_Buy_Add','金额'),
('Quantity_Other_Add','数量'),('Expense_Other_Add','金额'),
('Quantity_Out_Reduce','数量'),('Expense_Out_Reduce','金额'),
('Quantity_Other_Reduce','数量'),('Expense_Other_Reduce','金额'),
('Quantity_End','数量'),('Expense_End','金额')
);
var
FirstTop, FirstWidth, FirstHeight, i, DataWidth, DataHeight, MlWidth:
Integer;
Page: TfrxReportPage;
BandHeader, BandFoot: TfrxBand;
DataBand: TfrxMasterData;
Memo, Memo1, memFoot: TfrxMemoView;
iLeft, iWidth, iLeft1: Integer;
PerMillPix: Double;
iFont: Integer;
haAl: TfrxHAlign;
MemArray: array[0..4] of TfrxMemoView;
MemArray1, MemDataArray: array[0..12] of TfrxMemoView;
MemArray2, MemArray3: array[0..3] of TfrxMemoView;
frx:TfrxComponent;
begin
frReport.Clear;
iFont := iFont10;
frxDBDataset1.DataSet := qryPrn;
frReport.DataSets.Add(frxDBDataset1);
CreatePage(Page, frReport, 210, 279.4, poLandscape);
//fr01cm :=3.77953;
DataHeight := 25; //DataHeight*3为栏首高度(目录高度)
MlWidth := 84; //目录宽度
DataWidth := 40;
FirstTop := 40;
FirstHeight := 30;
iLeft := 60;
iLeft1 := 40;
CreateBand(BandHeader, Page, 10, 220, PageHeader);
CreateBand(BandFoot, Page, 10, 50, PageFooter);
//画操作员
CreateMemo(memFoot, BandFoot, 65, 10, 150, 20, FName, iFont, haLeft,
vaCenter,
[], '操作员:'+IGlobalVar.GetUserName);
//画打印时间
CreateMemo(memFoot, BandFoot, 280, 10, 270, 20, FName, iFont, haLeft,
vaCenter,
[], '打印时间:' + FormatDateTime('yyyy-mm-dd hh:mm:ss', Now));
//画标题
Memo := TfrxMemoView.Create(BandHeader);
with Memo do
begin
CreateUniqueName;
Align := baCenter;
Memo.Text := '**********汇总表';
Frame.Typ := [ftBottom];
Frame.BottomLine.Style := fsDouble;
Top := FirstTop;
Height := 24;
AutoWidth := True;
HAlign := haCenter;
ParentFont := False;
Font.Name := '黑体';
Font.Size := 16;
end;
//画单位
FirstTop := FirstTop + 40;
FirstWidth := 150;
CreateMemo(MemArray[0], BandHeader, 65, FirstTop, FirstWidth,
FirstHeight, FName, iFont, haLeft,
vaCenter,
[], '单位:'+IGlobalVar.GetUnitID);
//画日期
CreateMemo(MemArray[1], BandHeader, 128, MemArray[0].Top,
270, FirstHeight, FName, iFont, haLeft, vaCenter,
[], '日期:' +
FormatDateTime('yyyy年mm月dd日', Date) + '至' +
FormatDateTime('yyyy年mm月dd日', Date));
//画仓库
FirstWidth := 170;
CreateMemo(MemArray[2], BandHeader, MemArray[0].Left, MemArray[0].Top +
20, FirstWidth,
FirstHeight, FName, iFont, haLeft, vaCenter,
[], '仓库:'+LcbWh.Text);
//画分类方法
FirstWidth := 10 + FirstWidth;
CreateMemo(MemArray[3], BandHeader, MemArray[1].Left, MemArray[2].Top,
200, FirstHeight, '宋体',
iFont, haLeft, vaCenter,
[], '分类方法:'+lcb1.Text);
//画页码
FirstWidth := 10 + FirstWidth;
CreateMemo(MemArray[4], BandHeader, MemArray[3].Left + MemArray[3].Width
+ 100, MemArray[2].Top,
100, FirstHeight, FName, iFont, haLeft, vaCenter,
[], '第[Page#]页 共[TotalPages#]页');
//画栏标题
iWidth := 32 * Pix10; //14个汉字(28字符)所用的像素值
CreateMemo(MemArray1[0], BandHeader, iLeft, BandHeader.Height -
DataHeight * 3, iWidth, DataHeight
* 3, FName, iFont,
haCenter, vaCenter, [ftTop, ftRight, ftBottom, ftLeft], '目录');
iLeft := iLeft + iWidth;
for i := 1 to 12 do
begin
if (i = 1) or (i = 2) or (i = 11) or (i = 12) then
CreateMemo(MemArray1[i], BandHeader, MemArray1[i
- 1].Left + MemArray1[i - 1].Width,
BandHeader.Height -
DataHeight * 2, GetWidth(i),
DataHeight * 2,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], arrFields[i, 2])
else
CreateMemo(MemArray1[i], BandHeader, MemArray1[i
- 1].Left + MemArray1[i - 1].Width,
BandHeader.Height -
DataHeight, GetWidth(i),
DataHeight,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], arrFields[i, 2]);
end;
CreateMemo(Memo, BandHeader, MemArray1[3].Left,MemArray1[1].Top,
MemArray1[3].Width+MemArray1[4].Width,DataHeight,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], '外购');
CreateMemo(Memo, BandHeader, MemArray1[5].Left,MemArray1[1].Top,
MemArray1[5].Width+MemArray1[6].Width,DataHeight,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], '其它');
CreateMemo(Memo, BandHeader, MemArray1[7].Left,MemArray1[1].Top,
MemArray1[7].Width+MemArray1[8].Width,DataHeight,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], '报废');
CreateMemo(Memo, BandHeader, MemArray1[9].Left,MemArray1[1].Top,
MemArray1[9].Width+MemArray1[10].Width,DataHeight,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], '其它');
CreateMemo(Memo, BandHeader, MemArray1[1].Left,MemArray1[0].Top,
MemArray1[1].Width+MemArray1[2].Width,DataHeight,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], '期初余额');
CreateMemo(Memo, BandHeader, MemArray1[3].Left,MemArray1[0].Top,
MemArray1[3].Width+MemArray1[4].Width+MemArray1[5].Width+MemArray1[6].Width,DataHeight,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], '本期增加');
CreateMemo(Memo, BandHeader, MemArray1[7].Left,MemArray1[0].Top,
MemArray1[7].Width+MemArray1[8].Width+MemArray1[9].Width+MemArray1[10].Width,DataHeight,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], '本期减少');
CreateMemo(Memo, BandHeader, MemArray1[11].Left,MemArray1[0].Top,
MemArray1[11].Width+MemArray1[12].Width,DataHeight,
FName, iFont, haCenter, vaCenter,
[ftTop, ftBottom, ftRight], '期末余额');
CreateDataBand(DataBand, Page, frxDBDataset1, 200, DataHeight);
iWidth := 85;
CreateMemoData(MemDataArray[0], DataBand, MemArray1[0].Left, 0,
MemArray1[0].Width, DataHeight,
FName, iFont, haLeft, vaCenter,
frxDBDataset1, 'contents', [ftRight, ftBottom, ftLeft], '',
'', fkText);
frReport.Script.Clear;
frReport.ScriptLanguage :='PascalScript';
frReport.ScriptText.LoadFromFile('C:\fr_script.pas');
MemDataArray[0].OnBeforePrint :='MemoOnBeforePrint';
//动态定义OnBeforePrint事件
iLeft1 := iLeft1 + iWidth;
for i := 1 to 12 do
begin
if Odd(i) then
CreateMemoData(MemDataArray[i], DataBand,
MemArray1[i].Left, 0, MemArray1[i].Width,
DataHeight,
FName, iFont, haCenter, vaCenter,
frxDBDataset1, arrFields[i, 1],
[ftRight, ftBottom], '', '', fkText)
else
CreateMemoData(MemDataArray[i], DataBand,
MemArray1[i].Left, 0, MemArray1[i].Width,
DataHeight,
FName, iFont, haRight, vaCenter,
frxDBDataset1, arrFields[i, 1],
[ftRight, ftBottom], ',', '%2.2n',
fkNumeric);
end;
frReport.PrepareReport();
frReport.ShowReport();
end;
C:\fr_script.pas中写入脚本
procedure
MemoOnBeforePrint(Sender: TfrxComponent);
begin
if Length(TfrxMemoView(Sender).Memo.Text)>10 then
begin
TfrxMemoView(Sender).Memo.Text
:=Trim(TfrxMemoView(Sender).Memo.Text);
TfrxMemoView(Sender).HAlign :=haLeft;
//TfrxMemoView(Sender).VAlign
:=VaTop;
end;
end;
begin
end.
动态创建Fastreport(delphi)的更多相关文章
- delphi里动态创建AlphaControls实现换肤
AlphaControls是一套Delphi下的优秀的皮肤vcl控件.几年前,一般用得比较多的是vclskin,使用很方便,可惜这套2010年已经停止维护了.后来就看到更多的人开始推崇AlphaCon ...
- Delphi动态创建组件,并释放内存
开发所用delphi版本是xe2,效果图如下: 代码如下: ---------------------------------------------------------------------- ...
- Delphi中动态创建窗体有四种方式
Delphi中动态创建窗体有四种方式,最好的方式如下: 比如在第一个窗体中调用每二个,主为第一个,第二个设为动态创建 Uses Unit2; //引用单元文件 procedure TForm1.But ...
- 在DELPHI中动态创建控件以及控件的事件
在DELPHI中我们经常要动态的创建控件以及控件的事件.例如,我们可能想根据程序需要动态的创建一些Tshape组件来创建某个图形,并使得在鼠标移动上去之后可以完成某些操作.这一般需要需要三步: 生成一 ...
- Delphi 动态创建组件,单个创建、单个销毁
效果图如下: 实现部分代码如下: var rec: Integer = 0; //记录增行按钮点击次数 implementation {$R *.dfm} //动态释放单个组件内存,即销毁组件 pro ...
- DELPHI 动态 创建和释放 多个 EDIT 控件
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, ...
- Delphi动态创建菜单
在程序运行中动态创建菜单,主要使用TMeunItem类,所有菜单的条目都是TMenuItem的一个实例. 打开Delphi7集成开发环境,在默认新建工程里,放置一个Button1按钮和MainMenu ...
- delphi动态创建控件
动态创建控件 其实动态创建控件很简单,相信看过本文后你会全明白的. 1 先在单元的initialization 部分注册它,(这样在单元使用时会自动注册的)如: RegisterClass( TBut ...
- C#动态创建两个按钮,btn2复制btn1的Click事件,匿名委托
现在有一个按钮btn1,要动态创建出一个btn2,需要btn2点击时调用btn1的点击. 在delphi中这种操作很简单:btn2.onClick:=btn1.onClick,因为onClick就是个 ...
随机推荐
- nfs安装配置
一.NFS服务简介 NFS 是Network File System的缩写,即网络文件系统.一种使用于分散式文件系统的协定,由Sun公司开发,于1984年向外公布.功能是通过网络让不同的机器.不同的操 ...
- C#入门经典第八章面向对象编程简介-1
面向对象编程(Object-Oriented Programming,OOP)技术 本章中的OPP实际上是.NET OOP,这里讲的一些技术不能应用于其他OOP环境.
- 【转】在 2016 年做 PHP 开发是一种什么样的体验?(一)
原文: https://www.v2ex.com/t/312651 在 2016 年做 PHP 开发是一种什么样的体验?(一) 嘿,我最近接到一个网站开发的项目,不过老实说,我这两年没怎么接触编程,听 ...
- Cells Not Under Attack
Cells Not Under Attack Vasya has the square chessboard of size n × n and m rooks. Initially the ches ...
- A Game
A Game 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Little Hi and Little Ho are playing a game. There is a ...
- Rails (堆栈)<数据结构>
题意:<看图片> 解题思路:栈的简单应用: #include<iostream> #include<stack> #include<algorithm> ...
- jenkins 进阶系列网址
http://www.cnblogs.com/zz0412/tag/jenkins/default.html?page=1
- 深入浅出 - Android系统移植与平台开发(一)
深入浅出 - Android系统移植与平台开发(一) 分类: Android移植2012-09-05 14:16 16173人阅读 评论(12) 收藏 举报 androidgitgooglejdkub ...
- AWK用法入门详解
简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分隔符将每行切片,切开的部分再 ...
- [DNS]ACL、also-notify、视图服务器及安全设置
1. ACL :访问控制列表放在named.conf的头部,如果acl的内容太多,可以另创建一个文件,将acl放在该文件中,再在主配置文件named.conf用include 将文件加载进来(记得放在 ...