Disabling events dependant on report data
My report has several Subreports.
The Subreports data is from JIT Pipelines which if the have no data in are nil.
So in my ReportBeforeOpenDataPipeline event I do this for each Subreport
SubReport1.Visible := SubReport1.DataPipeline<>nil;
This works fine.
However for the SubReports themselves I have labels with OnGetText events such as
Text := TextBeforeComma(ResidentialDoors.FieldObjects['Glass']);
(TextBeforeComma being a passthrough function I have created)
The problem is that I get Undeclared Identifier : ResidentialDoors, the event goes red in the designer and the report does not run due to the pipeline being nil .
Is there a way 'red' events can be ignored and the report run anyway or
a way I can do SubReport1.OnGetText := nil from within the report or
any other way you could suggest to overcome this
Thanks for your help
Rhonda Ridge
The Subreports data is from JIT Pipelines which if the have no data in are nil.
So in my ReportBeforeOpenDataPipeline event I do this for each Subreport
SubReport1.Visible := SubReport1.DataPipeline<>nil;
This works fine.
However for the SubReports themselves I have labels with OnGetText events such as
Text := TextBeforeComma(ResidentialDoors.FieldObjects['Glass']);
(TextBeforeComma being a passthrough function I have created)
The problem is that I get Undeclared Identifier : ResidentialDoors, the event goes red in the designer and the report does not run due to the pipeline being nil .
Is there a way 'red' events can be ignored and the report run anyway or
a way I can do SubReport1.OnGetText := nil from within the report or
any other way you could suggest to overcome this
Thanks for your help
Rhonda Ridge
Comments
Changed Text := TextBeforeComma(ResidentialDoors.FieldObjects['Glass']); to
Text := TextBeforeComma(SubReport1.DataPipeline.FieldObjects['Glass'].Value);