码迷,mamicode.com
首页 > 其他好文 > 详细

QuickReport根据每行的内容长度动态调整DetailBand1的行高

时间:2017-06-09 00:55:58      阅读:536      评论:0      收藏:0      [点我收藏+]

标签:ldb   mba   tail   bool   before   color   port   tom   ntb   

procedure TPosPubFactureRep.DetailBand1BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
var
    n, total : integer;
    str : String;
begin
    total := 1;
    str := ADOArticle.FieldByName(my_data).AsString;
  Repeat
    n := Pos(#13, str);
    if n>0 then
    begin
        Inc(total);
        Str:=RightStr(str, Length(str)-n-1);
    end;
  until n=0;

    DetailBand1.Height:=total*18;
end;

还有SubDetail的行高:

procedure TFEDAV.QRSubDetail1BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
    if ( QRSubDetail1.Expanded > 0) then
      begin
        QrShape18.Size.Height := QRSubDetail1.size.Height + QRSubDetail1.Expanded;
        QrShape19.Size.Height := QRSubDetail1.size.Height + QRSubDetail1.Expanded;
        QrShape20.Size.Height := QRSubDetail1.size.Height + QRSubDetail1.Expanded;
        QrShape21.Size.Height := QRSubDetail1.size.Height + QRSubDetail1.Expanded;
        QrShape22.Size.Height := QRSubDetail1.size.Height + QRSubDetail1.Expanded;
        QrShape23.Size.Height := QRSubDetail1.size.Height + QRSubDetail1.Expanded;
      end;
end;

 

QuickReport根据每行的内容长度动态调整DetailBand1的行高

标签:ldb   mba   tail   bool   before   color   port   tom   ntb   

原文地址:http://www.cnblogs.com/findumars/p/6965348.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!