Do not print Detail Band if Calculated field is true.
I have a report, datapipeline, and a query is connected to the datapipeline.
In that query, I have a calculated field. Now what I want to do is, If the
calculated field is a certain value then it will print the detail band if
not it will not print that information. I have tried using a query filter,
but in Delphi 6, you can not filter on a calculated field. Do you have a
suggestion on how I can use that calculated field to determine if the detail
band will print in report builder? Any help will be appreciated.
In that query, I have a calculated field. Now what I want to do is, If the
calculated field is a certain value then it will print the detail band if
not it will not print that information. I have tried using a query filter,
but in Delphi 6, you can not filter on a calculated field. Do you have a
suggestion on how I can use that calculated field to determine if the detail
band will print in report builder? Any help will be appreciated.
This discussion has been closed.
Comments
Try using the DetailBand.BeforePrint event to check the datafield value and
then set the Detailband.Visible to true or false based upon the result. I am
assuming that the calculated field is implemented using the
DataSet.OnCalcFields event.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
tried using the detailband.visible and setting it true or false. When doing
this, nothing prints out. Just a blank page. Any more ideas?
- Make sure you are using DetailBand.BeforePrint and not
DetailBand.BeforeGenerate or Report.BeforePrint.
- Trace the code for the event-handler and check the datafield value to
determine whether the band is ever getting set to Visible of true.
if myPipeline['DataFieldName'] then
myReport.DetailBand.Visible := True
else
,myReport.DetailBand.Visible := False;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com