Einzelnen Beitrag anzeigen

Mikko

Registriert seit: 23. Jan 2003
Ort: Baden
65 Beiträge
 
#3

Re: Neue Seite im Rave-Report

  Alt 18. Aug 2003, 19:15
Genau, der Report wird zur Runttime erstellt. Ich will nun, daß meine Daten, wenn die erste Seite voll ist, es mit einer neuen Seite weitergeht. Das kriege ich, verflixt nochmal, nicht hin. Bin ein Newbie in Rave.

Der Code sieht folgendermaßen aus:
Delphi-Quellcode:
procedure TForm1.Drucken2Click(Sender: TObject);
var MyPage: TRavePage;
    MyDataText: TRaveDataText;
    MyBand: TRaveBand;
    MyLine: TRaveHLine;
    MyRegion: TRaveRegion;
    MyText: TRaveText;
    nMarginBottom, nMarginLeft, nMarginRight, nMarginTop: Double;
    i,i1:integer;
    summe:extended;
begin
RvProject1.New;
MyPage := RvProject1.ProjMan.FindRaveComponent('Report1.Page1', Nil) As TRavePage;
MyPage.WasteFit := True;

//..........blablabla

//Daten
i:=0;
i1:=0;
summe:=0;
MyBand := MyRegion.CreateChild(TRaveBand, 'DetailBand') As TRaveBand;
MyBand.AllowSplit:=True;
MyBand.StartNewPage:=true;
Myband.FinishNewPage:=true;
MyBand.BandStyle.PrintOcc := MyBand.BandStyle.PrintOcc + [poFirst, poNewPage];

MyText := MyBand.CreateChild(TRaveText, 'Textii') As TRaveText;
MyText.Text:='Bauteile';
Mytext.Font.Style:=Mytext.Font.Style+[fsitalic];
MyText.FontJustify := pjLeft;
MyText.Left := myBand.Left;
MyText.Top := myBand.Top+1.3;
MyText.Width := 5;

MyText := MyBand.CreateChild(TRaveText, 'Textiii') As TRaveText;
MyText.Text:='Baulänge/-höhe [mm]';
Mytext.Font.Style:=Mytext.Font.Style+[fsitalic];
MyText.FontJustify := pjLeft;
MyText.Left := myBand.Left+5;
MyText.Top := myBand.Top+1.3;
MyText.Width := 3;

MyLine := MyBand.CreateChild(TRaveHLine, 'BottomLine1') As TRaveHLine;
MyLine.Left := MyBand.Left;
MyLine.Top:=MyBand.Top+1.5;
MyLine.Width := MyBand.Right;
MyLine := MyBand.CreateChild(TRaveHLine, 'BottomLine1_1') As TRaveHLine;
MyLine.Left := MyBand.Left;
MyLine.Top:=MyBand.Top+1.52;
MyLine.Width := MyBand.Right;

if gllistbox1.Items.Count>0 then begin
 repeat
  MyText := MyBand.CreateChild(TRaveText, 'Text'+inttostr(i1)) As TRaveText;
  MyText.Text:=gllistbox1.Items[i];
  MyText.FontJustify := pjLeft;
  MyText.Left := myBand.Left;
  MyText.Top := myBand.Top+1.5+0.2*(i+1);
  MyText.Width := 5;
  i1:=i1+1;

  MyText := MyBand.CreateChild(TRaveText, 'Text'+inttostr(i1)) As TRaveText;
  MyText.Text:=gllistbox2.Items[i];
  summe:=summe+strtofloat(gllistbox2.Items[i]);
  MyText.FontJustify := pjLeft;
  MyText.Left := myBand.Left+5;
  MyText.Top := myBand.Top+1.5+0.2*(i+1);
  MyText.Width := 5;
  i:=i+1;
  i1:=i1+1;

  //>>>HIER SOLL DANN DER SEITENUMBRUCH HINEIN, FALLS ZUVIELE DATEN.

  until gllistbox1.Items.Count=i;

  MyLine := MyBand.CreateChild(TRaveHLine, 'BottomLine2') As TRaveHLine;
  MyLine.Left := MyBand.Left;
  MyLine.Top:=myBand.Top+1.5+0.2*(i+2);
  MyLine.Width := MyBand.Right;

  i:=i+1;
  i1:=i1+1;
  MyText := MyBand.CreateChild(TRaveText, 'Text'+inttostr(i1)) As TRaveText;
  MyText.Text:='Summe Bauteile:';
  MyText.FontJustify := pjLeft;
  Mytext.Font.Style:=Mytext.Font.Style+[fsBold]+[fsunderline];
  MyText.Left := myBand.Left;
  MyText.Top := myBand.Top+1.5+0.2*(i+2);

  i1:=i1+1;
  MyText := MyBand.CreateChild(TRaveText, 'Text'+inttostr(i1)) As TRaveText;
  MyText.Text:=floattostr(summe)+' mm';
  MyText.FontJustify := pjLeft;
  Mytext.Font.Style:=Mytext.Font.Style+[fsBold];
  MyText.Left := myBand.Left+5;
  MyText.Top := myBand.Top+1.5+0.2*(i+2);

  MyLine := MyBand.CreateChild(TRaveHLine, 'BottomLine3') As TRaveHLine;
  MyLine.Left := MyBand.Left;
  MyLine.Top:=myBand.Top+1.5+0.2*(i+3);
  MyLine.Width := MyBand.Right;
 end
else begin

//....blablabla

//Ende Daten

RvProject1.ExecuteReport('Report1');
RvProject1.Close;
end;
Das Band liegt auf einer Region. Auf diese Band will ich dann alle Daten ausgeben.

Mit der Memo-Kompo kenn ich mich leider nicht aus. Die Hilfe von Rave ist ja auch nicht der Bringer.
  Mit Zitat antworten Zitat