Quickreport printing problem

Posted on 2005-04-07
Last Modified: 2013-11-22
Hi, I have a big problem. Hope someone can help me with this as soon as possible.

Im using a QuickReport, composed as follows:

- PageHeaderband
- ColumnHeaderband
- Groupband
- Detailband
- Summaryband
- PageFooterband

QuickReport Dataset: TQuery
Groupband expression: ArtikelID

So, for each article (in the groupband) a detail is printed (detailband). The field in the detailband is a QRDBRichText. This field can contain either data or a space (cannot be totally empty, otherwise the query is empty). The problem I have is as follows:
I want to print out the Quickreport so that when the QRDBRichText-value is a space, the detailband will not be visible, and the space occupied by the detailband will not print out as an empty line. I tried to make the height of the detailband = 1. When the text-value of the QRDBRichText is only ONE line, nothing is visible, except when one or more empty lines or hard returns are added before posting to the database. When two or more lines of text, there is no problem.  How can I solve this ASAP.

thx alot

Question by:marioway
    LVL 12

    Expert Comment

    Try to implement into the Query a condition:
    This way you will avoid lines containing a space into the QRDBRichText, and will not print out any empty lines ....

    LVL 6

    Expert Comment

    I think you can make use of the OnBeforePrint-Event of the Detailband.

    There you can put the following code :
          PrintBand := (Query.FieldByName('RICH_TEXT_FIELD').AsString <> '');

    By doing this, the Detailband will only be printed when 'RICH_TEXT_FIELD' is not empty.

    Hope this is what you were looking for.

    Best regards,

    The Mayor.
    LVL 6

    Accepted Solution

    Or maybe better :
         PrintBand := (Trim(Query.FieldByName('RICH_TEXT_FIELD').AsString) <> '');

    BY using the Trim-function the detailband will only print if there are 'readable characters' in the RichText-Field.
    when e.g. there are just 20 spaces in it, it won't print also.
    LVL 6

    Expert Comment

    Glad I could help !
    Thanks for the points.

    Best regards,

    The Mayor.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now