📄 pub_rep.pas
字号:
strtemp:=copy(str,length(Trim(array_gcxx[j]))+4,nleg-length(Trim(array_gcxx[j]))+5);
str:=strtmp+array_gcsj[j]+strtemp;
end;
end;
end;
end;
Result:=str;
end;
{创建报表标题表头部分}
procedure creatbt(frrep:TfrReport;npage:integer;mygrid:TStringGrid);
var
v:TfrMemoView;
line:TfrLineView;
page:TfrPage;
ntopdis,nleftdis,nbottomdis:integer;//报表上,下,左,右边距的值
dx,dy:integer; //报表纸张的宽度和高度 ntop:integer; //表头离纸的高度
nwidth:integer; //报表实际宽度
ntemp:integer;
i:integer;
begin
page:=frrep.Pages.Pages[npage];
nleftdis:=strtoint(array_jbxx[4])*3;
ntopdis:=strtoint(array_jbxx[5])*3;
// nrightdis:=strtoint(array_jbxx[6])*3;
nbottomdis:=strtoint(array_jbxx[7])*3;
if Trim(array_jbxx[8])='1' then
begin
dx:=getpagew(0,True);
dy:=getpageh(0,True);
end
else
begin
dx:=getpagew(0,False);
dy:=getpageh(0,False);
end;
ntemp:=0;
for i:=0 to mygrid.ColCount-1 do
ntemp:=ntemp+mygrid.ColWidths[i];
if Trim(array_jbxx[1])='1' then //表头框架的宽度
nwidth:=ntemp
else
nwidth:=ntemp-mygrid.ColWidths[0];
//创建报表的页眉和页脚是否有下划线
if Trim(array_jbxx[2])='1' then
begin
line:=TfrLineView.Create;
line.SetBounds(nleftdis,ntopdis,nwidth,20);
page.Objects.Add(line);
end;
if Trim(array_jbxx[3])='1' then
begin
line:=TfrLineView.Create;
line.SetBounds(nleftdis,dy-nbottomdis,nwidth,20);
page.Objects.Add(line);
end;
//end************************************************
//创建报表页眉和页脚文字
//页眉
if Trim(array_jbxx[20])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,ntopdis-18,230,20);
v.Memo.Add(getstr(array_jbxx[20]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[21])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(nwidth/2)-60,ntopdis-18,230,20);
v.Memo.Add(getstr(array_jbxx[21]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[22])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nwidth-230,ntopdis-18,230,20);
v.Alignment:=9;
v.Memo.Add(getstr(array_jbxx[22]));
page.Objects.Add(v);
end;
//页脚
if Trim(array_jbxx[23])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,dy-nbottomdis,230,20);
v.Memo.Add(getstr(array_jbxx[23]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[24])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(nwidth/2)-60,dy-nbottomdis,230,20);
v.Memo.Add(getstr(array_jbxx[24]));
page.Objects.Add(v)
end;
if Trim(array_jbxx[25])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nwidth-230,dy-nbottomdis,230,20);
v.Alignment:=9;
v.Memo.Add(getstr(array_jbxx[25]));
page.Objects.Add(v);
end;
//end***********************************************结束
//创建报表的标题部分
//题注左
if Trim(array_jbxx[9])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,ntopdis,230,20);
v.Memo.Add(getstr(array_jbxx[9]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[10])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,ntopdis+20,230,20);
v.Memo.Add(getstr(array_jbxx[10]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[11])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,ntopdis+40,230,20);
v.Memo.Add(getstr(array_jbxx[11]));
page.Objects.Add(v);
end;
//创建标题
if Trim(array_jbxx[12])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(dx/2)-80,ntopdis+10,300,32);
v.Font.Name:=array_jbxx[14];
v.Font.Size:=strtoint(array_jbxx[15]);
v.Font.Color:=strtoint(array_jbxx[16]);
// v.Alignment:=10;
v.Memo.Add(getstr(array_jbxx[12]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[13])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(nwidth/2)-60,ntopdis+40,300,20);
v.Memo.Add(getstr(array_jbxx[13]));
page.Objects.Add(v);
end;
//创建右题注
if Trim(array_jbxx[17])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nwidth-230,ntopdis,230,20);
v.Alignment:=9;
v.Memo.Add(getstr(array_jbxx[17]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[18])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nwidth-230,ntopdis+20,230,20);
v.Alignment:=9;
v.Memo.Add(getstr(array_jbxx[18]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[19])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nwidth-230,ntopdis+40,230,20);
v.Alignment:=9;
v.Memo.Add(getstr(array_jbxx[19]));
page.Objects.Add(v);
end;
//end;********************************************************
//创建报表表注
//表注上
if Trim(array_jbxx[26])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,ntopdis+58,230,20);
v.Memo.Add(getstr(array_jbxx[26]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[27])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,ntopdis+76,230,20);
v.Memo.Add(getstr(array_jbxx[27]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[28])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,ntopdis+94,230,20);
v.Memo.Add(getstr(array_jbxx[28]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[29])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(nwidth/2)-60,ntopdis+58,230,20);
v.Memo.Add(getstr(array_jbxx[29]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[30])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(nwidth/2)-60,ntopdis+76,230,20);
v.Memo.Add(getstr(array_jbxx[30]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[31])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(nwidth/2)-60,ntopdis+94,230,20);
v.Memo.Add(getstr(array_jbxx[31]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[32])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nwidth-230,ntopdis+58,230,20);
v.Alignment:=9;
v.Memo.Add(getstr(array_jbxx[32]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[33])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nwidth-230,ntopdis+76,230,20);
v.Alignment:=9;
v.Memo.Add(getstr(array_jbxx[33]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[34])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nwidth-230,ntopdis+94,230,20);
v.Alignment:=9;
v.Memo.Add(getstr(array_jbxx[34]));
page.Objects.Add(v);
end;
end;
{创建表注下}
procedure createbzx(frrep:TfrReport;npage:integer;nup:integer);
var
v:TfrMemoView;
page:TfrPage;
nleftdis,nrightdis:integer;//报表上,下,左,右边距的值
dx:integer; //报表纸张的宽度和高度
begin
page:=frrep.Pages.Pages[npage];
nleftdis:=strtoint(array_jbxx[4])*3;
nrightdis:=strtoint(array_jbxx[6])*3;
if Trim(array_jbxx[8])='1' then
dx:=getpagew(0,True)
else
dx:=getpagew(0,False);
if Trim(array_jbxx[35])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,nup+35,230,18);
v.Memo.Add(getstr(array_jbxx[35]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[38])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,nup+53,230,18);
v.Memo.Add(getstr(array_jbxx[38]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[41])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(nleftdis,nup+71,230,18);
v.Memo.Add(getstr(array_jbxx[41]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[36])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(dx/2)-60,nup+35,230,18);
v.Memo.Add(getstr(array_jbxx[36]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[39])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(dx/2)-60,nup+53,230,18);
v.Memo.Add(getstr(array_jbxx[39]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[42])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(Round(dx/2)-60,nup+71,230,18);
v.Memo.Add(getstr(array_jbxx[42]));
page.Objects.Add(v);
end;
if Trim(array_jbxx[37])<>'' then
begin
v:=TfrMemoView.Create;
v.SetBounds(dx-230-nrightdis,nup+35,2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -