在fastreport中的动态创建barcode,打印条码数量问题(100)

  • 主题发起人 主题发起人 小无为
  • 开始时间 开始时间

小无为

Unregistered / Unconfirmed
GUEST, unregistred user!
如何动态创建bar?因为我的打印数量不固定,都是相同的条码,需要动态创建barmemo、band、pic这些都能动态创建,就是这个bar不会弄
 
bar不能动态创建吗?
 
没有人知道?
 
rocedure TForm1.Button9Click(Sender: TObject);var i,j,k :integer;frtemp: TfrxReport;mm1,mm:cell;r11,c11,r1:integer;row,col:integer;e:TfrxMemoView;
//textpt:TfrxReportTitle;pf:TfrxReportSummary;ht:TfrxPageHeader;hf:TfrxPageFooter;md:TfrxMasterData;Mxd:TfrxDetailData;sd:TfrxSubdetailData;P:Tfrxreportpage;tempage:TfrxReportPage;PageSet:olevariant;
begin
frtemp:=TfrxReport.Create(form1);tempage:=TfrxReportPage.Create(frtemp);tempage.Name :='page1';frtemp.DataSets.Add(mdata);P:=Tfrxreportpage(tempage);es1.ConnectTo(ea1.Workbooks[ExtractFileName(ed1.Text)].Worksheets[cs1.text ] as ExcelWorksheet);PageSet:=es1.PageSetup;papg_set(PageSet,p);col :=es1.UsedRange[1].Columns.Count ;
//列row :=es1.UsedRange[1].Rows.Count;
//行 for k:=1 to rowdo
begin
r1:= es1.Cells.Item[k,1].MergeArea.Row;//s.Count;
if r1=k then
begin
mm:= cell_du(k,1,0,0);
if mm.txt.text ='表头' then
begin
pt:= TfrxReportTitle.Create(tempage);
pt.Height:=cd(mm.h);
pt.Name :='pt';//'ban'+inttostr(k);
for i:=k to k+mm.row2-1do
//行 for j:=2 to coldo
//列 begin
r11:= es1.Cells.Item[i,j].MergeArea.Row;//s.Count;
c11:= es1.Cells.Item[i,j].MergeArea.Column;//s.Count;
if (r11=I) and (c11=J) then
begin
mm1:= cell_du(i,j,3,k);
e:= TfrxMemoView.Create(pt);
txt2_xie(i,j,mm1,e);
end;
end;
end;
if mm.txt.text ='页头' then
begin
ht:= TfrxPageHeader.Create(tempage);
ht.Height:=cd(mm.h);
ht.Name :='HT';
for i:=k to k+mm.row2-1do
//行 for j:=2 to coldo
//列 begin
r11:= es1.Cells.Item[i,j].MergeArea.Row;//s.Count;
c11:= es1.Cells.Item[i,j].MergeArea.Column;//s.Count;
if (r11=I) and (c11=J) then
begin
mm1:= cell_du(i,j,3,k);
e:= TfrxMemoView.Create(HT);
txt2_xie(i,j,mm1,e);
end;
end;
end;
if mm.txt.text ='页脚' then
begin
hf:=TfrxPageFooter.Create(tempage);
hf.Height:=cd(mm.h);
hf.Name :='HF';
for i:=k to k+mm.row2-1do
//行 for j:=2 to coldo
//列 begin
r11:= es1.Cells.Item[i,j].MergeArea.Row;//s.Count;
c11:= es1.Cells.Item[i,j].MergeArea.Column;//s.Count;
if (r11=I) and (c11=J) then
begin
mm1:= cell_du(i,j,3,k);
e:= TfrxMemoView.Create(HF);
txt2_xie(i,j,mm1,e);
end;
end;
end;
TRY if mm.txt.text ='主数据'then
begin
md:=TfrxMasterData.Create(tempage);
md.Height:=cd(mm.h);
md.Name :='MD';
md.Top :=mm.t ;
md.DataSet:=mdata;
//数据集 for i:=k to k+mm.row2-1do
//行 for j:=2 to coldo
//列 begin
r11:= es1.Cells.Item[i,j].MergeArea.Row;//s.Count;
c11:= es1.Cells.Item[i,j].MergeArea.Column;//s.Count;
if (r11=I) and (c11=J) then
begin
mm1:= cell_du(i,j,3,k);
e:= TfrxMemoView.Create(MD);
txt2_xie(i,j,mm1,e);
end;
end;
end;
if mm.txt.text ='明细数据' then
begin
Mxd:=TfrxDetailData.Create(tempage);
Mxd.Height:=cd(mm.h);
mxd.Top :=mm.t ;
Mxd.Name :='MXD';
for i:=k to k+mm.row2-1do
//行 for j:=2 to coldo
//列 begin
r11:= es1.Cells.Item[i,j].MergeArea.Row;//s.Count;
c11:= es1.Cells.Item[i,j].MergeArea.Column;//s.Count;
if (r11=I) and (c11=J) then
begin
mm1:= cell_du(i,j,3,k);
e:= TfrxMemoView.Create(MXD);
txt2_xie(i,j,mm1,e);
end;
end;
end;
if mm.txt.text ='子数据' then
begin
sd:=TfrxSubdetailData.Create(tempage);
sd.Height:=cd(mm.h);
sd.Top :=mm.t ;
sd.Name :='SD';
for i:=k to k+mm.row2-1do
//行 for j:=2 to coldo
//列 begin
r11:= es1.Cells.Item[i,j].MergeArea.Row;//s.Count;
c11:= es1.Cells.Item[i,j].MergeArea.Column;//s.Count;
if (r11=I) and (c11=J) then
begin
mm1:= cell_du(i,j,3,k);
e:= TfrxMemoView.Create(SD);
txt2_xie(i,j,mm1,e);
end;
end;
end;
if mm.txt.text ='表合计' then
begin
pf:=TfrxReportSummary.Create(tempage);
pf.Height:=cd(mm.h);
pf.Name :='PF';
for i:=k to k+mm.row2-1do
//行 for j:=2 to coldo
//列 begin
r11:= es1.Cells.Item[i,j].MergeArea.Row;//s.Count;
c11:= es1.Cells.Item[i,j].MergeArea.Column;//s.Count;
if (r11=I) and (c11=J) then
begin
mm1:= cell_du(i,j,3,k);
e:= TfrxMemoView.Create(pF);
txt2_xie(i,j,mm1,e);
end;
end;
end;
except SHOWMESSAGE('错误出现在 K='+INTTOSTR(K)+' I='+INTTOSTR(I)+ ' JC='+INTTOSTR(I) ) end;
end;
end;
frtemp.SaveToFile(ed2.Text +ed3.Text);// frtemp.DesignPreviewPage ;
frtemp.Free;
fr1.LoadFromFile(ed2.Text +ed3.Text);
fr1.DesignPreviewPage;
end;
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
后退
顶部