rt?在线等待

解决方案 »

  1.   

    我在frReport1ManualBuild中写了:
      Page.LeftMargin := 10;
      Page.RightMargin := 10;
      Page.TopMargin := 10;
      Page.BottomMargin := 10;
    但是出错了,不知为什么???
      

  2.   

    如何在frReport1中动态画Shape呢?
      

  3.   

    Page.LeftMargin := 10.00mm;是不是少了单位?page.pagesize:=a4;//设置大小
      

  4.   

    //控制页边距
      frReport1.Pages.Clear;
      frReport1.Pages.Add;              // create page
      Page := frReport1.Pages[0];
      Page.pgMargins.Left  := strtoint(Edit4.Text);//此句在预浏中,体现不出来,为什么?
      Page.pgMargins.Right := strtoint(Edit5.Text);//此句在预浏中,体现不出来,为什么?
      Page.pgMargins.Top := strtoint(Edit2.Text);
      Page.pgMargins.Bottom := strtoint(Edit3.Text);
    //报表标题
      b := TfrBandView.Create;             // create Title band
      b.SetBounds(0, 20, 0, 20);           // position and size in pixels
      b.BandType := btReportTitle;         // (only Top and Height are significant
      Page.Objects.Add(b);             //  for the band)
      v := TfrMemoView.Create;             // create memo
      v.SetBounds(20, 20, 200, 16);
      v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add(MyVar + '仓库库存数量');
      Page.Objects.Add(v);//报表字段名
    {
      b := TfrBandView.Create;
      b.SetBounds(0,40,0,20);
      b.BandType := btPageHeader;
      // b.BandType := btReportTitle;
      Page.Objects.Add(b);
    for i:=0 to ListBox6.Items.Count-1 do
    begin
      v := TfrMemoView.Create;
      s := TfrShapeView.Create;
      v.SetBounds(20+(100*i),40,100,16);
      s.SetBounds(20+(100*i),40,100,20);
      v.Prop['Font.Style'] := 2;
      //Showmessage(Listbox6.Items.GetText[i]);
      v.Memo.Add(Listbox6.Items[i]);
      Page.Objects.Add(s);
      Page.Objects.Add(v);
    end;
    }
    //报表数据
      b := TfrBandView.Create;             // create MasterData band
      b.SetBounds(0, 60, 0, 20);
      b.BandType := btMasterData;
      b.Dataset := 'frDBDataSet1';         // band's dataset
      Page.Objects.Add(b);
    //字段一
    for i:=0 to ListBox6.Items.Count-1 do
    begin
      FieldName :=Listbox6.Items[i];
      if FieldName = '库存数量' then
        FieldName := 'SumTotal';
      v := TfrMemoView.Create;       // create data field
      s := TfrShapeView.Create;
      v.SetBounds(20+(100*i), 60, 100, 16);
      s.SetBounds(20+(100*i),60,100,20);
      v.Memo.Add('[ADODataSet1'+'."'+FieldName+'"'+']');
      //v.Memo.Add('[ADODataSet1."货号"]');
     // v.Memo.Add('[i]');
      Page.Objects.Add(s);
      Page.Objects.Add(v);
    end;
    //预浏报表
      frReport1.ShowReport;
    以上报表程序如果屏蔽了从<//报表字段名>到<报表数据>这段程序,
    预浏时就可以根据frDBDataSet1得到多条数据,
    而如果加了上了从<//报表字段名>到<报表数据>这段程序,
    这数据就只出现一条啊!
    为什么,请教高手?