要怎么设置打印时输入字段在一定的个数后要换行,这个要在那里写事件呀?是不是在onneeddata,
如:地址
厦门市********************地方******
太长了,
现要像
厦门市********************
地方******
还有要怎么设置日期如取系统时间再加7天,

解决方案 »

  1.   

    是在ON NEED DATA事件中赋值。
      

  2.   

    decodedate(now+7,y,m,d);//补足两位 可以不要
    if m < 10 then        
        m := '0'+ inttostr(m);
    if d < 10 then
          d := '0'+ inttostr(d);lbldate.Caption := inttostr(y)+'年'+inttostr(m)+'月'+inttostr(d)+'日'
      

  3.   

    老兄,讨教一个自动折行的问题,在QRReport中,比如我要显示50个字,而一行只能显示30个,怎么让后20个字换行显示?控件不限,最好是QRlable
      

  4.   

    我用QRDBtext也不能自动折行呀!我也正在找这个?
      

  5.   

    找到了在OnPrint事件里面加入代碼procedure 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;
      

  6.   

    stuwe(uwe):
    很管用,非常感谢其中,7是不是控制一行显示多少个字用的?
      

  7.   

    兄弟们,QRRichText 、QRDBRichText本身就有自动换行的功能,绕了一大圈;不过还是学到了好多东西