Yet Another Master/Detail Report Problem

edited 3:27AM in FastReport 3.0
Hi, i have a problem that seems pretty common, i have been browsing the web for solutions but I couldent find one i could apply to my problem directly.

I have a delphi 7 form with 2 Tadodataset connections to an access database with the following query commands

master: SELECT TBLCustomerInfo.CustomerID, TBLCustomerInfo.FName, TBLCustomerInfo.SName, TBLCustomerInfo.Address, TBLCustomerInfo.Town, TBLCustomerInfo.PostCode, TBLCustomerInfo.Tel, TBLCustomerInfo.Fax, TBLCustomerInfo.Mobile, TBLCountyInfo.Name
FROM TBLCountryInfo INNER JOIN (TBLCountyInfo INNER JOIN TBLCustomerInfo ON TBLCountyInfo.CountyID = TBLCustomerInfo.CountyID) ON TBLCountryInfo.CountryID = TBLCountyInfo.CountryID ;


detail: SELECT TBLRemoteUnitInfo.SerialNumber, TBLRemoteUnitInfo.TankName, TBLRemoteUnitInfo.TankSize
FROM TBLRemoteUnitInfo where CustomerID = :CustomerID


I then have a datasource for linking the detail to the master for the :customerID parameter to work.

Then I have two TfrxDBDatasets, one linked to the master dataset, one to the detail dataset with a link to the datasource too.

When running a report with master and detail bands, i can only display master records that have detail.

ie

customerID 1
0000-0001
0000-0002
customerID3
0000-0004

instead of

customerID1
0000-0001
0000-0002
customerID2
customerID3
0000-0004


I have spent ages trying to get it to work and have finally given up

Please help

Dan

Comments

  • edited 3:27AM
    Set MasterData.PrintIfDetailEmpty propert to true.
  • edited 3:27AM
    yeah, thats what i call a promt and to the point answer!

    thanks

Leave a Comment