FR for Lazarus: Master-Detail does not work in FR using TfrxDBDataset

FR for Lazarus lacks components to access data of FIrebird DB, so when converting FR reports from Delphi to Lazarus I use TfrxDBDataSet component linked with TIBQuery component instead of components from the Delphi FastReport Data tab palette. Many reports are of Master-Detail  type, so I tried to use two TIBQuery components linked by Master-Detai relation and link them to FR report through TfrxDBDataSet components. Db grids on the form show that Master-Detai relation works, but FR report shows only first row from master and rows linked with this first row for Detail.

Comments

  • Do you use OnAfterScroll event in the master query to refresh detail query?

  • Matter was a simple one. I used in report the same datasets (Master and Detail) as for grids on the form. And before executing reports I used procedure DisableControls for both datasets to avoid redrawing the grids during report execution. And so I desabled datasources associated with corresponding datasets. Problem has two solutions: 1) not using DisableControls procedure (not pretty); 2) use for connecting frxDBDatasets with IBX datasets names of dataset instead of datasources:

     object frxMas: TfrxDBDataset

      UserName = 'Mas'

      CloseDataSource = False

      DataSet = fdsMas

      BCDToCurrency = False

      Left = 412

      Top = 363

     end

     object frxDet: TfrxDBDataset

      UserName = 'Det'

      CloseDataSource = False

      DataSet = fdsDet

      BCDToCurrency = False

      Left = 549

      Top = 372

     end

Leave a Comment