[Report area] Area doesn't fill itself from dataset.

  • It's an annoyance, really. The user can dynamically add new tables to the form and every new table will add a new band to the WPForms object inspector. I can then drag & drop fields from this object inspector on my form. But when I drop them in a report area and then show a print preview, no data is shown. (And yes, the table has plenty of data.)

    Since I need to create several controls to support this all dynamically, I just wonder if somewhere a link has been forgotten.

    • Offizieller Beitrag

    By design all report areas are undefined - they are not connected to a certain database. The data provider is constructed to handle report areas if their fieldname is the name of a certain client table.
    It will be required that the user selects which client table is used by a certain report area - or you do it - in the ReportState event which is triggered for the area.

  • I found the problem already. The report area has a DataField property that needs to contain the name of the table alias.
    But I also need to set the MasterDatasource of the ReportEngine to point to the same WPFDatasource for it all to work or else the report preview just won't work correctly.

    My real problem will arrive when the user wants to add multiple report areas to their form. The several tables that they can choose from have no master-detail links and there's no need for this either. It's not likely that a user will do this, though.
    But the user might be working on a delivery form with two tables. One table containing articles that need to be delivered, a second one a list of articles that have been delivered already. Two tables, thus two report areas. So also two report engines???

    • Offizieller Beitrag

    Hi,

    >> The several tables that they can choose from have no master-detail links and there's no need for this either. <<

    So they may not put these on a blank report area othewise they be come invisible, or, if this report area is connected, duplicated.

    As solution you can use a reportstate event which makes sure at least the first row of each report aera is printed, esspecially of those which are not 'connected'.

    Julian