4
votes

Delphi 7 and QuickReports. Does anyone know how to implement a variable height detail band so that the area for a detail band is dynamically adjusted to best fit the loaded data from the query? Is this at all possible with QuickReports? If not, do you know of any product that facilitates this?

EDIT

Components used: TQuickRep, TQRBand, and the particular control that will hold the variable size content is TQRExpr

EDIT

The key piece of info not included in the answer is how to assign the expression to a TQRExprMemo since it doesn't have an expression property like TQRExpr. The answer to that is to enclose the expression in { } (eg. "{expression}") and assign it to the Lines property.

Set RemoveBlankLines to True, AutoStretch to True, AutoSize to False.

1
What kind of data? Which QR controls are you using? Typically, you just lay out the controls to display a single row of data, and size the detail band to the size that allows all of your data to display. QR handles resizing the band automatically.Ken White
Hi Ken. The data is text (address_line_1..4 concatenated). The detail band is not adjusting height automatically. It is always the maximum height allocated to the TQRExpr. Just found AutoStretch property on TQRExpr, set to True.. still the detail band is a constant height for each record (despite addresses of varying sizes).Sam
I always use a QRExprMemo (sorry if the name isn't quite right - don't have QR or Delphi < XE on this machine), set AutoSize to True, AutoStretch to True, and IIRC there's a property to delete/suppress blank lines. I'll look when I get to the office in the AM for an example and try and post something if you don't have an answer by then.Ken White
Thanks Ken. Put it in an answer please so I can show my appreciation the SO way.Sam

1 Answers

2
votes

I always use a TQRExprMemo. Set AutoSize to True, AutoStretch to True, and IIRC there's a property to delete/suppress blank lines. I've used this frequently to produce mailing labels, address blocks on letters, and so forth.