Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Impresión (https://www.clubdelphi.com/foros/forumdisplay.php?f=4)
-   -   Crear componente tipo memo por codigo para FastReport (https://www.clubdelphi.com/foros/showthread.php?t=54990)

fcios 04-04-2008 18:25:23

Crear componente tipo memo por codigo para FastReport
 
Hola necesito crear varios componentes en tiempo de ejecucion
para el FastReport.
Lo siguiente no me anda no se porqué, desde ya gracias

procedure TForm1.Button1Click(Sender: TObject);
Var frxPage: TfrxReportPage;
frxMemoView: TfrxMemoView;
Begin
// limpio el reporte, (tampoco me anda si no lo limpio y creo el memo al frxReport1

frxReport1.Clear;
frxPage := TfrxReportPage.Create(frxReport1);
frxPage.CreateUniqueName;

//frxMemoView := TfrxMemoView.Create(frxReport1); // si no lo limpio, no da error pero no se ve
//frxMemoView := TfrxMemoView.Create(frxReport1.Pages[0]); // error

frxMemoView := TfrxMemoView.Create(frxPage);

frxMemoView.CreateUniqueName;
frxMemoView.Left := 10;
frxMemoView.Top := 2;
frxMemoView.Height := 0.5;
frxMemoView.Width := 2;
frxMemoview.Text:='CREADO O NO CREADO ESA ES LA CUESTION';

frxReport1.ShowReport;
end;

fcios 05-04-2008 03:48:32

Listo con SetBounds y AutoWidth

[ delphi ]

procedure TForm1.Button3Click(Sender: TObject);
Var frxPage: TfrxReportPage;
frxMemoView: TfrxMemoView;
Begin
frxReport1.Clear;
frxPage := TfrxReportPage.Create(frxReport1);
frxPage.CreateUniqueName;

frxMemoView := TfrxMemoView.Create(frxPage);

frxMemoView.CreateUniqueName;
frxMemoview.Text:='CREADO O NO CREADO ESA ES LA CUESTION';
frxmemoView.SetBounds(10,11,200,15); // Left, Top, Width, Height
frxmemoView.AutoWidth := True; // con esto el width se adapta automáticamente

frxReport1.ShowReport;
end;


La franja horaria es GMT +2. Ahora son las 10:04:06.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi