Using ppDBPipeline, I need to prevent records with value = 0 from printing. I can't figure out which event to intercept, and which component to make invisible. I can't use a query as a datasource, I am sharing a TMemoryData datasource.
How are you displaying Field1 in your report? (ie. DBText, DBMemo, TppVariable). You should be able to use the DetailBand.OnBeforePrint event to check the value of Field1 before it prints and suppress that printing if its value is 0. You can suppress the printing either by setting the actual component's visibility to False or by setting the entire band's visibility to False. Remember to reset the Visibility to True once you are done or it will never show up again.
I tried to set the visibility of the DetailBand in the DetailBand.OnBeforePrint event
if Pipeline['Count'] = 0 then DetailBand.Visible := False else DetailBand.Visible := True;
but the band never appeared. When debugging, the value always evaluated to 0, so I guess this is the problem. Maybe there is something about the way I am referencing the Value. I'll have another look now I know I am on the right track.
Thanks
Will
Hi Will,
How are you displaying Field1 in your report? (ie. DBText, DBMemo, TppVariable). You should be able to use the DetailBand.OnBeforePrint event to check the value of Field1 before it prints and suppress that printing if its value is 0. You can suppress the printing either by setting the actual component's visibility to False or by setting the entire band's visibility to False. Remember to reset the Visibility to True once you are done or it will never show up again.
I have it working nicely now, I was referencing the field value incorrectly
Will
Hi Will,
How are you displaying Field1 in your report? (ie. DBText, DBMemo, TppVariable). You should be able to use the DetailBand.OnBeforePrint event to check the value of Field1 before it prints and suppress that printing if its value is 0. You can suppress the printing either by setting the actual component's visibility to False or by setting the entire band's visibility to False. Remember to reset the Visibility to True once you are done or it will never show up again.
Comments
How are you displaying Field1 in your report? (ie. DBText, DBMemo,
TppVariable). You should be able to use the DetailBand.OnBeforePrint event
to check the value of Field1 before it prints and suppress that printing if
its value is 0. You can suppress the printing either by setting the actual
component's visibility to False or by setting the entire band's visibility
to False. Remember to reset the Visibility to True once you are done or it
will never show up again.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The field is a ppDBText
I tried to set the visibility of the DetailBand in the DetailBand.OnBeforePrint event
if Pipeline['Count'] = 0 then DetailBand.Visible := False else DetailBand.Visible := True;
but the band never appeared. When debugging, the value always evaluated to 0, so I guess this is the problem. Maybe there is something about the way I am referencing the Value. I'll have another look now I know I am on the right track.
Thanks
Will
Hi Will,
How are you displaying Field1 in your report? (ie. DBText, DBMemo,
TppVariable). You should be able to use the DetailBand.OnBeforePrint event
to check the value of Field1 before it prints and suppress that printing if
its value is 0. You can suppress the printing either by setting the actual
component's visibility to False or by setting the entire band's visibility
to False. Remember to reset the Visibility to True once you are done or it
will never show up again.
--
I have it working nicely now, I was referencing the field value incorrectly
Will
Hi Will,
How are you displaying Field1 in your report? (ie. DBText, DBMemo,
TppVariable). You should be able to use the DetailBand.OnBeforePrint event
to check the value of Field1 before it prints and suppress that printing if
its value is 0. You can suppress the printing either by setting the actual
component's visibility to False or by setting the entire band's visibility
to False. Remember to reset the Visibility to True once you are done or it
will never show up again.
--