How do I access the methods of a component that is inside a FastReport file?

0

Sorry if the question seems a bit confusing, but I have the following situation: I have a frxReport component and, inside it, I inserted a graphic into the report. In the main form, I added a radio button, which will define whether I want the report with or without a chart. Then came this question: how do I pass the information obtained in the form to a component that is not in it? I started with Delphi very soon, so if it's a simple question, please. Thanks!

    
asked by anonymous 07.10.2016 / 22:41

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.

    
07.10.2016 / 22:55
0

HERE I HAVE TO CHANGE THE MEMORY COLORS

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 LOCATION WHERE THE EXECUTABLE PROJECT IS

VARIAVEL

PATH, NAME: String;

path := ExtractFileDir (ParamStr(0));

NAME I'M GIVING FOR 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.

    
01.02.2018 / 03:24