1、Demo中的runtime的例子不全,哪位能给个全一点的例子如有
   pageheader,pagefooter等等
2、怎么样给TfrBandView的onbeforeprint事件赋事件
   就是动态的在程序中写?我没找到这个东东
msn:[email protected]

解决方案 »

  1.   

    var
      v: TfrView;
      b: TfrBandView;t3:tfrlineview;
      Page: TfrPage;t2:tfrpictureview;
      t: TfrshapeView;t1:tfrbarcodeview;
     begin
      frReport1.LoadFromFile('d:\rsc\try.frf');
      Page := frReport1.Pages[0];
      v := TfrEditControl.Create;          // create editbox
      v.SetBounds(60, 50, 75, 21);
      v.Name := 'Edit1';
      Page.Objects.Add(v);  v := TfrButtonControl.Create;        // create button
      v.SetBounds(60, 100, 75, 25);
      TfrButtonControl(v).Button.Caption := 'Test!';
      TfrButtonControl(v).Button.Font.Name:='隶书';
      TfrButtonControl(v).Button.ModalResult := mrOk;
      Page.Objects.Add(v);  v := Tfrcheckboxcontrol.Create;          // create editbox
      v.SetBounds(60, 150, 115, 21);
      v.Name := 'checkbox1';
      Tfrcheckboxcontrol(v).CheckBox.Caption:='姓名不同是否翻页?';
      Tfrcheckboxcontrol(v).CheckBox.Checked:=true;
      Page.Objects.Add(v);  v := Tfrradiobuttoncontrol.Create;          // create editbox
      v.SetBounds(250, 150, 100, 21);
      v.Name := 'ra1';
      Tfrradiobuttoncontrol(v).RadioButton.Checked:=true;
      Page.Objects.Add(v);  v := Tfrcomboboxcontrol.Create;          // create editbox
      v.SetBounds(60, 200, 75, 21);
      v.Name := 'com1';
      Tfrcomboboxcontrol(v).ComboBox.Items.Add('123');
      Tfrcomboboxcontrol(v).ComboBox.Items.Add('456');
      Tfrcomboboxcontrol(v).ComboBox.Style:=csDropDownList;
      Tfrcomboboxcontrol(v).ComboBox.ItemIndex:=0;
      Page.Objects.Add(v);  Page := frReport1.Pages[1];
      b := TfrBandView.Create;             // create Title band
      b.SetBounds(0,88,757,20);           // position and size in pixels
      b.BandType := btReportTitle;         // (only Top and Height are significant
      Page.Objects.Add(b);
                        //  for the band)
      b := TfrBandView.Create;             // create Title band
      b.SetBounds(0,112,757,20);           // position and size in pixels
      b.BandType := btpageheader;         // (only Top and Height are significant
      Page.Objects.Add(b);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(280, 20, 112, 20);
      v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('Your text is: zw');
      Page.Objects.Add(v);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(220,64,96,20);
      v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('Your text is: zw1');
      Page.Objects.Add(v);  v := TfrpictureView.Create;             // create memo
      v.SetBounds(352,68,96,20);
      //v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Name:='zz';
      //v.Memo.Add('Your text is: zw1');
      Page.Objects.Add(v);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(260,88,96,20);
      v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('Your text is: zw2');
      Page.Objects.Add(v);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(236, 112, 112, 20);
      v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('Your text is: zw3');
      Page.Objects.Add(v);  v:=tfrshapeview.Create;
      v.SetBounds(328,20,96,20);
      v.Name:='shape2';
      Page.Objects.Add(v);  v:=tfrlineview.Create;
      v.SetBounds(200,20,0,20);
      v.Name:='line1';
      Page.Objects.Add(v);  v:=tfrbarcodeview.Create;
      v.SetBounds(444,20,142,20);
      v.Name:='barcode1';
      Page.Objects.Add(v);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(150, 20, 96, 20);
      //v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('[dialogform.query1.sfgz]');
      Page.Objects.Add(v);  t1:= TfrbarcodeView(frReport1.FindObject('barcode1'));
      if t1<>nil then t1.Memo.clear;t1.Memo.Add('[dialogform.query1.bh]');  t2:= TfrpictureView(frReport1.FindObject('zz'));
      if t2<>nil then t2.Picture.LoadFromFile('d:\rsc\normal.ico');  t:= TfrshapeView(frReport1.FindObject('shape2'));
      if t<>nil then t.ShapeType:=skDiagonal1;  t3:= TfrlineView(frReport1.FindObject('line1'));
      if t3<>nil then t3.FrameWidth:=10;  frReport1.ShowReport;
      end;end.
      

  2.   

    var
      v: TfrView;
      b: TfrBandView;t3:tfrlineview;
      Page: TfrPage;t2:tfrpictureview;
      t: TfrshapeView;t1:tfrbarcodeview;
     begin
      frReport1.LoadFromFile('d:\rsc\try.frf');
      Page := frReport1.Pages[0];
      v := TfrEditControl.Create;          // create editbox
      v.SetBounds(60, 50, 75, 21);
      v.Name := 'Edit1';
      Page.Objects.Add(v);  v := TfrButtonControl.Create;        // create button
      v.SetBounds(60, 100, 75, 25);
      TfrButtonControl(v).Button.Caption := 'Test!';
      TfrButtonControl(v).Button.Font.Name:='隶书';
      TfrButtonControl(v).Button.ModalResult := mrOk;
      Page.Objects.Add(v);  v := Tfrcheckboxcontrol.Create;          // create editbox
      v.SetBounds(60, 150, 115, 21);
      v.Name := 'checkbox1';
      Tfrcheckboxcontrol(v).CheckBox.Caption:='姓名不同是否翻页?';
      Tfrcheckboxcontrol(v).CheckBox.Checked:=true;
      Page.Objects.Add(v);  v := Tfrradiobuttoncontrol.Create;          // create editbox
      v.SetBounds(250, 150, 100, 21);
      v.Name := 'ra1';
      Tfrradiobuttoncontrol(v).RadioButton.Checked:=true;
      Page.Objects.Add(v);  v := Tfrcomboboxcontrol.Create;          // create editbox
      v.SetBounds(60, 200, 75, 21);
      v.Name := 'com1';
      Tfrcomboboxcontrol(v).ComboBox.Items.Add('123');
      Tfrcomboboxcontrol(v).ComboBox.Items.Add('456');
      Tfrcomboboxcontrol(v).ComboBox.Style:=csDropDownList;
      Tfrcomboboxcontrol(v).ComboBox.ItemIndex:=0;
      Page.Objects.Add(v);  Page := frReport1.Pages[1];
      b := TfrBandView.Create;             // create Title band
      b.SetBounds(0,88,757,20);           // position and size in pixels
      b.BandType := btReportTitle;         // (only Top and Height are significant
      Page.Objects.Add(b);
                        //  for the band)
      b := TfrBandView.Create;             // create Title band
      b.SetBounds(0,112,757,20);           // position and size in pixels
      b.BandType := btpageheader;         // (only Top and Height are significant
      Page.Objects.Add(b);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(280, 20, 112, 20);
      v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('Your text is: zw');
      Page.Objects.Add(v);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(220,64,96,20);
      v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('Your text is: zw1');
      Page.Objects.Add(v);  v := TfrpictureView.Create;             // create memo
      v.SetBounds(352,68,96,20);
      //v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Name:='zz';
      //v.Memo.Add('Your text is: zw1');
      Page.Objects.Add(v);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(260,88,96,20);
      v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('Your text is: zw2');
      Page.Objects.Add(v);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(236, 112, 112, 20);
      v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('Your text is: zw3');
      Page.Objects.Add(v);  v:=tfrshapeview.Create;
      v.SetBounds(328,20,96,20);
      v.Name:='shape2';
      Page.Objects.Add(v);  v:=tfrlineview.Create;
      v.SetBounds(200,20,0,20);
      v.Name:='line1';
      Page.Objects.Add(v);  v:=tfrbarcodeview.Create;
      v.SetBounds(444,20,142,20);
      v.Name:='barcode1';
      Page.Objects.Add(v);  v := TfrMemoView.Create;             // create memo
      v.SetBounds(150, 20, 96, 20);
      //v.BandAlign := baWidth;
      v.Prop['Alignment'] := frtaCenter;   // another way to access properties
      v.Prop['Font.Style'] := 2;
      v.Memo.Add('[dialogform.query1.sfgz]');
      Page.Objects.Add(v);  t1:= TfrbarcodeView(frReport1.FindObject('barcode1'));
      if t1<>nil then t1.Memo.clear;t1.Memo.Add('[dialogform.query1.bh]');  t2:= TfrpictureView(frReport1.FindObject('zz'));
      if t2<>nil then t2.Picture.LoadFromFile('d:\rsc\normal.ico');  t:= TfrshapeView(frReport1.FindObject('shape2'));
      if t<>nil then t.ShapeType:=skDiagonal1;  t3:= TfrlineView(frReport1.FindObject('line1'));
      if t3<>nil then t3.FrameWidth:=10;  frReport1.ShowReport;
      end;end.
      

  3.   

    第二个问题在DEMO中没有找到答案
      

  4.   

    var
    t: TfrbandView;
    begin
    t := TfrbandView(frReport1.FindObject('masterdata1'));
    if t <> nil then begin showmessage('123');
    t.Script.Add('memo1.memo:="123"');end;
    测试通过