1, 表里面有81条记录,可是用rave打印出来却少了很多,不知道是什么原因。而且经常出现,前面的记录会丢失。
2,动态设置rave报表也是一样打印出来的记录条数与表中实际不符,有时候正确,有时候错误。

解决方案 »

  1.   

    應該是你的代碼, 設置有問題!!
    不過, 我對 Rave 已經失去耐心了!
      

  2.   

    问题2代码:      ADOTable2.Close;
          ADOTable2.Open;
          ADOTable2.Close;
          ADOTable2.Open;
          ADOTable2.Close;
          ADOTable2.TableName := 'sk_invoice';
          ADOTable2.Open;
          ADOTable2.Close;
          ADOTable2.Open;      RvProject1.Open;
          RvDataSetConnection1.DataSet := ADOTable2;
          MyDataView := RvProject1.projMan.newDataObject(TRaveDataView) as TRaveDataView;
          MYDataView.ConnectionName := 'RvDataSetConnection1';
          MyDataView.FullName := 'dataview1';      with RvProject1.ProjMan do
          begin
            MyPage := FindRaveComponent('Report1.page1',nil) as TRavePage;
            MyRegion := FindRaveComponent('Region1',Mypage) as TRaveRegion;
            MyBand := FindRaveComponent('Band1',Mypage) as TRaveBand;
            MyDataband := FindRaveComponent('DataBand1',MyPage) as TRaveDataBand;
            MyDataband.DataView := MyDataView;
            mytext := findravecomponent('text1',mypage) as TRaveText;        for n := 0 to Rvdatasetconnection1.DataSet.Fields.Count -1 do
            begin
              a := rvdatasetconnection1.DataSet.Fields.Fields[n].DataType;
              if a = ftwidestring then
              begin
                myfield := TRaveStringfield.Create(mydataview);
                myfield.Parent := mydataview;
                myfield.FieldName := rvdatasetconnection1.DataSet.Fields.Fields[n].FieldName;
                myfield.FullName := rvdatasetconnection1.DataSet.Fields.Fields[n].FieldName;
                myfield.AsString;
                addcomponent(myfield);
              end;
              if a = ftfloat then
              begin
                myfield1 := TRavefloatfield.Create(mydataview);
                myfield1.Parent := mydataview;
                myfield1.FieldName := rvdatasetconnection1.DataSet.Fields.Fields[n].FieldName;
                myfield1.FullName := rvdatasetconnection1.DataSet.Fields.Fields[n].FieldName;
                myfield1.AsString;
                addcomponent(myfield1);
              end;
              mydatatext := findravecomponent('datatext'+inttostr(n+2),mypage) as TRavedatatext;
              mydatatext.DataView := mydataview;
              mydatatext.DataField := rvdatasetconnection1.DataSet.Fields.Fields[n].FieldName;
            end;
            rvproject1.Execute;
            rvproject1.Close;
          end;
       end;