Creating a report from a stored TClientDataSet

edited 5:11PM in FastReport 4.0
I have a defined report structure (in a .fp3 file) and I have a dump using TClientDataSet.SaveToFile().

First I tried with a TDataSource:
var
  NSet: TClientDataSet;
  NSrc: TDataSource;
  FSet: TfrxDBDataset;
begin
  NSet := TClientDataSet.Create(self);
  NSet.LoadFromFile(Dumpfilename);
  NSet.Name := 'procname';
  NSrc := TDataSource.Create(self);
  NSrc.DataSet := NSet;
  frxReport1.LoadFromFile('structure.fp3');
  FSet := TfrxDBDataSet.Create(frxReport1.Pages[0]);     // Attach to DataPage.
  FSet.DataSource := NSrc;
  FSet.Name := NSet.Name;
  FSet.UserName := NSet.Name;
  frxReport1.DataSet := FSet;
  frxReport1.PrepareReport(false);
  frxReport1.ShowPreparedReport;

But that resulted in an access violation. When I try without the TDataSource, I get a 'Cannot find class TfrxDBDataset'.

What am I doing wrong?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:11PM
    a file saved in .fp3 is the preview pages of the prepared/viewed report.
    and would be called by loading the previewpages.
    frxreport1.previewpages.loadfromfile('pathand filename.fp3')

    a report design file is saved and stored as a .fr3 file.
    and would be called
    frxreport1.loadfromfile('pathand filename.fr3');
    frxreport1.showreport;

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.