tfrBand.Name always return a null string
Original Reporter info from Mantis: giuliano
-
Reporter name: G. Colla
Original Reporter info from Mantis: giuliano
- Reporter name: G. Colla
Description:
tfrBand.Name is never set in LR_class unit. Therefore it's impossible to take advantage of OnBeginBand, OnEndBand, OnBeginColumn etc. events to obtain the Band name, which is always a null string.
Steps to reproduce:
Running the sample userds/project1 included in the LazReport directory with DEBUG enabled, one can verify that band name is never shown:
TForm1.frReport1BeginBand: Band=
Additional information:
tfrBand.Name cannot be set, because it shares the name with tfrBandView. Setting both tfrBandView.name and tfrBand.name would result in two objects with the same name, giving rise to a duplicate name error at design time, when setting tfrBand.Name.
But, as
- the check for duplicate names is made only once when setting names
- the tfrBand object has not yet been created when tfrBandView is created
a simple workaround is to define a Name property for tfrBand which just returns the corresponding tfrBandView name.
A patch to such effect is attached.
Mantis conversion info:
- Mantis ID: 24305
- OS: Any
- Build: Lazarus 1.1 r40858
- Platform: Any
- Version: 1.1 (SVN)
- Fixed in version: 1.1 (SVN)
- Fixed in revision: 40866 (#348460d1)
- Target version: 1.2.0
- LazTarget: 1.2