Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Do not print Detail Band if Calculated field is true.

edited December 2005 in General
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.

Comments

  • edited December 2005

    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
  • edited December 2005
    Yes, the calculated field is implemented using the onCalcFields event. I
    tried using the detailband.visible and setting it true or false. When doing
    this, nothing prints out. Just a blank page. Any more ideas?

  • edited December 2005

    - 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
  • edited December 2005
    Thanks that worked. I was using the detail band name.visible. Thank you.
This discussion has been closed.