How to access the methods of a component that is inside a Fastreport file?

Asked

Viewed 1,255 times

0

I’m sorry if the doubt seems a little fuzzy, but I have the following situation: I have a frxReport component and, inside it, I inserted a chart in the report. In the main form, I added a radio button, which will define if I want the report with or without graph. There arose this doubt: how will I pass the information obtained in the form, to a component that is not in it? I started with Delphi a very short time ago, so if it’s a simple question, just think again. Thank you!

2 answers

1


var
  meuMemo: TfrxMemoView;


begin

  meuMemo:= TfrxMemoView(componenteDoSeuRelatorioForm.FindComponent('meuMemo'));


  if meuMemo<> nil then

  begin

    meuMemo.text := 'teste memo';

  end;

meuMemo is the name of the component in the fr3 file.

componenteDoSeuRelatorioForm is the frxReport you have in your form.

0

HERE I MADE TO CHANGE THE COLORS OF MEMO

if FDQUERY2.FieldBYNAME('VISCERAL').Value >= 12 then BEGIN TfrxMemoView (frxReport1.FindObject ('Memo125')).Color := TALPhacolorRec.Orangered; TfrxMemoView (frxReport1.FindObject ('Memo127')).Color := TALPhacolorRec.Orangered; TfrxMemoView (frxReport1.FindObject ('Memo114')).Color := TALPhacolorRec.Orangered; TfrxMemoView (frxReport1.FindObject ('Memo114')).font.Style := TfrxMemoView(frxReport1.FindObject('Memo114')).font.Style + [TFontStyle.fsBold]; TfrxMemoView (frxReport1.FindObject ('Memo118')).Color := TALPhacolorRec.Orangered; TfrxMemoView (frxReport1.FindObject ('Memo118')).font.Style := TfrxMemoView(frxReport1.FindObject('Memo118')).font.Style + [TFontStyle.fsBold]; END;

TO CAPTURE WHERE THE PROJECT IS EXECUTED

VARIABLE

PATH, NAME: String;

path := ExtractFileDir (ParamStr(0));

NAME I AM GIVING TO PREVIEW FASTREPORT

NOME := FDQUERY2.FieldBYNAME('nome').Value +' - '+ FormatDateTime('ddmmyyyy',date);

CALLING THE REPORT

frxReport1.LoadFromFile(path+'\grafico.fr3'); frxReport1.ReportOptions.Name := 'SISTEMA EVS - AVALIAÇÃO GRÁFICA - ' + nome; frxReport1.ShowReport;

I HOPE TO HELP SOMEONE WITH THIS.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.