procedure TMainForm.qq(vDocPrint:TDocView;strings:string;cell1:integer;cell2:integer;n:integer);
var
vI:integer;
aa:TDoc;
begin
if(length(strings))>n then
begin
vI:=YWXX1.TBGWD2(vDocPrint.Doc).Cells[cell1,cell2].Font.Size;
YWXX1.TBGWD2(vDocPrint.Doc).Cells[cell1,cell2].Font.Size:=n*vI DIV (length(strings));
end;
end;
procedure TMainForm.Button1Click(Sender: TObject);
var
vDocPrint:TDocView;
vStr:sTring;
vI:integer;
begin
vDocPrint := TDocView.Create(Self);
vStr:=DS_CS.DataSet.FieldByName('NR1').AsString;
try
vDocPrint.Parent := Self;
vDocPrint.InfoBroker := InfoBroker1;
vDocPrint.DocClassID := 'BGWD2';
qq(vDocPrint,vStr,2,1,7);
vDocPrint.Preview;
finally
vDocPrint.Free;
这是过程和打印的代码;都写在了这个功能的窗体上,
所以业务信息和表单的名字是死的,我想写成公共的过程,要传参数; |