我想打印一个表中的内容,但只有一个字段的内容特别长,我想用两个类型为rbdetail的qrband,但只能显示一个类型为rbdetail的qrband的内容,为什么那,请教解决

解决方案 »

  1.   

    用一个QrMemo控件呀。这个控件结合Memo控件一起使用,可以实现自动折行。给你贴一个函数吧。
    procedure lineBreakQRMemo(text: string; const textMemo: TMemo; const QRMemo: TQRMemo);
    var
      i: integer;
    begin
      textMemo.Width := QRMemo.Width;
      textMemo.Height := QRMemo.Height;
      textMemo.Font.Name := QRMemo.Font.Name;
      textMemo.Font.Size := QRMemo.Font.Size;
      textMemo.Text := text;
      QRMemo.Lines.Clear;
      for i := 0 to textMemo.Lines.Count - 1 do
        QRMemo.Lines.Add(textMemo.Lines.Strings[i]);
    end;
    在QrBand的BeforePrint事件下,调用这个函就可以啦。