• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 656
  • 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
Marioway

0
marioway
Asked:
marioway
  • 3
1 Solution
 
esoftbgCommented:
Try to implement into the Query a condition:
SELCT * FROM DETAILS WHERE RICH_TEXT_FIELD <> ' '
This way you will avoid lines containing a space into the QRDBRichText, and will not print out any empty lines ....

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

Best regards,

The Mayor.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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