Don't refresh data after first print

I created a unit with a report and multiple dataset at runtime, it works fine the first time, but the second does not update data.

Creation Procedure
  Constructor TReportContatti.Create;
  begin
    FNum := 0;
    frxReportContatti := TfrxReport.Create(Nil);

    frxUserDataSetContatti := TfrxUserDataSet.Create(Nil);
    frxUserDataSetContatti.RangeBegin := rbFirst;
    frxUserDataSetContatti.RangeEnd := reLast;
    frxUserDataSetContatti.UserName := 'frxUserDataSetContatti';
    frxUserDataSetContatti.Enabled := True;
    frxUserDataSetContatti.OnFirst := frxUserDataSetContattiFirst;
    frxUserDataSetContatti.OnCheckEOF := frxUserDataSetContattiCheckEOF;
    frxUserDataSetContatti.OnGetValue := frxUserDataSetContattiGetValue;
    frxUserDataSetContatti.OnNext := frxUserDataSetContattiNext;

    frxUserDataSetUtenze := TfrxUserDataSet.Create(Nil);
    frxUserDataSetUtenze.RangeBegin := rbFirst;
    frxUserDataSetUtenze.RangeEnd := reLast;
    frxUserDataSetUtenze.UserName := 'frxUserDataSetUtenze';
    frxUserDataSetUtenze.Enabled := True;
    frxUserDataSetUtenze.OnCheckEOF := frxUserDataSetUtenzeCheckEOF;
    frxUserDataSetUtenze.OnGetValue := frxUserDataSetUtenzeGetValue;

    frxUserDataSetContatti.Fields.Add('Nome');
    frxUserDataSetContatti.Fields.Add('Cognome');
    frxUserDataSetContatti.Fields.Add('NazioneNascita');
    frxUserDataSetContatti.Fields.Add('DataNascita');
    frxUserDataSetContatti.Fields.Add('CF');
    frxUserDataSetContatti.Fields.Add('NickName');
    frxUserDataSetContatti.Fields.Add('Indirizzo');
    frxUserDataSetContatti.Fields.Add('Citta');
    frxUserDataSetContatti.Fields.Add('Provincia');
    frxUserDataSetContatti.Fields.Add('Nazione');
    frxUserDataSetContatti.Fields.Add('Email');
    frxUserDataSetContatti.Fields.Add('SocialID');
    frxUserDataSetContatti.Fields.Add('ChatID');

    frxReportContatti.LoadFromFile('ReportContatti.fr3');

    frxReportContatti.Variables.AddVariable('Header','Header1', QuotedStr(Gv_Globals.TrascTemplate.Intestazione[1]));
    frxReportContatti.Variables.AddVariable('Header','Header2', QuotedStr(Gv_Globals.TrascTemplate.Intestazione[2]));

  end;

Any idea?

Comments

  • edited 10:33AM
    Giovanni_R wrote: »
    frxReportContatti.LoadFromFile('ReportContatti.fr3');

    LoadFromFile() 'erases' any work which you have done before that and establishes the conditions which were present when you saved 'ReportContatti.fr3'.
  • edited 10:33AM
    flogger123 wrote: »
    Well that's dangerous specially if all your work is gone and start from scratch. Any practice to have this prevented?
    Do LoadFromFile as the first operation and THEN make any necessary changes.

    When you think about it is quite logical that LoadFromFile behaves in that way.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.