PDA

Ver la Versión Completa : Crear componente tipo memo por codigo para FastReport


fcios
04-04-2008, 18:25:23
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;