Autor Beitrag
Christoph Englmann
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Mo 28.02.05 18:05 
Hallo,

hab ein Form1 von welcher aus ich den QuickRep (befindet sich auf Form2 starten möchte...
zur laufzeit möchte ich noch ein label hinzufügen...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TForm1.Button1Click(Sender: TObject);

var
  label1 : TQRLabel;

begin

label1 := TQRlabel.Create(self);
label1.Parent := Form2.QuickRep1;
label1.Left := 100;
label1.Top := 100;
label1.Caption := 'sdfasfasdfasdf';
label1.Visible := true;
label1.Free;

Form2 := TForm2.Create(self);
Form2.QuickRep1.Preview;

end;



leider ist weder der report und schon gar nicht das label angezeigt...

was mache ich falsch???

danke
christoph

Moderiert von user profile iconGausi: Delphi-Tags repariert.
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Mo 28.02.05 18:12 
Wenn du das Labek mit label1.Free; gleich nach dem erzeugen wieder freigibst, kann es ja nicht mehr da sein.
Du solltest die Form2 auch noch mit Form2.Show anzeigen lassen.

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Christoph Englmann Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Mo 28.02.05 18:23 
hallo,

erstmal danke...

das mit dem free hat gestimmt => wird jetzt bei show angezeigt...

allerdings hab ich beim preview des reports immer noch ein graues blatt (also keines).... :-(

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.Button1Click(Sender: TObject);

var
label1 : TQRLabel;

begin

label1 := TQRlabel.Create(self);
label1.Parent := Form2.QuickRep1;
label1.Left := 100;
label1.Top := 100;
label1.Caption := 'sdfasfasdfasdf';
label1.Visible := true;
label1.Free;

Form2 := TForm2.Create(self);
Form2.QuickRep1.prepare;
Form2.QuickRep1.Preview;

end;



danke

Moderiert von user profile iconGausi: Delphi-Tags repariert.
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Mo 28.02.05 18:31 
Ich kenn mich mir QuickRep nicht aus - wird bei
ausblenden Delphi-Quelltext
1:
2:
Form2.QuickRep1.prepare;
Form2.QuickRep1.Preview;

Form2 schon angezeigt? Wenn nicht, dann solltest du Form2 mit
ausblenden Delphi-Quelltext
1:
Form2.Show;					

anzeigen lassen.

Zitat:
das mit dem free hat gestimmt => wird jetzt bei showangezeigt...

Was heißt jetzt "bei show"?

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Christoph Englmann Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Mo 28.02.05 18:39 
hallo,

wenn ich mit show die Form anzeigen lasse, dann ist das label jetzt drauf...

allerdings, wie gesagt erscheint mit
Form2.preview;
der report nicht
(auch wenn form2.Show davor steht..)
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Mo 28.02.05 18:46 
Das Label ist doch auf der Form1, nicht auf Form2?!
Auf der Form2 ist nur dein Quickreport, oder? Und für den hast du doch sogar noch einen anderen Thread.

Und so geht's wirklich nicht?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.Button1Click(Sender: TObject);
var
  label1 : TQRLabel;
begin
  label1 := TQRlabel.Create(self);
  label1.Parent := Form2.QuickRep1;
  label1.Left := 100;
  label1.Top := 100;
  label1.Caption := 'sdfasfasdfasdf';
  label1.Visible := true;
  label1.Free;
  Form2 := TForm2.Create(self);
  Form2.Show;
end;

procedure TForm2.Show(...);
begin
  Form2.QuickRep1.prepare;
  Form2.QuickRep1.Preview;
end;

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Christoph Englmann Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Mo 28.02.05 19:00 
hallo,

ne das label wird doch von der Form1 aus zur laufzeit auf form2 generiert
ausblenden Delphi-Quelltext
1:
label1.parent := Form2.QuickRep1					

(ist ja im show ereignis der Form auch zu sehen...)


nur der preview der form2 liefert (egal ob ich es von der form1 aus starte oder im onShow-Ereignis der form2 verankere) einfach nur ne graue seite... ;-(


ja hab noch nen anderen thread allerdings war es dort ein anderes problem und dieser ist auch bereits abgeschlossen...
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Mo 28.02.05 19:04 
Warum machst du es dir so kmpliziert mit dem Label und Quickreport zur Laufzeit erzeugen? Mach es doch in der FormCreate oder FormShow-Methode von Form2.

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Christoph Englmann Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Mo 28.02.05 19:12 
ganz einfach:

weil das layout des quickreports nie gleich ist, sondern immer von der augabe abhängt -> diese ergibt sich aus Form1 und deswegen muss aus Form1 Form2 und der Quickreport generiert werden....

christoph
Christoph Englmann Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Di 01.03.05 11:35 
hallo,

also ich habs:

die eigenschaft Bands -> HasDetail des Reports auf True setzen und dann erfolgt auch die Anzeige im Preview....

warum? -> keine Ahnung, ist aber so...