Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 647
  • Last Modified:

Quickreport printing problem

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

  • 3
1 Solution
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 ....

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.
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.
Glad I could help !
Thanks for the points.

Best regards,

The Mayor.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now