对memo类型的字段,在使用quickreport报表时,如果用QRDBText控件来显示,显示的内容总是不能自动换行,已经将AutoStretch、wrap属性设为true.如果换成DBMemo控件,又会提示“系统句柄错误”!请问:在QuickReport中如何实现自动换行!

解决方案 »

  1.   

    uickReport版本多少3.07好像不可以换行
    以前的版本可以
    QRDBText.AutoSize:=False;
    QRDBText.AutoStrentch:=Treu;
    QRDBText.WordWrap:=True;
      

  2.   

    UPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUP
      

  3.   

    好久的題了﹐現在又看到﹐這個試試procedure TForm1.QRLabel2Print(sender: TObject; var Value: String);
    var
       iLen : integer;
       strSource, strTemp : string;
    begin
       if Length(Value)<=TCustomControl(Sender).Width/7 then exit;
       strSource:=Value;
       Value:='';
       while true do
       begin
           iLen:=1;
           while iLen<TCustomControl(Sender).Width/7 do
           begin
               if ord(strSource[iLen])>126 then    //這里的值在簡體下好像要改為其它的﹐不是很清楚(我在繁體下測試正常通過)
                   inc(iLen,2)
               else
                   inc(iLen);
           end;
           dec(iLen);
           if ord(strSource[iLen-1])>126 then
               dec(iLen,2);
           strTemp:=Copy(strSource,1,iLen);       if Value='' then
               Value:=Trim(strTemp)
           else
           begin
               Value:=Trim(Value+#13+strTemp);
           end;
           Delete(strSource,1,iLen);
           if Length(strSource)<=TCustomControl(Sender).Width/7 then
           begin
               Value:=Trim(Value+#13+strSource);
               exit;
           end;
       end;
    end;