请教各位大侠,用rave怎样做一个数据来源于stringgrid的报表。不能使用rvDataSetconnection,不知怎样弄。望能给出代码。(最好不用建立一个临时表来保存StringGrid的数据)

解决方案 »

  1.   

    procedure TFormMain.RvSystemPrint(Sender: TObject); 
    const
      XWidth = 0.5;
      YWidth = 0.2;
    var
      i, j : integer;
    begin 
      with Sender as TBaseReport do
      begin 
        SetFont('Arial', 15); //设定字体
        //度量衡由SystemPrinter.Units决定,缺省为Inches
        //也可通过SystemPrinter.UnitsFactor 来调整比例因子
        for i:=0 to stringgrid.RowCount -1 do
           for j:=0 to stringgrid.colcount -1 do
           begin
             GotoXY(j*XWidth +1,i*YWidth +1); //设定输出位置
             Print(stringgrid.Cells[i,j]); //输出文字
           end;
      end; 
    end;
      

  2.   

    好心人看看我的帖子:
    http://community.csdn.net/Expert/topic/3789/3789549.xml?temp=.4723627
      

  3.   

    楼上 VeryOldMan,你的方法是可以,不过要定位输出位置比较麻烦,而且如果打印多于一页,怎样设置。
      

  4.   

    打印多于一页,怎样设置。>>>>>>>>>>>>
    NewPage;