dephi做的程序,要打印的报表中各项内容的位置要根据实际情况来确定,用户要求能自己调整位置。怎样实现?用哪个报表控件更好?谢谢各位大侠!!

解决方案 »

  1.   

    可以根据用户输入位置值来设定qrdbtext的位置
      

  2.   

    我用QuickReport做过, QRDBText QRLable 均可,只须改变Top,Left属性即可.用户通过鼠标移动改变QRlable位置, 保存 TOP,Left 信息,打印时读取即可!
      

  3.   

    to: xjh1968
      我现在用的就是quickreport,但我不知道在什么状态下使用户通过鼠标来移动改变qrlabel的位置,预览时吗?那是好像没法移动啊?请指教,我对这个很不熟悉。
      

  4.   

    胡扯,都喜欢把简单的事情复杂化吗,保存位置属性,下次进入又恢复原样了,不至于再保存这些个信息吧
    用Rave或Fastreport均可,调用报表自身的方法,Design,可调出设计页面
      

  5.   

    对不起,niccctvcom,来晚了!方法如下:不能在预览时移动,你可先建一个对照,如移动 statictext1 保留.top .left数据预览或打打印赋给 qrlabel1.top,qrlabel1.left鼠标移动控件代码:var MouseDownSpot : TPoint;
        Capturing  : bool;procedure TYiLiaoKangFuForm.StaticText1MouseDown(Sender: TObject;
      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
      SetCapture(statictext1.Handle);
      Capturing :=true;
      MouseDownSpot.X := X;
      MouseDownSpot.Y := Y;
    end;procedure TYiLiaoKangFuForm.StaticText1MouseMove(Sender: TObject;
      Shift: TShiftState; X, Y: Integer);
    begin
      if Capturing then
        begin
        StaticText1.Left := StaticText1.Left - (MouseDownSpot.X-X);
        StaticText1.Top := StaticText1.Top - (MouseDownSpot.Y-Y);
        end;
    end;procedure TYiLiaoKangFuForm.StaticText1MouseUp(Sender: TObject;
      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
      if Capturing then
        begin
        ReleaseCapture;
        Capturing := False;
        //移动Panel5当前位置
        StaticText1.Left := StaticText1.Left - (MouseDownSpot.X-X);
        StaticText1.Top := StaticText1.Top - (MouseDownSpot.Y-Y);
        end;
    end;