Changing DataSets

I have this setup:

FfrxDBDataset.DataSet := aDataSet // a TTable
FReport.DataSet := FfrxDBDataset;
FReport.DesignReport; // shows the table
FReport.ShowReport; // shows the table
// so far so good. Now:
FfrxDBDataset.DataSet := aDataSet // a TQuery with one record
FReport.DesignReport; // still shows the table!!
FReport.ShowReport; // still shows the table!!

How do I get the report to show the current contents of "aDataSet"?

TIA,
Jim

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:19AM
    Can't be sure of what you are trying to explain.
    the tfrxreportcomponents dataset property is ony used with multiple design page reports.
    it controls the number of times a report is run.

    usually your masterdataband's dataset property points to the frxdbdataset.
    you can set the frxdbdatasets properties.
    things can get very messy if you start changing datasets as the report design remebers the dataset used and its field names.
  • edited 5:19AM
    Thanks.

    I don't follow your last sentence: are you saying that even if I correct it to be, e.g.:

    TfrxMasterData(FReport.FindObject('MasterData1')).DataSet := aDataSet

    the report won't use the new records/fields in "aDataSet"?

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.