Copyright: Copyright © 1998 Inprise Corporation.                      All rights reserved.                                                 This Help file was compiled on   Wednesday, September 01, 1999 14:53:33.


QuickReport Help
Roadmap to QuickReport Help

General information

About QuickReport 3.0

Upgrade to QuickReport 5.0 Professional

User Guide

Knowledge Base

Report layout and control components

TQuickRep

TQRBand

TQRSubDetail

TQRStringsBand

TQRGroup

TQRChildBand

Printable components

TQRLabel

TQRDBText

TQRExpr

TQRSysData

TQRMemo

TQRExprMemo

TQRRichText

TQRDBRichText

TQRImage

TQRDBImage

TQRShape

Export filter components

TQRTextFilter

TQRCSVFilter

TQRHTMLFilter

Components in QuickReport 3 Professional only

TQRAbstractReport

TQRMailingLabelReport

TQRLoopBand

TQRExcelFilter

TQREditor


QuickReport User Guide

Your First Report

This section is a short explanation of how to set up a basic report. The most common QuickReport components are briefly described along with how to connect your report to a table and call it from your application

Creating Reports

More in depth information on each step involved in creating reports

Creating Groups

With QuickReport you can create very simple and highly complicated reports with groups. Groups can be nested to unlimited levels and if you link several datasets into your report you can do grouping on any dataset you want.

QuickReport Knowledge Base

Answers to common questions, examples, and useful techniques.


About QuickReport 3

QuSoft contact information

On the web:	http://www.qusoft.com
E-mail (for sales related questions):	sales@qusoft.com
Fax:	+47 22 41 74 91
QuickReport is distributed by	QBS Software, http://www.qbss.com
Upgrade to QuickReport 5 Professional today!

QuickReport is Copyright © 1995-1999 by QuSoft AS


Upgrading to QuickReport 3 Professional
Upgrading to QuickReport 5 Professional

QuickReport 5 Professional gives you the additional power you need to give your application the final touch. Additional export filters, end user report designer, advanced preview with hyperlinking and drill-down capabilities, text search in reports and so much more. It also includes full Delphi source code. No Delphi or C++Builder developer should be without QuickReport 5 Professional

For a complete list of features in QuickReport 5 Professional please visit our web site at http://www.qusoft.com.


Your First Report

QuickReport is a banded report generator. Your reports are built up of sections (bands) with text and graphics components on them. These bands are replicated according to your data to create the final report. A simple report might include these components placed on a form:

Dataset (TTable)

QuickReport component connected to the dataset

Detail band on the report component

Printable text (TQRDBText) on the detail band

Follow these steps to create the report:

Start a new project

Drop a TTable component on the form. Select the DBDemos alias as DatabaseName, Customer as TableName and set Active to True

Drop a TQuickRep component on the main form and set the DataSet property to Table1

Expand the Bands property

Set HasDetail to True. This will add a detail band to the report

Drop a TQRDBText component on the detail band, set DataSet to Table1 and DataField to Company

These are all the components you need to create a basic report.

To preview the report you can right click somewhere on the TQuickRepcomponent and select Preview from the popup menu. If you did everything right you should now see a preview window with your report.

So now you have a report working at design time but you want it to work at runtime too. Follow these steps activate the report at runtime:

Add a button to your main form and set the Caption to ‘Preview’

Double click on the button to add a OnClick event and add the following line of code:

QuickRep1.Preview;

Run your application and click the Preview button to see the report. To print the report directly you call the Print method instead of Preview.

You have created a simple list type report. In the following chapters we will go through many steps in creating all types of reports.


The Different Band Types

It’s important to know the different band types and when to use them. By expanding the Bands property of the TQuickRep components you can add and remove the six most common band types. The bands will appear on the TQuickRep component in the order they will finally be printed.

Bands can also be added by dropping a TQRBand from the component palette onto the TQuickRep component. You must then take care to set the BandType property to the propitiate value. It’s also a good idea to give the band component a descriptive name, like PageHeaderBand, DetailBand and so on. This is all done automatically if you add the bands by using the TQuickRep.Bands property.

In addition to these bands there are bands for creating grouping and master detail reports.


Connecting Data

QuickReport can retrieve data from many types of data. Usually you will connect your report to a Delphi DataSet component, either a TTable or a TQuery. The dataset can be on the same form as the report, on another form in your project or in a Data Module. If the dataset is stored outside the report form simply add that form or data module to the Uses list of the report form. Then set the DataSet property of the TQuickRep component to link to the dataset.

The dataset must be active for a report to be printed. If it isn’t, no report will be generated.


Filtering and Sorting the Data

QuickReport itself does not have any feature so sort data. Data is always printed on the order presented to QuickReport by Delphi and the BDE. To change the sort order of a report connected to a TTable component activate an index similar to the sort order you want. If no such index is available you might consider adding one or print from a sorted query instead.

When printing from a TQuery you adjust the printing order by changing the sort order in the query. Se the propitiate database documentation for information on writing SQL statements.

Filtering data can be done in several ways. If you print from a TTable and you use Delphi 2.0 or later you can use the TTable.Filter property to add a filtering condition. Remember to also set the TTable.Filtered property to True.

Another approach is to print from a TQuery component and use the Where clause to select which records to retrieve. Delphi lets you create parameterized queries which makes it easy to change the data selection. Please look this up in the Delphi documentation for more information.

A third option is to use the BeforePrint event of your detail band to turn printing of this band on and off. Bellow is an example of such an event handler:

procedure TrepList.ReportDetailPrintEvent(Sender : TComponent;

                                          PrintBand : boolean);

begin

  PrintBand := CustomerTableCompany.Value > ‘H’;

end;


Adding Text and Data Fields

To print text on a report you add printable components to your report. The two basic printable text components are TQRLabel and TQRDBText.

The TQRLabel component is used to print static text or text and numbers being calculated by your application during report generation. To print a static text just drop the component on a band, position it and enter the text you want in the Caption property. The text will now appear on it’s parent band and be printed in that relative position each time the band itself is being printed.

You can change the font and font color by modifying the Fonts property. QuickReport supports any TrueType or PostScript fonts.

You can change the Caption property in any event handlers during report generation. This way you can do calculations or string operation directly in Delphi code and print the result in a report. More information and examples on this can be found later in this document.

Database fields can be printed by using the TQRDBText component. Drop the component on a band and link the DataSet property to the table or query you want to print data from. Then select a field in the DataField property.

You can also use the TQRExpr component to print both static and dynamic text and database fields.


Creating Reports

The first step when creating a QuickReport is to create a form to store your TQuickRep component. We refer to this form as a ‘Report Form’ since it’s just acts as a container for your reports and is never meant to be  shown to the end user of your application. The report form is listed in the Delphi Project Manager and it’s therefor a good idea to give it a name which will identify it as a report form.

Starting all report form names with ‘rep’ will make them stand out. You might want to do the same with the form unit names.

The second step is to put a TQuickRep component on your report form. Since you have already named the form to describe the report it’s a good idea to give all report components the same name. By simply naming the TQuickRep component ‘Report’ you will reference them as repCustomerListing.Report, repSalesListing.Report and so on.


Grid, Units and Zoom

When dropping the TQuickRep component on a form you will se a grid to act as a guide for positioning components. The grid is shown in the current QuickReport units. You can do very accurate report layout by positioning and sizing QuickReport components in 1/100th of an inch or 1/100th of a MM. You select the currently active unit by changing the TQuickRep.Units property in the property inspector. The grid will be updated when you change this property.

On most monitors it might be difficult to see the entire TQuickRep component since it takes the size of the actual paper size selected. To get a clearer picture you can change the Zoom property. Changing the zoom will be immediately reflected in the form designer. This feature can also be used to zoom in on important details for accurate positioning and sizing.


Paper Size and margins

You can do accurate setup of your page by expanding the Page property of the TQuickRep component.  Double click on the ‘+’ sign to the left of the property to expand the sub properties. You will now see all the settings controlling the page layout. The values given are in the currently selected unit. The margins selected can be seen as blue dotted lines on the TQuickRep component. Your bands will be sized to fit inside the margins.

You can choose between portrait and landscape page layout and you can turn the grid on and of with the Ruler property.

PaperSize can be set to any of the following values: Letter, LetterSmall, Tabloid, Ledger, Legal, Statement, Executive, A3, A4, A4Small, A5, B4, B5, Folio, Quarto, qr10X14, qr11X17, Note, Env9, Env10, Env11, Env12, Env14, CSheet, DSheet, and ESheet.

These are all the default paper sizes defined in Windows. Selecting a paper size will automatically be reflected in the PaperLength and PaperWidth properties. You can also set PaperSize to Custom and select any PaperLength and PaperWidth you want. Note that not all printers support all paper sizes. Also, many printers does not support custom paper size or can only have custom size within certain values. If you select a paper size not supported by a printer QuickReport will automatically switch to the default paper size when preparing the report. The default paper size is selected in the printer driver setup.

Some printer drivers define additional paper sizes. These sizes cannot be automatically set in this version of QuickReport but you can usually create a custom paper with the same size.

There are also printer drivers that doesn’t support setting the custom size values from applications. You will then have to select custom paper size in the printer driver and define the paper. Set this to be the default paper size for the printer and finally set the TQuickRep.Page.PaperSize property to Default. Your custom size will now be picked up at runtime.


Selecting a Font

You set the default font for your report in the TQuickRep.Font property. By double clicking on the property you will get the Delphi font dialog where you can select font name and size, set font attributes such as bold, italic and select the font color. The fonts listed are all the Windows system fonts, all installed True Type fonts and any PostScripts fonts (if Adobe TypeManager is installed). You can use any combination of fonts in your reports but we advice the use of TrueType or PostScript fonts if you will allow the user to preview the report. The system fonts are only available in limited sizes and does not scale very well in preview.

Some dot matrix printers print much faster if you select a font already build into the printer hardware, typically called a ‘printer font’. These fonts are not listed by QuickReport but can be set at runtime by setting the font property by code:

repCustomerListing.Report.Font.Name := ‘CG TIMES’;

By default all components on the report inherit the font setting from the report. Any component which has its font explicitly set or has its ParentFont property set to False will not inherit the report font setting. Note that you can also override the font at the band level.

The readability of your report depends very much on your font selection. You should consider this carefully when selecting fonts. Using many different fonts, colors and styles in a report can easily make it look cluttered and difficult to read.


Report Title and Description

A report can have both a title and a description. These properties are primarily for identifying and describing the report in your application. Typically you can have a menu system listing all your reports and showing the description when the user selects a report. An example of this can be seen in the QuickReport example project.

The report title can also be printed on a report with the TQRSysData component.


Adding Bands

QuickReport is a banded report generator, hence bands are a very important part of your reports. If you are unfamiliar with banded report generators you can think of it as small sheets of paper templates which you copy onto a page and fill in with data. Different templates are copied into different parts of the page (report).

The easiest way to add bands is to expand the TQuickRep.Bands property in the property inspector. Click on the ‘+’ sign to the left of  the property to expand the list of common bands.

The band types are now listed and the object inspector shows if that band type exists in the report or not. You can add or delete a band simply by changing a property from True to False or vice versa. When a band is created this way it will get a descriptive band name, like DetailBand1, PageHeaderBand1 and so on. The band type will also be set automatically.

You can also add bands by selecting the TQRBand component on the component palette and dropping it on the report. You must take care to set the desired band type and should also give it a descriptive name. The Bands property in the object inspector will also reflect bands added to the report this way.

The band types you can add to the report these two ways are:

PageHeader	The first band printed on all pages. On the first page printing is depended on the TQuickRep.Options.FirstPageHeader property. The default is to not print the first page header.
Title	A title band is the first band printed to a report (after the very first page header). It’s useful for printing the report title, data selection criteria, creation date and time and so on.
ColumnHeader	The column header band is printed on top of each report column. In a regular single column report the band is printed once per page, following the page header (and the title band for the first page). For a multi column report it’s printed once for each column. It’s most useful for printing field names.
Detail	One detail band is printed for each record (row) of data in your dataset. This is perhaps the most important band in your report and is usually what takes most of the space on the final output. You would typically put data aware printable controls (TQRDBText and others) on this band.
Summary	After all detail bands has been printed you can print a summary band. This is often used for printing totals of numeric fields.
PageFooter	The last band printed on all pages. On the last page printing is depended on the TQuickRep.Options.LastPageFooter property. The default is not to print the last page footer.
When you add bands to a report they stack up in the actual printing order automatically. You will see that the PageHeader band is on top, followed by the Title band, column header band and so on.

The bands will have the band type printed with very small letters in it’s lower left corner. This is done to help identifying the bands while designing the report. This text will not be printed on the final report.

Note:	While it is possible to manually add a band and set its type to SubDetail or GroupHeader this is not meant to be done. These band types are reserved for the TQRSubDetail and TQRGroup components. Setting these band types might cause the report to print in a wrong way.


Sizing the Bands

Bands get their horizontal size automatically. For a single column report this is the page width minus the margins. The only way to change a bandwidth is to adjust the margins.

The width of some bands also depends on the Page.Columns property of the TQuickRep component. If you create a multi column report (like a phone dictionary) the width of the column header, detail, sub detail, group header and group footer bands will adjust to reflect the width available for a single column.

You can adjust the vertical length of the bands. This is done by simply selecting a band and resizing it with the mouse. If you want accurate control of the band length you can expand the TQRBand.Size property and set an exact value using the currently selected QuickReport unit.

Although you can set a value for the band width in the object inspector this value is not reflected at run time and is meant as read only information only.


Band Printing Order

Bands appear on the TQuickRep component in the actual printing order. However it is good to understand why the bands line up the way they do. Generally band will print in the following order:

Page header repeated for all pages

|

Title (first page)

|

Column header repeated for all columns

|

Detail repeated for all records

|

Summary (last page)

|

Page footer repeated for all pages

It will become somewhat more complicated when including sub details and group bands but if you remember this layout then the rest will be easier.


Turning Bands On and Off

You might sometimes want to disable printing of a band depending on some condition, either at design time or at run time. At design time this can be done by setting the TQRBand.Enabled property to False. This property can also be set at runtime, before the report is generated or in any event handler during report generation.

During report generation you can also temporarily disable printing of a band from that band’s BeforePrint event. This event gets a parameter, PrintBand, which can be set to False. This will cause the band to be disabled for that single instance. The next time the BeforePrint event is called for the same band you must do the check and set the parameter again to disable it. This can be used as a simple filtering feature:

procedure TrepCusList.RepDetailBeforePrint(Sender: TQRCustomBand;

          var PrintBand: Boolean);

begin

  if CustTableTotalSales > 3000000 then

    PrintBand := true

  else

    PrintBand := false;

end;

It’s often easy to forget that the check above can be done faster and shorter like this:

procedure TrepCusList.RepDetailBeforePrint(Sender: TQRCustomBand;

          var PrintBand: Boolean);

begin

  PrintBand := CustTableTotalSales > 3000000;

end;

If you turn your page footer band off it will have the effect of leaving a blank space at the bottom of the page instead of filling this with detail bands. This is because QuickReport doesn’t check the length of the page footers all the time - it would slow down performance a lot. If you change the enabled property of your page footer you should call the QuickRep.ResetPageFooterSize method so QuickReport can update its page footer information.


Adding Printable Components to the Report

To actually print some information in your reports you add printable components to you bands. There are many printable components included with QuickReport and you can create your own or get add on components if you need special features not found in any of the stock components. The following table shows the printable components included with QuickReport:

TQRLabel	Prints static text much like a TLabel for Delphi forms. The Caption property can be changed during report generation.
TQRDBText	Prints database fields, much like a TDBText for Delphi forms. Also prints memo fields from tables (blob fields).
TQRExpr	Evaluates and prints any QuickReport expression. See the chapter on Expressions for explanation of this component.
TQRSysData	Used to print information like report title, page number, date and time. Note that some of this information can also be printed with the TQRExpr component.
TQRMemo	Much like a TQRLabel, except that it accepts multiple lines of input text. Usually used for long static text areas.
TQRRichText	Prints a RichText formatted memo. Can be linked to a RichEdit component on a form and print the contents. Only available in the 32 bit version (Delphi 2.0 and 3.0).
TQRDBRichText	Data aware version of  TQRRichText. (Only available in the 32 bit version (Delphi 2.0 and 3.0).
TQRShape	Prints rectangles, circles and horizontal and vertical lines.
TQRImage	Used to print static images. Can print a bitmap (BMP), metafile (WMF) or icon.
TQRDBImage	Data aware version of TQRImage. Retrieves the image from a blob field, much like a TDBImage for Delphi forms.


About the Text Components

All QuickReport text components share some basic functionality  which they inherit from their common parent class. If you want more information about the basic printable class and text class read the chapter on expanding QuickReport.

AutoSize

Components can either size them self horizontally to fit whatever text is put into them or they can have a preset width. If the width is preset text will be cut to fit the given rectangle.

WordWrap

If AutoSize is True text can span multiple lines is WordWrap is set to True.

AutoStretch

If WordWrap is True, components can expand vertically if they are to short for the text to fit. If a component expands it will also expand its parent band, provided that band’s CanExpand property is set to True. A band can expand over multiple pages to print long texts.

Note that if a component expands it will not move other components on the same band down. If you have components whose position is depended on the length of a stretching text you should place those on a child band. See the chapter on child bands for more information on this.

Size

All printable components share the Size property. If AutoSize is False you can use this property to set the exact size of the component. Also found here is the position of the component relative to its parent band.

The units are given in the currently selected QuickReport units and thus positioning can be very exact.

If AutoSize is set to false you can also resize and position components by dragging the mouse handles.

Font Style and Text Color

Printable text components can have a individual font setting or use the font from it’s parent band/report. Use the font property to override the font setting from the parent band and use the ParentFont property to set if the component will actually get the font from its parent.

Alignment

Components can be left or right aligned or centered. For AutoSized components this will result in the component expanding to the left (for right aligned text), right (for left aligned) text or both (for centered text).

For components with AutoSize set to false this will result in the text being properly aligned within its preset rectangle

AlignToBand

By default components will print/align at the position set in the designer. Sometimes it might be more practical to align components relative to the band which it’s placed on. You might want to center a title on the page or right align a page number to the page. By setting AlignToBand to True text components will use its current alignment relative to its parent band instead of its own text rectangle.

Background Color and Transparency

Text can be transparent (opaque) or not. If the text is not transparent the Color property is used to fill the background of the text component.

Frame

All text components can have a frame. See the chapter on Frames for more information.

Enabled and Disabled

Just like you can enable and disable bands you can enable and disable text components by setting the Enabled property to True or False. This can be done at design time, at runtime before generating the report or from any event handlers during report generation.

procedure repList.ReportDetailPrint(Sender : TObject;

          var PrintBand : boolean);

begin

{ Print negative values in red, positive in green, remove null value }

  if CustTableCredit.Value < 0 then

    CreditLabel.Font.Color := clRed

  else

    CreditLabel.Font.Color := clGreen;

  if CustTableCredit.Value = 0 then

    CreditLabel.Enabled := false

  else

    CreditLabel.Enabled := true;

end;


Printing Static Text

Static text, like headlines, titles and column names are usually printed with the TQRLabel component. Simply drop it on a band and set the text in the Caption property. The text label will size itself, span multiple lines and word wrap according the settings of these properties.

If you want to print a long block of static text you might use the TQRMemo component. This is a non data aware component with a Lines property where you can insert your text. Text can also be loaded from a stream or file at runtime using the Lines.LoadFromStream or Lines.LoadFromFile methods.


Printing Database Fields

The easiest way to print a field from a table or query is to use the TQRDBText component. It acts very much like a TQRLabel but instead of a caption property it has a DataSet and a FieldName property. These can be used to link the component to any field. All field type supported by Delphi itself is supported by this component, with the exception of binary data stored in blob fields.

When selecting a field the component will simply display FIELD Fieldname in the designer. If no field is connected (none) will be displayed.

A unique feature of this component is that it’s able to work also with data controls disabled. TTable and TQuery has DisableControls method which will cause data bound controls to stop updating. This is used to increase program execution speed. Since QuickReport can retrieve the field values even with controls disabled you can get increased performance by disabling controls before generating your reports. Be aware though - any master detail relationship set up with the MasterSource property of the TTable/TQuery will also be disabled, making this unsuitable for reports using TQRSubDetail components.


Formatting the Output

TQRDBText will use any formatting options defined for the field. If none is defined it will simply print the field in the default format given by Delphi and the current Windows settings. Date, time, currency and floating point fields will be affected by this.

To specifically set a formatting of a field use the Mask property. The mask works differently for different field types.

Numeric fields, including integer and float field, currency and BCD fields are formatted using the FormatFloat function. Date and time fields are formatted using the Delphi FormatDateTime function. Information on both these functions can be found in the Delphi documentation and on line help.


Printing Memo fields

Memo fields are printed just like any other fields with the TQRDBText component. You can give it a preset space by setting AutoSize and AutoStretch to False and manually size the component. Only the text that fits inside the rectangle will be printed. To stretch a memo field set AutoStretch to True. QuickReport will now first use whatever space you have preset, then start expanding the component and the parent band downwards. If there is not enough space on the page or column the text will wrap to the next page/column. In Delphi 1.0 memo fields can be up to 64Kb large, in Delphi 2.0 and 3.0 there are virtually no limits to the text length.


Printing Shapes

Shapes are useful for creating visual effects and better looking report. Apart from the frame which can be drawn around all components and which is covered in a separate chapter you can use the TQRShape component to draw some simple shapes. Simply drop the component on a band, set the Shape property to Rectangle, Circle, HorzLine, VertLine, LeftAndRight or TopAndBottom. Use the Pen property to set pen width and color and the Brush property to set brush style and color. The current version of QuickReport has no feature to automatically expand or align a shape to fit a band but this can be done manually in any events during report generation.


Printing Images

QuickReport can print both static and data bound images using the TQRImage and TQRDBImage components. QuickReport wraps the Delphi TPicture class and can print the formats supported by it. Currently that includes bitmap files (BMP), Windows Metafiles (WMF) and Icon files (ICO). To print other file formats you must get a QuickReport compatible graphics add on component.


Static Images

Place a TQRImage component on a band and double click on the Picture property or on the component itself to bring up the Open Image Dialog. Locate the image you want and click OK. You can use the Stretch property to make the image size itself to fit the size of the component.


Loading Images at Runtime

To load an image at runtime before or during report generation use the TQRImage.Picture.LoadFromFile method. Look up the TPicture component in the Delphi documentation for more information on loading images.


Images Stored in Tables

Use the TQRDBImage to print images stored in blob fields. Drop the component on a form and set the DataSet and DataField properties to a blob field containing pictures in a format supported by TPicture. QuickReport will load and print the images during report generation.

Note:	In QuickReport 1.0 you could use the Delphi TImage and TDBImage components to print images on a report. With QuickReport 2.0 this is no longer supported. The approach used in QuickReport 2.0 results in significantly smaller size of applications which does not use images in reports and no growth in size for applications using images in reports. The new approach is also more flexible when creating add on printable components.


Printing RichText Formatted Memos

The 32-bit version of QuickReport for Delphi 2.0 and 3.0 can print RichText formatted memos with the TQRRichText and TQRDBRichText components. TQRRichText can be linked to a TRichEdit component on a form in your application using the ParentRichEdit property. Linking the component will result in the report printing whatever text is in the parent RichEdit component. You can also edit text directly in the Lines property or load RichText from a file or stream with the Lines.LoadFromStream and Lines.LoadFromFile methods.

RichText fields will expand and can span multiple columns and pages if the AutoStretch property is True.

To print RichText stored in a blob field use the TQRDBRichText component and link to the propitiate field with the DataSet and FieldName properties.

Note that if you export your reports to other formats using the QuickReport export functionality text within RichText components will not be included in the export.


Creating Groups

The TQRGroup component is found on the QuickReport component palette page and can be dropped on a report. When created it appears as a band. This band will be the group header. Every time the group breaks (or a higher level group breaks) the this header band will be printed. In addition you can also add a group footer band. To do this, select the TQRBand component on the palette and drop it on the report. Link the TQRGroup.FooterBand property to the newly created band.

TQRGroup has a Master property which will automatically be set to the main QuickReport component. It should appear above any detail band in the report. A correctly linked group footer band should appear bellow the detail band.

The most important property of TQRGroup except Master is Expression. Enter any valid QuickReport expression in the object inspector or bring up the expression evaluator to aid in designing the expression. The group will break whenever the result of the expression changes. Consider a customer table with an active index on State + Company. To print a group header each time the report reaches a new state you would simply enter State or Customer.State as the group expression. The QuickReport expression evaluator will locate the State field and print the group header before any new state. An attached group footer will be printed when all customers in a state is listed, useful for counting the number of customers in the state, accumulating sales and so on.

The TQuery component uses the following query:

select * from customer order by state, company

The group expression simply says State. Note the two TQRExpr components used in the report. The first TQRExpr is placed on the group header and uses the following expression:

if(State <> '', State, 'Unknown state')

Since not all customers have a state registered this expression will return ‘Unknown state’ for those and return the actual state for the others.

The TQRExpr component on the group footer has the following expression:

'Customers in ' + State + ' : '  + Str(Count)

This expression will print a customer count for each state. The Master property is linked to the TQuickRep component and ResetAfterPrint is set to True so the Count will restart for each state.


QuickReport units, packages and files

Filename	Description
QUICKRPT.DCU	Main unit with report control and design time behavior
QRPRNTR.DCU	Low level printer and preview classes and utility routines
QRCTRLS.DCU	Printable components


QuickRpt unit

Filename

QUICKRPT.DCU

Description

This unit include all classes related to actual reporting, data traversing and most of the design time appearance.

Classes

TCustomQuickRep

TQRBasePanel

TQRControllerBand

TQRCustomBand

TQRFrame

TQRPage

TQRPrintable

TQRPrintableSize

TQRUnitBase

TQuickRepBands

Components

TQRBand

TQRChildBand

TQRGroup

TQRStringsBand

TQRSubDetail

TQuickRep


TQuickRep
TQuickRep component

Unit

QuickRep

Description

Use TQuickRep to create a report connected to a dataset.

TQuickRep is the most commonly used report component. For more information on creating report look in the user's guide.

Properties

Dataset

RecordCount

RecordNumber

TQuickRep inherits additional properties, methods and events from TCustomQuickRep


TQRCompositeReport
TQRCompositeReport component

Description

Use the TQRCompositeReport component connect related or unrelated reports.

Properties

Name

Options

PrinterSettings

ReportTitle

Tag


TQRPreview
TQRPreview component

Example

Unit

QuickRep

Description

Lets you create a customizable runtime report preview.

You can also preview your reports at design time by double- or right-clicking a QuickRep component and choosing Preview.


TQRPreview example

This example creates a report preview that zooms when the preview window is resized.

Steps:

1	Choose File|New Form. The only Form setting you need to change for this example is the AutoScroll property. Change it to False. This setting allows the runtime preview to automatically zoom when the form is resized. If you were to leave AutoScroll at True, the preview would always display at the QRPreview component’s Zoom setting (default 100 percent) when the form is resized.

2	Place components on the form in the order shown below and use the Inspector or indicated instruction to set each component’s values. Leave other values at their defaults.

Component [from palette]	Modification
Table [DataAccess]	DatabaseName property: DBDEMOS TableName property: customer.db Active property: True
QuickRep [QReport]	DataSet property: Table1 OnPreview event: QuickRep1Preview. The Code editor appears. Type this into the new procedure: QRPreview1.QRPrinter := TQRPrinter(Sender); Return to the form. Right-click the report and choose Send To Back from the popup menu. Double-click the placed report to open the Report Settings dialog. Check the Detail band checkbox, then click OK to create a detail band on the report.
QRDBText [QReport]	Place this component on the report’s detail band. DataSet property: Table1 DataField property: Company AlignToBand property: True
Toolbar [Win32]	No property changes.
Button [Standard]	Place this component on the toolbar. Caption property: &Preview Double-click the button to open the Code editor window, and enter this for the Button1Click procedure: QuickRep1.Preview;
QRPreview [QReport]	Place the component anywhere on the form below the toolbar. Align property: alClient
3	Press F9 to run the program. Press the Preview button to load the preview. Note the zoom change as you resize the form.


TQRPrinterSettings.FirstPage
FirstPage

property FirstPage : integer

Applies to

TQRPrinterSettings, TQuickRepPrinterSettings

Description

Use FirstPage to limit printing of a report to a range of pages. Printing will start on the page number specified in FirstPage. Setting FirstPage to 0 or 1 will start printing of page 1.

See also

TQRPrinterSettings


TQuickRep.RecordCount
RecordCount

property RecordCount : integer

Applies to

TQuickRep

Description

RecordCount tries to return the number of records for a master dataset. QuickReport uses this to maintain the progress bar during report generation. Some databases cannot return the record count. For these databases the progress bar will not be displayed.

See also

RecordNumber


TQuickRep.RecordNumber
RecordNumber

property RecordNumber : integer

Applies to

TQuickRep

Description

RecordNumber return the number of the current record being processed by the report. The first record/row is 0.

See Also

RecordCount


TCustomQuickRep.Bands
Bands

property Bands : TQuickRepBands

Applies to

TCustomQuickRep, TQuickRep

Description

Use the Bands property to select what bands should appear on the report. See the TQuickRepBands class for more information.


TQuickRepBands

Unit

QuickRep

Description

Used by TCustomQuickRep.Bands property to store information on what bands to include in a report and maintain references to these bands. Set any of the sub properties to True to automatically create a band of that type. Set any to False to remove any band of that type.

Properties	Methods
ColumnHeaderBand	Create
DetailBand
HasColumnHeader
HasDetail
HasPageFooter
HasPageHeader
HasSummary
HasTitle
PageFooterBand
PageHeaderBand
SummaryBand
TitleBand


TQuickRepBands.HasPageHeader

property HasPageHeader : boolean

Description

If set to true a page header band will be included in the report. The page header band is printed once on the top of each page. Use the Options.FirstPageHeader property to control printing of the page header on the first report page.

See also

TQuickRepBands


TQuickRepBands.HasColumnHeader

property HasColumnHeader : boolean

Description

If set to true a Column header band will be included in the report. A column header band is printed on top of each column for a multi column report (Columns > 1) and once after the page header for a single column report

See also

TQuickRepBands


TQRPrinterSettings.Title
Title

property Title : String

Applies to

TQRPrinterSettings, TQuickRepPrinterSettings

Description

Use Title to specify a name for the print job. This title will appear in the print job queue and in any network printer queue. QuickReport automatically assigns the ReportTitle property as a Title and you should never need to set it manually.

See also

TQRPrinterSettings


TQuickRepBands.HasDetail

property HasDetail : boolean

Description

If set to true a detail band is included in the report. The detail band is printed once for each record/row in the dataset.

See also

TQuickRepBands


TQRPage.RightMargin

property LeftMargin : Extended

Description

Use the RightMargin property to specify the distance from the right edge of the page to the right edge of the bands on the report.

The units of measurement depends on the setting of the Units property.

See also

TQRPage


TQuickRepBands.HasPageFooter

property HasPageFooter : boolean

Description

If set to true a page footer band will be included in the report. The page footer band is printed once on the bottom of each page. Use the Options.LastPageFooter property to control printing of the page footer on the last report page.

See also

TQuickRepBands


TQRPrinterSettings.Orientation
Orientation

property Orientation : TPrinterOrientation

Applies to

TQRPrinterSettings, TQuickRepPrinterSettings

Description

Use the Orientation property to select between Portrait and Landscape printing of the report.

QuickReport automatically assigns the value of the Page.Orientation property to this property and users should not set it directly.

See also

TQRPrinterSettings


TQRPage.PaperSize

TQRPaperSize = (Default, Letter, LetterSmall, Tabloid, Ledger, Legal,

                Statement, Executive, A3, A4, A4Small, A5, B4, B5, Folio,

                Quarto, qr10X14, qr11X17, Note, Env9, Env10, Env11, Env12,

                Env14, CSheet, DSheet, ESheet, Custom)

property PaperSize : TQRPaperSize

Description

Use the PaperSize property to select a specific paper size for the report layout. To print on whatever paper is installed with the printer leave it to Default. To specify your own paper size set PaperSize to Custom and override the Length and Width properties.

See also

TQRPage


TQuickRepBands.HasSummary

property HasSummary : boolean

Description

If set to true a summary band will be included in the report. The summary band is printed once after all detail bands of a report. Typically the summary band is used to print totals or summary information calculated throughout the report.

See also

TQuickRepBands


TQRPage.Orientation

TPrinterOrientation = (poPortrait, poLandscape) (PRINTERS.DCU)

property Orientation : TPrinterOrientation

Description

Use the Orientation property to select between Portrait and Landscape printing of the report.

See also

TQRPage


TQuickRepBands.HasTitle

property HasTitle : boolean

Description

If set to true a title band will be included in the report. The title band is printed once before any detail record of the report. If you want the title band to appear instead of a page header on the first report page set the Options.FirstPageHeader to False.

See also

TQuickRepBands


TQuickRepBands.ColumnHeaderBand

property ColumnHeaderBand : TQRCustomBand

Description

Returns a reference to the column header band. If no such band exists nil is returned.

See also

TQuickRepBands


TQuickRepBands.DetailBand
TQuickRepBands.DetailHeaderBand

property DetailBand : TQRCustomBand

Description

Returns a reference to the detail band. If no such band exists nil is returned.

See also

TQuickRepBands


TQuickRepBands.PageFooterBand

property PageFooterBand : TQRCustomBand

Description

Returns a reference to the page footer band. If no such band exists nil is returned.

See also

TQuickRepBands


TQuickRepBands.PageHeaderBand

property PageHeaderBand : TQRCustomBand

Description

Returns a reference to the page header band. If no such band exists nil is returned.

See also

TQuickRepBands


TQuickRepBands.SummaryBand

property SummaryBand : TQRCustomBand

Description

Returns a reference to the summary band. If no such band exists nil is returned.

See also

TQuickRepBands


TQRPrinterSettings.PaperSize
PaperSize

TQRPaperSize = (Default, Letter, LetterSmall, Tabloid, Ledger, Legal,

                Statement, Executive, A3, A4, A4Small, A5, B4, B5, Folio,

                Quarto, qr10X14, qr11X17, Note, Env9, Env10, Env11, Env12,

                Env14, CSheet, DSheet, ESheet, Custom)

property PaperSize : TQRPaperSize

Applies to

TQRPrinterSettings, TQuickRepPrinterSettings

Description

Use the PaperSize property to select a specific paper size for the report layout. To print on whatever paper is installed with the printer leave it to Default. To specify your own paper size set PaperSize to Custom and override the Length and Width properties.

QuickReport automatically assigns the value of the Page.PaperSize property to this property and users should not set it directly.

See also

TQRPrinterSettings


TQuickRepBands.TitleBand

property TitleBand : TQRCustomBand

Description

Returns a reference to the title band. If no such band exists nil is returned.

See also

TQuickRepBands


TQuickRepBands.Create

constructor TQuickRepBands.Create(AOwner : TCustomQuickRep)

Description

Internal QuickReport method

See also

TQuickRepBands


TQRCustomBand
TQRCustomBand class

Unit

QuickRep

Description

TQRCustomBand is the base class for all the different bands in QuickReport. You never use the TQRCustomBand directly but instead any of the descendant classes. Many properties declared and implemented in TQRCustomBand are published in the child classes.

Properties	Methods	Events
AlignToBottom	Create	AfterPrint
BandType	Destroy	BeforePrint
ChildBand	CanExpand
Color	ExpandBand
Enabled
Expanded
Font
ForceNewColumn
ForceNewPage
HasChild
LinkBand
Size
TQRCustomBand inherits additional properties from TQRBasePanel


TQuickRep.Dataset
Dataset

property Dataset : TDataset

Applies to

TQuickRep, TQRSubDetail

Description

Use the Dataset property to connect a report or a subdetail to a dataset. The dataset can be a TQuery, TTable, TRemoteDataset or any other TCustomDataset descendant. The report or subdetail will print one detail band for each record in the dataset, starting with the first record. Use the PrintIfEmpty property to decide how the report should behave if the dataset contain no records/rows.

If you connect your report to a dataset which is also connected to visual controls on your report you might get a lot of flickering during report generation and the report might take a long time to finish. It's a good idea to set the Dataset.DisableControls property to True if such is the case. Note however that disabling controls will also disable any master/detail relationship you have set up.


Transparent

property Transparent : Boolean (True)

Applies to

TQRDBText, TQRExpr, TQRLabel, TQRMemo, TQRSysData

Description

Use the Transparent property to determine whether control will, or will not paint the background. If the background is not painted you can see other underlying components through the text.


TCustomQuickRep.Description
Description

property Description : TStrings

Applies to

TCustomQuickRep, TQuickRep

Description

Use the Description property to enter a description of the report and any comments you need regarding it. The property itself is not used by QuickReport but you can use it in your applications to display additional information to users when they are about to select a report. You can look at the QuickReport demo project found in the \demos\quickrpt\ directory for an example on how to do this.


TCustomQuickRep.Font
Font

property Font : TFont

Applies to

TCustomQuickRep, TQuickRep

Description

This property is used to select the default font for the report. All printable controls on the report will use this font if they don't override it or they are placed on a band with another font selected.


TQRSysData.Text
Text

property Text : String

Applies to

TQRSysData

Description

Use the Text property to print the contents it holds prior to the actual value of the TQRSysData component. For example if Text is ‘Page’ and the Data property is set to PageNumber, the component will display ‘Page 1 ‘, ‘Page 2’, and so on.


TQRPrinterSettings.LastPage
LastPage

property LastPage : integer

Applies to

TQRPrinterSettings, TQuickRepPrinterSettings

Description

Use LastPage to limit printing of a report to a range of pages. Printing will end on the page number specified in LastPage. Setting LastPage to 0 will make the report print until the very last page.

See also

TQRPrinterSettings


TCustomQuickRep.Functions
Functions

property Functions : TQREvEnvironment

Applies to

TCustomQuickRep, TQuickRep

Description

Use the Functions property to access the reports user defined variables, constants and functions. More information on using this can be found under TQREvEnvironment and in the chapter about using the report environment.

At design time you can double click this property in the object inspector to bring up the report environment editor. Here you can add, edit and delete functions.


TCustomQuickRep
TCustomQuickRep class

Unit

QuickRep

Description

TCustomQuickRep is an abstract ancestor class for all data aware and non data aware report components, including TQuickRep, TQuickAbstractRep and TMailingLabelRep. You will never use TCustomQuickRep directly.

At design time you add bands and printable controls to the report component to create a fully functioning report. At run time you can call the Preview or Print methods to generate the report.

Properties	Methods	Events
AllDatasets	AddBand	AfterPreview
Available	AddNotifyClient	AfterPrint
BandList	Cancel	BeforePrint
Bands	Cancelled	OnEndPage
ColumnTopPosition	Create	OnNeedData
CurrentColumn	CreateBand	OnPreview
CurrentX	CreateNew	OnStartPage
CurrentY	Destroy
Description	EndPage
ExportFilter	ExportToFilter
Exporting	HideBands
FinalPass	Modify
Font	NewColumn
Functions	NewPage
Options	Prepare
Page	Preview
PageNumber	PreviewModal
Printer	PreviewModeless
PrinterSettings	Print
PrintIfEmpty	PrinterSetup
QRPrinter	RemoveBand
ReportTitle	ResetPageFooterSize
ShowProgress	RotateBands
State	SetBandValues
Units
Zoom
TQRCustomReport inherits additional properties from TQRBasePanel


TCustomQuickRep.AllDatasets
AllDatasets

property AllDatasets : TList

Applies to

TCustomQuickRep, TQuickRep

Description

AllDatasets is a list of all datasets used by the report, including any datasets used for master-detail relationships. Expression evaluators uses this property to determine what datasets to search for data fields. You can manually add additional datasets in the BeforePrint event. This event is the earliest point during report generation this list is available.

Example

This example makes the CustomerTable on DataModule1 available for expressions in your report:

procedure TMyReport.BeforePrint(Sender : TCustomQuickRep; var PrintReport : Boolean);

begin

  MyReport.AllDatasets.Add(DataModule1.CustomerTable)

end;


TCustomQuickRep.Available
Available

property Available : Boolean (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

Use the Available property if you need to know if it's safe to call a report's Preview or Print method. If the report is already active Available will return False and the report cannot run. If Available is True it's ok to run the report.


TCustomQuickRep.BandList
BandList

property BandList : TList

Applies to

TCustomQuickRep, TQuickRep

Description

BandList is a list of all bands on the report. This is used internally by QuickReport and should normally not be modified by the user. Calling RebuildBandList will clear and rebuild this list and since you don't know when QuickReport might make this call internally it's not safe to manually add bands to the list.


TCustomQuickRep.ColumnTopPosition
ColumnTopPosition

property ColumnTopPosition : integer (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

ColumnTopPosition is used internally by QuickReport and should normally not be accessed by the user.


TCustomQuickRep.Currentcolumn

property CurrentColumn : Integer (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

CurrentColumn returns the number of the column the report is currently printing. For a single column report this will always be 1. For a multi column report the number will be between 1 and the number specified in the Page.Columns property. This property is an internal QuickReport property and rarely used by the user.


TCustomQuickRep.CurrentX
CurrentX

property CurrentX : Integer (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

CurrentX is an internal QuickReport property and should rarely be access by the user. It is used to maintain the current horizontal position for bands during report generation.


TCustomQuickRep.CurrentY
CurrentY

property CurrentY : Integer (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

CurrentY is an internal QuickReport property and should rarely be access by the user. It is used to maintain the current vertical position for bands during report generation.


TCustomQuickRep.ExportFilter
ExportFilter

property ExportFilter : TQRExportFilter (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

ExportFilter will return a reference to the currently used export filter class if the report is in the process of exporting. This property is rarely used. To export a report by code use the ExportToFilter method


TCustomQuickRep.Exporting
Exporting

property Exporting : boolean (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

During report generation Exporting will return True if an export filter is active (the report is being exported). This property is usually not accessed by the user.


TCustomQuickRep.FinalPass
FinalPass

property FinalPass : Boolean (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

FinalPass is an internal QuickReport property and should not be accessed by the user.


TCustomQuickRep.Options
Options

property Options : TQuickReportOptions

Applies to

TCustomQuickRep, TQuickRep

Description

The Options property is used to set several flags to how the report should behave. See TQuickReportOptions for more information.


TQuickReportOptions

TQuickReportOption  = (FirstPageHeader, LastPageFooter, Compression)

TQuickReportOptions = set of TQuickReportOption

Applies to

TCustomQuickRep, TQuickRep

Description

The Options property uses this set to store report settings.

Option	True	False
FirstPageHeader	Page header is printed on the first page	Page header is not printed on the first page
LastPageFooter	Page footer is printed on the last page	Page footer is not printed on the last page
Compression	Report is being compressed in memory during generation	Report is not compressed in memory during generation


TCustomQuickRep.Page
Page

property Page : TQRPage

Applies to

TCustomQuickRep, TQuickRep

Description

Use the Page property to set page layout information for the report. See TQRPage for more information.


TQRPage

Unit

QuickRep

Description

The Page property uses TQRPage to store information about page layout for the report. TQRPage has a number of properties that affect how the report appears in the designer as well as how it is printed.

Properties	Methods
BottomMargin	Create
Columns
ColumnSpace
LeftMargin
Length
Orientation
PaperSize
RightMargin
Ruler
TopMargin
Width
TQRPage inherits additional properties from the TQRUnitBase class


TQRPage.BottomMargin

property BottomMargin : Extended

Description

BottomMargin is the minimum blank space QuickReport will leave at the bottom of each page. If the report has a page footer the bottom of the page footer will appear exactly at this distance from the bottom of the page.

A band can be aligned exactly to the bottom margin by setting its AlignToBottom property to True

The units of measurement depends on the setting of the Units property.

See also

TQRPage


TQRPage.Columns

property Columns : Integer

Description

Use the Columns property to create a report where you have multiple columns of detail bands. This is useful for printing phone directory style reports, mailing labels etc. Columns can be set to any value greater than 0

See also

TQRPage


TQRPage.ColumnSpace

property TQRPage.ColumnSpace

Description

ColumnSpace is the spacing inserted between each column in a multi column report. For a report with only one column this property has no effect.

The units of measurement depends on the setting of the Units property.

See also

TQRPage


TQRPage.LeftMargin

property LeftMargin : Extended

Description

Use the LeftMargin property to specify the distance from the left edge of the page to the left edge of the bands on the report.

The units of measurement depends on the setting of the Units property.

See also

TQRPage


TQRUnitBase.Units
Units

TQRUnit = (MM, Inches, Pixels, Characters, Native)

property Units : TQRUnit

Applies to

TQRUnitBase, TQRPage

Description

QuickReport allows you to work with several different units of measurement while designing reports. The Units property is used to select what unit type you want to work with. QuickReport will automatically convert all values throughout the report to reflect the newly selected unit. This property is set indirectly by the TCustomQuickRep.Units property.

Value	Description
MM	Millimeters
Inches	Inches
Pixels	Screen Pixels
Characters	Current font size, approximation
Native	QuickReport internal unit, 1/100 MM
See also

TQRUnitBase


TQRUnitBase

Unit

QuickRep

Description

TQRUnitBase is a low level class used by QuickReport as an ancestor for all classes that require switching between different units of measurement.

It is uncommon to use this class directly but some of the properties are published in descending classes like TQRPage.

Properties	Methods
ParentReport	Create
ParentUpdating
Resolution
Units
Zoom


TQRUnitBase.Resolution
Resolution

property Resolution : Integer

Applies to

TQRUnitBase, TQRPage

Description

Use Resolution to retrieve the current screen DPI setting. This property is used internally by QuickReport and should rarely be accessed by users.

See also

TQRUnitBase


TQRUnitBase.ParentUpdating
ParentUpdating

property ParentUpdating : Boolean

Applies to

TQRUnitBase, TQRPage

Description

This property is used internally by QuickReport

See also

TQRUnitBase


TQRUnitBase.ParentReport
ParentReport

property ParentReport : TCustomQuickRep

Applies to

TQRUnitBase, TQRPage

Description

This property is used internally by QuickReport

See also

TQRUnitBase


TQRUnitBase.Zoom
Zoom

property Zoom : Integer

Applies to

TQRUnitBase, TQRPage

Description

Internal QuickReport property. Use TCustomQuickRep.Zoom.

See also

TQRUnitBase


TQRPage.Length

property Length : Extended

Description

Use the Length property to specify a custom paper length/height. PaperSize must be set to Custom for this setting to take effect. For other paper sizes this property will tell you the length/height of the currently selected paper.

The units of measurement depends on the setting of the Units property.

See also

TQRPage


TQRUnitBase.Create

Description

Creates an instance of a TQRUnitBase class. Users should never create this class manually

See also

TQRUnitBase


TQRPage.TopMargin

property TopMargin : Extended

Description

Use the TopMargin to specify the distance from the top of the page to the top of the first band.

The units of measurement depends on the setting of the Units property.

See also

TQRPage


TQRPage.Width

property Width : Extended

Description

Use the Width property to specify a custom paper width. PaperSize must be set to Custom for this setting to take effect. For other paper sizes this property will tell you the width of the currently selected paper.

The units of measurement depends on the setting of the Units property.

See also

TQRPage


TQRPage.Ruler

property Ruler : Boolean

Description

If Ruler is True and Units is set to MM, Inches or Characters, a background grid will be drawn on the report and on any bands, corresponding to the selected units. This makes aligning components easier.

See also

TQRPage


TQRPage.Create

Description

Creates an instance of a TQRPage class. Users should never create this class manually

See also

TQRPage


TCustomQuickRep.PageNumber
PageNumber

property PageNumber : Integer (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

During report generation you can use the PageNumber property to determine the what page is currently being generated.


TCustomQuickRep.Printer
Printer

property Printer : TQRPrinter (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

Included for backwards compatibility. Use QRPrinter property instead.


TCustomQuickRep.QRPrinter
QRPrinter

property QRPrinter : TQRPrinter

Applies to

TCustomQuickRep, TQuickRep

Description

Returns a reference to the currently used QRPrinter object. If you need access to the QRPrinter's Canvas or other properties during report generation this property gives a safe way to get it.


TQRPrinterSettings.Copies
Copies

property Copies : integer

Applies to

TQRPrinterSettings, TQuickRepPrinterSettings

Description

Copies can be used to make the printer print more than one copy of each page. Not all printer drivers support multiple copies or there might be a limit to the number of copies that can be printed.

See also

TQRPrinterSettings


TCustomQuickRep.PrinterSettings
PrinterSettings

property PrinterSettings : TQuickRepPrinterSettings

Applies to

TCustomQuickRep, TQuickRep

Description

The PrinterSettings property is used to set several printer specific options. See TQuickRepPrinterSettings for more details.


TQRPrinterSettings.Duplex
Duplex

property Duplex : True

Applies to

TQRPrinterSettings, TQuickRepPrinterSettings

Description

Setting Duplex to True will case reports to be printed on both sides of the paper on a duplex enabled printer. This version of QuickReport will only print in the 'horizontal' duplex mode. Setting Duplex to True will force all printers to print on only one side of the paper.

See also

TQRPrinterSettings


TQuickRepPrinterSettings

Unit

QuickRep

Description

TCustomQuickRep uses TQuickRepPrinterSettings to store the printer specific setup information of the PrinterSettings property.

TQuickRepPrinterSettings is a subclass of TQRPrinterSettings, publishing the Copies, Duplex, FirstPage, LastPage and OutputBin properties.

For more information see TQRPrinterSettings.


QRPrntr
QRPrntr unit

Filename

QRPRNTR.DCU

Description

This unit include all low level classes to communicate directly with the printer, preview functionality and several utility classes and functions.

Classes

For additional details on this element, see the QuSoft Web site at http://www.qusoft.com.


TQRPrinterSettings

Unit

QRPrntr

Description

TQRPrinterSettings store printer specific setup information and can communicate these settings into a TQRPrinter object. Users should not create instances of this class, this is handled internally by QuickReport.

Properties	Methods
Copies	Create
Duplex	ApplySettings
FirstPage
LastPage
Orientation
OutputBin
PaperSize
PrinterIndex
Title


TQRPrinterSettings.PrinterIndex
PrinterIndex

property PrinterIndex : integer

Applies to

TQRPrinterSettings, TQuickRepPrinterSettings

Description

Use PrinterIndex to select the destination printer for the report. Set PrinterIndex to -1 to print to the default printer. For more information on PrinterIndex see TPrinter.PrinterIndex.

See also

TQRPrinterSettings


TQRPrinterSettings.OutputBin
OutputBin

TQRBin = (First, Upper, Lower, Middle, Manual, Envelope, EnvManual, Auto,

          Tractor, SmallFormat, LargeFormat, LargeCapacity, Cassette, Last)

property OutputBin : TQRBin

Applies to

TQRPrinterSettings, TQuickRepPrinterSettings

Description

If a printer is equipped with several paper sources (bins) this property is used to select from what bin QuickReport will print.

Note that several printers require paper to be inserted in the Manual bin before starting a print job for paper to be drawn from the manual bin. If no paper is in the manual bin the default bin will be used.

See also

TQRPrinterSettings


TQRPrinterSettings.Create

constructor Create

Description

Creates an instance of a TQRPrinterSettings class. Users should never create this class manually

See also

TQRPrinterSettings


TQRPrinterSettings.ApplySettings

procedure ApplySettings(APrinter : TQRPrinter)

Description

Calling ApplySettings will merge the settings selected in the TQRPrinterSettings object into APrinter. This must be done before the print job is started. This method is used internally by QuickReport and users should never need to call this manually.

See also

TQRPrinterSettings


TCustomQuickRep.PrintIfEmpty
PrintIfEmpty

property PrintIfEmpty : Boolean

Applies to

TCustomQuickRep, TQuickRep

Description

Use PrintIfEmpty to tell QuickReport how to behave if there are no records/rows in the dataset.

If PrintIfEmpty is True a page will be generated, printing any page header, title, summary and page footer band.

If PrintIfEmpty is False no page will be generated at all.


TCustomQuickRep.ReportTitle
ReportTitle

property ReportTitle : String

Applies to

TCustomQuickRep, TQuickRep

Description

Use ReportTitle to specify a title for the report. The title can be retrieved during report generation by the TQRSysData component and it is also stored in the report environment for use in expressions.

In addition the ReportTitle is uses fed to the TQRPrinterSettings object during report generation and used as a title for the print job.


TCustomQuickRep.ShowProgress
ShowProgress

property ShowProgress : Boolean

Applies to

TCustomQuickRep, TQuickRep

Description

Use ShowProgress to enable or disable a progress form being displayed during printing of the report.


TCustomQuickRep.State
State

TQRState = (qrAvailable, qrPrepare, qrPreview, qrPrint, qrEdit)

property State : TQRState (read only)

Applies to

TCustomQuickRep, TQuickRep

Description

Check State to find out what exactly a report is doing at the moment.

Value	Meaning
qrAvailable	The report is ready to be previewed or printed
qrPrepare	A report generation process is going on
qrPreview	A preview of the report is being displayed
qrPrint	The report is being printed
qrEdit	The report is being edited in a report editor


TCustomQuickRep.Units
Units

property Units : TQRUnits

Applies to

TCustomQuickRep, TQuickRep

Description

QuickReport allows you to work with several different units of measurement while designing reports. The Units property is used to select what unit type you want to work with. QuickReport will automatically convert all values throughout the report to reflect the newly selected unit. See the TQRUnitBase.Units for more information.


TCustomQuickRep.AddBand

procedure AddBand(ABand : TQRCustomBand)

Description

AddBand is an internal QuickReport method and should not be called.

See also

TCustomQuickRep


TCustomQuickRep.Zoom
Zoom

property Zoom : Integer

Applies to

TCustomQuickRep, TQuickRep

Description

QuickReport allows you to the report to be Zoomed in and out while being edited in the IDE. This allows adjusting fine details or getting a nice overview of the report. Set the Zoom value to 100 for normal view. Smaller values give a shrinked view of the report while larger values will zoom in on fine details


TCustomQuickRep.AddNotifyClient

procedure AddNotifyClient(Value : TQRPrintable)

Description

AddNotifyClient is an internal QuickReport method and should not be called.

See also

TCustomQuickRep


TCustomQuickRep.SetBandValues

procedure SetBandValues

Description

SetBandValues is an internal QuickReport method and should not be called.

See also

TCustomQuickRep


TCustomQuickRep.Cancel

procedure Cancel

Description

Cancel can be called from an event during report generation. QuickReport will then abort the report as soon as possible and set the Cancelled property to True

See also

TCustomQuickRep


TCustomQuickRep.Cancelled
Cancelled

property Cancelled : Boolean

Applies to

TCustomQuickRep, TQuickRep

Description

Use the Cancelled property if you need to know if a report finished generating normally or if it was canceled. Calling the Cancel method sets Cancelled to True.


TCustomQuickRep.RotateBands

property RotateBands : integer

Description

RotateBands is an internal QuickReport property and should not be used

See also

TCustomQuickRep


TCustomQuickRep.ResetPageFooterSize

procedure ResetPageFooterSize

Description

ResetPageFooterSize needs to be called if you change the height of the page footer band during report generation.

See also

TCustomQuickRep


TCustomQuickRep.RemoveBand

procedure RemoveBand(aBand : TQRCustomBand)

Description

RemoveBand is an internal QuickReport property and should not be used

See also

TCustomQuickRep


TCustomQuickRep.CreateNew

constructor CreateNew(AOwner : TComponent; Dummy: Integer = 1)

Description

CreateNew is an internal QuickReport property and should not be used

See also

TCustomQuickRep


TCustomQuickRep.ExportToFilter
TCustomQuickRep.EndExportToFilter

procedure ExportToFilter(AFilter : TQRExportFilter)

Description

Use ExportToFilter to invoke a report export filter by code.

Example

procedure MyForm.ButtonClick(Sender : TObject);

var

  AExportFilter : TQRHTMLDocumentFilter;

begin

   AExportFilter := TQRHTMLDocumentFilter.Create('REPORT.HTM');

   try

      MyReport.ExportToFilter(AExportFilter)

   finally

      AExportFilter.Free;

   end;

end;

See also

TCustomQuickRep


TCustomQuickRep.Destroy

destructor Destroy;

Description

Do not call Destroy directly. Use Free instead.

See also

TCustomQuickRep


TCustomQuickRep.HideBands

procedure HideBands

Description

HideBands is an internal QuickReport property and should not be used

See also

TCustomQuickRep


TCustomQuickRep.Modify

procedure Modify

Description

Modify is an internal QuickReport property and should not be used

See also

TCustomQuickRep


TCustomQuickRep.CreateBand

function CreateBand(BandType : TQRBandType)

Description

CreateBand is and internal QuickReport function and should not be called.

See also

TCustomQuickRep


TCustomQuickRep.Create

constructor Create(AOwner : TComponent)

Description

Creates an instance of a the TCustomQuickRep class. Users should never call this directly for TCustomQuickrep and rarely for any descending classes.

See also

TCustomQuickRep


TCustomQuickRep.EndPage

procedure EndPage

Description

Endpage is an internal QuickReport method. Do not use this method to force a new page during a report, use the NewPage or NewColumn property.

See also

TCustomQuickRep


TCustomQuickRep.NewColumn

procedure NewColumn

Description

Use the NewColumn method to force a report to move onto the top of the next column. If the report is currently printing the last column of the page, or the report is a single column report, a NewPage call will automatically be issued.

It is advised to always call NewColumn instead of NewPage directly..

See also

TCustomQuickRep


TCustomQuickRep.NewPage

procedure NewColumn

Description

Use the NewPage method to force a report to move onto the next page. You can call this method the AfterPrint event of any band during report generation to manually control the report layout.

It is advised to always call NewColumn instead of NewPage directly..

See also

TCustomQuickRep


TCustomQuickRep.Prepare

procedure Prepare

Description

Use prepare if you want to generate a report without automatically bring up a preview window or print it. The report will be stored within a QRPrinter object and can be saved to disk, printed or viewed on screen. If you call Prepare you are responsible for freeing the QRPrinter object generated. This is accessed through the TCustomQuickRep.QRPrinter property.

Example

begin

   MyReport.Prepare;

   try

      MyReport.QRPrinter.SaveToFile('MyReport.qrp');

   finally

      MyReport.QRPrinter.Free;

   end;

   MyReport.QRPrinter := nil;

end;

See also

TCustomQuickRep


TCustomQuickRep.Preview

procedure Preview

Description

Use Preview to generate the report and bring up an on screen preview of it. From the preview window the user can choose to print the report.

When calling Preview the report is generated without creating a background thread. If you use a database driver that is thread safe you can use PreviewModal or PreviewModeless to bring up true modal or modeless previews. The window created by Preview is not a true Modal window but the program will not continue until the preview is closed.

You can install your own preview dialog instead of the standard preview form provided with QuickReport. For more information see TQRPreview.

See also

TCustomQuickRep


TCustomQuickRep.PreviewModal

procedure PreviewModal

Description

Use Preview to generate the report and bring up an on screen preview of it. From the preview window the user can choose to print the report.

When calling PreviewModal the report is generated without in a background thread. Some database drivers are not thread safe and this might cause unexpected behavior or program crashes. Only use PreviewModal in situations where it is sure that a thread safe database driver will be used.

See also

TCustomQuickRep


TCustomQuickRep.PreviewModeless

procedure PreviewModeless

Description

Use Preview to generate the report and bring up an on screen preview of it. From the preview window, the user can choose to print the report.

When calling PreviewModeless the report is generated without a background thread. Some database drivers are not thread-safe and this might cause unexpected behavior or program crashes. Only use PreviewModeless in situations where you’re sure that a thread-safe database driver will be used.

The program will continue executing on the next line after the PreviewModeless call while the report is being generated and previewed.

See also

TCustomQuickRep


TCustomQuickRep.Print

procedure Print

Description

Call Print to generate the report to a printer. The report will be printed to the printer selected in the PrinterSetup.PrinterIndex property or the default printer if this property is -1.

For compatibility with non thread safe database drivers this version of QuickReport doesn't create a background thread when printing a report.

See also

TCustomQuickRep


TCustomQuickRep.PrinterSetup

procedure PrinterSetup

Description

Calling PrinterSetup will display a printer setup dialog, allowing the user to select destination printer, number of copies, first and last page etc. For more information on printer setup dialog look up the Delphi TPrinterDialog.

See also

TCustomQuickRep


TCustomQuickRep.AfterPreview

type TQRAfterPreviewEvent = procedure (Sender : TObject) of object

property AfterPreview : TQRAfterPreviewEvent

Applies to

TCustomQuickrep, TQuickRep

Description

The AfterPreview event is called when the user closes the preview form.


TCustomQuickRep.AfterPrint

type TQRAfterPrintEvent = procedure (Sender : TObject) of object

property AfterPrint : TQRAfterPrintEvent

Applies to

TCustomQuickrep, TQuickRep

Description

The AfterPreview event is called when printing of the report is finished.


TCustomQuickRep.BeforePrint

type TQRReportBeforePrintEvent = procedure (Sender : TCustomQuickRep;

                                            var PrintReport : Boolean) of object

property BeforePrint : TQRBeforePrintEvent

Applies to

TCustomQuickrep, TQuickRep

Description

The BeforePrint event is called before the report is generated. This applies to both preview and print. Set the PrintReport parameter to False to stop the report from being generated.


TCustomQuickRep.OnEndPage
TCustomQuickRep.BeforePrint

property OnEndPage : TNotifyEvent

Applies to

TCustomQuickrep, TQuickRep

Description

The OnEndPage event is called when a page is finished, just before the report will go to the next  page. You can use this event to reset any manual calculations you are doing or even draw or print to the QRPrinter's canvas.


TCustomQuickRep.OnNeedData

type TQROnNeedDataEvent = procedure (Sender : TObject; var MoreData : Boolean) of object

property OnNeedData : TQROnNeedDataEvent

Applies to

TCustomQuickrep, TQuickRep, TQRSubDetail

Description

For details on this element, see the QuSoft Web site at http://www.qusoft.com.


TCustomQuickRep.OnPreview

property OnPreview : TNotifyEvent

Applies to

TCustomQuickrep, TQuickRep

Description

For details on this element, see the QuSoft Web site at http://www.qusoft.com.


TCustomQuickRep.OnStartPage

property OnStartPage : TNotifyEvent

Applies to

TCustomQuickrep, TQuickRep

Description

The OnStartPage event is called just after QuickReport has created a new page. You can print or draw anything on the page or reset/initiate any calculations you need to perform during printing of the page


TQRControllerBand
TQRControllerBand class

Unit

QuickRep

Description

TQRControllerBand is an abstract class for any QuickReport band that can connect to some sort of dataset or data retrieving functionality. You will never use TQRControllerBand directly but rather the subclasses like TQRSubDetail, TQRStringsBand or TQRLoopBand.

Properties	Methods
Master	Create
PrintIfEmpty	Destroy
PrintBefore
The TQRControllerBand inherits additional properties and events from TQRCustomBand


TQRSubDetail
TQRSubDetail component

Unit

QuickRep

Description

Use TQRSubDetail if you want to create a master/detail report. Connect its Dataset property to the child dataset and set the Master property to point to the report object. For each record in the master table/report the TQRSubDetail will print all the records in the child table.

The tables should be set up in a proper master/detail relationship so the child tables reflect only records corresponding to the current master table. See Delphi help form more information on setting up master/detail relationship between tables.

Multilevel master detail can be created by setting the Master property to point to another TQRSubDetail

Properties	Methods	Events
Bands	AddNotifyClient	OnNeedData
Dataset
FooterBand
HeaderBand
TQRSubDetail inherits additional properties, methods and events from TQRControllerBand


TQRControllerBand.Master
Master

property Master : TComponent

Applies to

TQRControllerBand, TQRSubDetail, TQRStringsBand

Description

Use the Master property to set up a correct master/detail relationship on your report. The Master property can set to the Report itself or to another TQRControllerBand.

Although the property is declared as a TComponent it should only be linked to TCustomQuickRep or TQRControllerBand descendants.

See also

TQRControllerBand


TQRControllerBand.PrintIfEmpty
PrintIfEmpty

property PrintIfEmpty : boolean

Applies to

TQRControllerBand, TQRSubDetail

Description

Use PrintIfEmpty to tell the controller band  how to behave if there are no records/rows in the dataset.

If PrintIfEmpty is True any Header or Footer bands will still be printed. If PrintIfEmpty is false, no Header or Footer bands will be printed.

See also

TQRControllerBand


TQRControllerBand.PrintBefore
PrintBefore

property PrintBefore : boolean

Applies to

TQRControllerBand, TQRSubDetail, TQRStringsBand

Description

If PrintBefore is True, the controller band will be printed before any detail band of the Master. If PrintBefore is False, any detail band in the master will be printed first, followed by this band.

See also

TQRControllerBand


TQRControllerBand.Create

constructor Create(AOwner : TComponent)

Description

Creates an instance of a the TQRControllerBand class. Users should never call this directly for TQRControllerBand and rarely for any descending classes.

See also

TQRControllerBand


TQRControllerBand.Destroy

destructor Destroy;

Description

Do not call Destroy directly. Use Free instead.

See also

TQRControllerBand


TQRSubDetailGroupBands

Unit

QuickRep

Description

Used by Bands property to store information on Header and Footer bands for a TQRSubDetail. Set any of the properties to True to automatically create a band of that type and set them to False to remove any band of that type.

Properties	Methods
FooterBand	Create
HasFooter
HasHeader
HeaderBand


TQRSubDetail.Bands

property Bands : TQRSubDetailGroupBands

Description

Use the Bands property to enable or disable printing of Header and Footer bands for the TQRSubDetail. See TQRSubDetailGroupBands for more information.


TQRSubDetailGroupBands.HeaderBand

property HeaderBand : TQRCustomBand

Description

The HeaderBand property returns a reference to any header band associated with the TQRSubDetail. If no header band exists nil is returned. See Hasheader for more information on header bands for TQRSubDetail.

See also

TQRSubDetailGroupBands


TQRSubDetailGroupBands.FooterBand

property FooterBand : TQRCustomBand

Description

The FooterBand property returns a reference to any footer band associated with the TQRSubDetail. If no footer band exists nil is returned. See HasFooter for more information on footer bands for TQRSubDetail.

See also

TQRSubDetailGroupBands


TQRSubDetailGroupBands.HasFooter

property HasFooter : boolean

Description

If set to True a footer band will be created for the TQRSubDetail. The footer band will be printed after the TQRSubDetail itself has been printed for all records/rows, acting as a group footer band suitable for printing totals for all records in the sub detail. Setting HasFooter to False will delete any footer band.

See also

TQRSubDetailGroupBands


TQRSubDetailGroupBands.HasHeader

property HasHeader : boolean

Description

If set to True a header band will be created for the TQRSubDetail. The header band will be printed before the TQRSubDetail itself is printed for all records/rows, acting as a group header band. Setting HasHeader to False will delete any header band.

See also

TQRSubDetailGroupBands


TQRSubDetailGroupBands.Create

constructor Create(AOwner : TQRSubDetail)

Description

Creates an instance of a the TQRSubDetailGroupBands class. Users should never call this directly.

See also

TQRSubDetailGroupBands


TQRSubDetail.AddNotifyClient

procedure AddNotifyClient(Value : TQRPrintable)

Description

AddNotifyClient is an internal QuickReport method and should not be called.

See also

TQRSubDetail


TQRSubDetail.FooterBand

property FooterBand : TQRCustomBand

Description

Set the FooterBand to any band on your report to act as a group footer band for the QRSubDetail. A better way to add a footer band is to set the Bands.HasFooter property to True.

The FooterBand property will also return you a reference to a footer band associated with the QRSubDetail or return nil if no such band exists.

See also

TQRSubDetail


TQRSubDetail.HeaderBand

property HeaderBand : TQRCustomBand

Description

Set the HeaderBand to any band on your report to act as a group header band for the QRSubDetail. A better way to add a footer band is to set the Bands.HasHeader property to True.

The HeaderBand property will also return you a reference to a header band associated with the QRSubDetail or return nil if no such band exists.

See also

TQRSubDetail


TQRCustomBand.BandType

type TQRBandType = (rbTitle, rbPageHeader, rbDetail, rbPageFooter, rbSummary,

                    rbGroupHeader, rbGroupFooter, rbSubDetail, rbColumnHeader,

                    rbOverlay, rbChild)

property BandType : TQRBandType

Applies to

TQRCustomBand, TQRSubDetail, TQRBand, TQRChildBand, TQRGroup

Description

BandType is used to identify the role of a band in the report. Some band types are reserved for special components and should not be used.

BandType	Description
rbTitle	Printed on the first page of the report after the page header
rbPageHeader	Printed on top of each page. Printing on the first page can be switched off with the Options property
rbDetail	Printed once for every record/row in the connected dataset
rbPageFooter	Printed at the bottom of each page. Printing on the last page can be switched off with the Options property
rbSummary	Printed after all detail bands and potential group footers at the end of the report.
rbSubDetail	Reserved for use by the TQRSubDetail component. Do not set this band type manually
rbColumnHeader	Printed a the top of each column on every page in a multi column report. Printed once after the page header in a single column report
rbGroupFooter	Footer band for TQRGroup or TQRSubDetail components. Printed when the group breaks or all detail bands have been printed for the TQRSubDetail
rbGroupHeader	Header band for TQRGroup or TQRSubDetail components. Printed before any detail bands for a given group or TQRSubDetail
rbOverlay	Included for backwards compatibility with QuickReport version 1. Do not use this band type
rbChild	Reserved for use by the TQRChildBand component. Do not set this band type manually


TQRCustomBand.AlignToBottom

property AlignToBottom : Boolean

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

Use AlignToBottom to make a band always print at the bottom of a page instead of on the top. QuickReport will leave room for a page footer band if such exists. If this property is True for a detail band the effect will be that only one detail band is printed per page.


TQRCustomBand.ForceNewPage

property ForceNewPage : Boolean

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

Set ForceNewPage to True if you want a band to always start on top of a new page. If a page header exists it will be printed first. ForceNewPage is False by default.


TQRCustomBand.ChildBand

property ChildBand : TQRChildBand

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

Set child band to point to any TQRChild band you want to be printed following your selected band. To add a child band to any band set the HasChild property to True


TQRCustomBand.Color

property Color : TColor

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

Use the Color property to set a background color of the band. To set the text color use the Font property.


TQRCustomBand.Enabled

property Enabled : Boolean

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

Use the Enabled property to turn printing of a band On or Off. When Enabled is True the band will print, when it is false the band will not print. Any aggregating expression on the band will still be updated even though the band doesn't print.

To prevent expressions from being updated and for temporary suppressing the printing of a band use the BeforePrint event


TQRCustomBand.Expanded

property Expanded : Extended (read only)

Applies to

TQRCustomBand, TQRSubDetail, TQRGroup

Description

If you need to know how much a band has expanded as a result of stretching controls on the band you can read the Expanded property. The value is given in QuickReport's native units, 1/100 MM.


TQRCustomBand.Font

property Font : TFont

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

Use the Font property to specify a default font for all printable text components on the band. This font setting will override the default font of the report itself. Any printable components can further override the font setting in their private Font property.


TQRCustomBand.ForceNewColumn

property ForceNewColumn : Boolean

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

Set ForceNewColumn to True if you want a band to always start on top of a new column. This can be used for instance with group headers to make a report more readable. ForceNewColumn is False by default.


TQRCustomBand.HasChild

property HasChild : Boolean

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

HasChild is True if a band has a TQRChildBand connected as a child band, otherwise it is False. To create a child band for any band set this property to True. To remove a child band set this property to False.

Any child band can be accessed through the ChildBand property


TQRChildBand
TQRChildBand component

Unit

QuickRep

Description

Use the TQRChildBand component to create a band that sticks to the bottom of another band. This is useful if you want some controls to move down depending on the vertical expanding of some other controls. Place the expanding controls on one band and put any controls that should move down on a Child band.

If you want to make sure the two bands always print on the same page use the LinkBand property to connect them.

The easiest way to create a child band is to set the HasChild property of another band.

Properties

ParentBand

TQRChildBands inherits additional properties, methods and events from TQRCustomBand


TQRCustomBand.LinkBand

property LinkBand : TQRCustomBand

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

Use LinkBand to make sure printing of two different bands on the same page. This is useful to prevent orphan group footer bands, summary bands etc. By linking this property to some band it is guarantied that the linked band will not appear as the first band on a new page, one copy if the current band will always be moved onto the next page and printed before the linked band.


TQRCustomBand.Size

property Size : TQRBandSize

Applies to

TQRCustomBand, TQRSubDetail, TQRStringsBand, TQRBand, TQRChildBand, TQRGroup

Description

Use the Size property to set the exact size of the band. The width is controlled by QuickReport by calculating the page width, margins, number of columns and column spacing. The length of the band can be adjusted manually. Set TQRBandSize for more information.


TQRBandSize

Unit

QuickRep

Description

TQRBandSize is used by the Size property of bands to store the exact size information. The units of measurements depends on the setting of the report's Units property.

Field	Description
Height	The height of the band
Width	The width of the band. This is a read only value, calculated automatically by QuickReport
In addition TQRBandSize inherits properties and methods from TQRUnitBase.


TQRCustomBand.Create

constructor Create(AOwner : TComponent)

Description

Creates an instance of a TQRCustomBand class. Users should never create this class manually

See also

TQRCustomBand


TQRCustomBand.Destroy

destructor TQRCustomBand.Destroy

Description

Never call Destroy. Use Free to destroy objects.

See also

TQRCustomBand


TQRCustomBand.CanExpand

function CanExpand(Value : Extended) : Boolean

Description

This is an internal QuickReport method.

See also

TQRCustomBand


TQRCustomBand.ExpandBand
TQRCustomBand.CanExpand

function ExpandBand(Value : extended; var NewExpanded : extended;

                    var HasExpanded : boolean): boolean

Description

This is an internal QuickReport method. Printable components uses this to make a band expand vertically.

See also

TQRCustomBand


TQRCustomBand.AfterPrint

type TQRBandAfterPrintEvent = procedure (Sender : TQRCustomBand; BandPrinted : Boolean) of object

property AfterPrint : TQRBandAfterPrintEvent

Description

The AfterPrint event is called after a band is printed or was supposed to be printed but was canceled in the BeforePrint event. The BandPrinted parameter will indicate if the band was actually printed or not.

See also

TQRCustomBand


TQRCustomBand.BeforePrint

type TQRBandBeforePrintEvent = procedure (Sender : TQRCustomBand;

                                          var PrintBand : Boolean) of object

property BeforePrint : TQRBandBeforePrintEvent

Description

The BeforePrint event is called right before a band is about to be printed. You can cancel the printing of the band by setting the PrintBand parameter to False. If the band is a detail band and printing is canceled any expressions on the band will not be updated for the current record/row.

See also

TQRCustomBand


TQRStringsBand.Items

property Items : TStrings

Description

Items is a string list object which the QRStringsBand uses as a 'datasource' during printing. The QRStringsBand will print once for each string in the string list.

Strings can be assigned from a memo field, read from a file or a memo control on a form or even build by the application.

See also

TQRStringsBand


TQRGroup
TQRGroup component

Unit

QuickRep

Description

Use the TQRGroup component to break a report into logical groups. The TQRGroup acts as a group header band and can have an optional group footer band.

The TQRGroup will break whenever the result of the Expression property changes.

Reordering multiple levels of groups is done by right clicking on the group and selecting 'Move Group Up' from the popup menu.

To connect a group footer add a TQRBand to the report and set the FooterBand property to point to the new band. Also make sure the BandType of the new band is set to rbGroupFooter

Properties

Expression

FooterBand

Master

ReprintOnNewPage

TQRGroup also inherites properties, methods and events from TQRCustomBand


TQRStringsBand
TQRStringsBand component

Example

Unit

QuickRep

Description

The TQRStringsBand is a general purpose report controller band that makes it possible to create reports with no only partial connections to a Dataset. The QRStringsBand doesn't fetch records from a Dataset but instead fetches lines from a TStrings, a list of strings like a memo field. One instance of the band is printed for each entry in the string list.

To access the string for the current line use an expression component. TQRStringBand will create a variable which can be seen in the reports Functions property. The variable will have the same name as the QRStringsBand component.

Properties

Index

Item

Items

TQRStringsBand inherits additional properties, methods and events from TQRControllerBand


TQRStringsBand.Item

property Item : String

Description

The Item returns the current string being accessed by the QRStringsBand. The same value can be accessed by an expression component through a variable with the same name as the QRStringsBand.

See also

TQRStringsBand


TQRStringsBand.Index

property Index : Integer (read only)

Description

The Index property returns the current index number being addressed in the string list, much like a record number.

See also

TQRStringsBand


TQRBand
TQRBand component

Unit

QuickRep

Description

Use the TQRBand component for the basic bands in a report. Set the BandType property to reflect the role the band will have in the report.

An easier way to create bands and set the band type is to use the Bands property of the report or any TQRSubDetail component.

TQRBands inherits properties, methods and events from TQRCustomBand


TQRChildBand.ParentBand

property ParentBand : TQRCustomBand

Description

ParentBand is a link to the band the ChildBand will stick to. This property is automatically set when creating a child band by setting the HasChild property

See also

TQRChildBand


TQRGroup.FooterBand

property FooterBand : TQRCustomBand

Description

Connect the FooterBand property to any band you want to act as a group footer for the TQRGroup. The group footer is printed when the group breaks, before the new group header band. Make sure the BandType property of the group footer is set to rbGroupFooter.

See also

TQRGroup


TQRGroup.Expression

property Expression : String

Description

Enter the group breaking criteria in the Expression property. The group will break whenever the result of this expression changes. You can double click on this property in the object inspector to bring up the QuickReport Expression Builder

See also

TQRGroup


TQRGroup.ReprintOnNewPage

property ReprintOnNewPage : Boolean

Description

If ReprintOnNewPage is True the group header will be reprinted at the top of every page if a group spans more than one page. ReprintOnNewPage is False by default.

See also

TQRGroup


TQRGroup.Master

property Master : TComponent

Applies to

TQRControllerBand, TQRSubDetail, TQRStringsBand

Description

Use the Master property to select what part of the report the grouping should apply to. For a simple report this will be the report component itself but it can also be any controller bands, like the TQRSubDetail.

Although the property is declared as a TComponent it should only be linked to TCustomQuickRep or TQRControllerBand descendants.

See also

TQRControllerBand


TQRCustomLabel.AutoStretch
AutoStretch

property AutoStretch : Boolean

Applies to

TQRCustomLabel, TQRLabel

Description

Use AutoStretch to control how the text control should react when there is more text to be printed than what fits inside the vertical size of the control. If AutoStretch is True the control will expand downwards one line at a time making room for the text. If there is not enough space on the page the control will move onto the next page.

You can have multiple stretching controls on the same band but they should be placed side by side, not above each other. It is ok for more than one of the controls to split over to the next page.

If you need stacked expanding controls you should place the lower control on a child band.

Note that the amount of stretching might depend on the WordWrap property.


QRCTRLS
QRCTRLS unit

Filename

QRCTRLS.DCU

Description

This unit includes all standard printable components

Components

TQRDBImage

TQRDBRichText

TQRDBText

TQRExpr

TQRExprMemo

TQRImage

TQRLabel

TQRMemo

TQRSysData

TQRRichText

TQRShape


TQRCustomLabel.CaptionBased
CaptionBased

property CaptionBased : Boolean (read only)

Applies to

TQRCustomLabel

Description

This is an internal QuickReport property. It will return True if the control has a Caption property or is intended to print a single line of text, False if the control is intended to print memo style text.


TQRCustomLabel.Alignment
Alignment

property Alignment : TAlignment

Applies to

TQRCustomLabel, TQRLabel

Description

Use the alignment property to select how text should align horizontally. Text can align to the left, right or be centered in the control.


TQRSysData.Data
Data

property Data : TData

Applies to

TQRSysDatal

Description

Use to select what data item the TQRSysData component will print.


TQRLabel
TQRLabel component

Unit

QRCTRLS

Description

Use TQRLabel is much like a regular TLabel, only for reports. Use it to print static text on a report by entering text in the Caption property.

You an also change the text to be printed in the OnPrint event, making it easy to print calculations or other information.

TQRLabel inherits properties, methods and events from TQRCustomLabel


TQRCustomLabel.AutoSize
AutoSize

property AutoSize : Boolean(true)

Applies to

TQRCustomLabel, TQRLabel

Description

Use this property decides if the control will expand itself horizontally to fit the text. For multiline (memo) components it will fit the length of the longest line while for single line components (i.e. TQRLabel) this will mean the length of the entire text. Note that a single line components will not stretch vertically if this property is true. For vertical sizing set AutoSize to False and AutoStretch to true.


TQRSysData.AlignToBand
AlignToBand

property AlignToBand : Boolean(False)

Applies to

TQRSysData

Description

Use AutoSize to select if a control should have a fixed with or it should adapt to the width of the text. If AutoSize is False text will be clipped at the edges of the control. If AutoSize is True the control will be expanded horizontally to accommodate the text. For a memo field the control will expand to the width of the longest line.


TQRCustomLabel
TQRCustomLabel class

Unit

QRCTRLS

Description

TQRCustomLabel is an abstract class working as ancestor for all printable text controls except the RichText controls. Both controls printing a single string like TQRLabel, and memo type controls like TQRMemo inherit from TQRCustomLabel.

Properties	Events
Alignment	Create
AutoSize	Destroy
AutoStretch	GetControlsAlignment
Caption	OnPrint
CaptionBased
Color
Font
Lines
WordWrap
TQRSubDetail inherits additional properties, methods and events from TQRPrintable.


TQuickRep.Name
Name

property Name : String

Applies to

TQuickRep

Description

Distinguishes components on the same form. Default is the name of the component, plus an identifying number, e.g., “QRLabel1”.


TQuickRep.Tag
Tag

Stores an iteger value as part of a component.

property Tag : Integer

Applies to

TQuickRep

Description

Tag has no predefined meaning. It is provided for the convenience of storing additional integer value or poiner information for special needs in an application. For example, use the Tag property when implementing case statements with a component.


TQRCustomLabel.Caption
Caption

property Caption : String

Applies to

TQRCustomLabel, TQRLabel

Description

Enter the text to be printed in the Caption property.


TQRCustomLabel.Color
Color

property Color : TColor

Applies to

TQRCustomLabel, TQRLabel

Description

Use the Color property to set the background color of the text control. Use the property to control the font color


TQRCustomLabel.Font
Font

property Font : TFont

Applies to

TQRCustomLabel, TQRLabel

Description

Use the Font property to select what font, font style, color and size should be used for the control. By default the font information is inherited from the parent band which in turn inherits font information from the report. Changing the Font property lets you override this. To switch back to using the inherited font set ParentFont to True


TQRCustomLabel.ParentFont
ParentFont

property ParentFont : Boolean(true)

Applies to

TQRCustomLabel, TQRLabel

Description

Use the ParentFont property to determine where a control looks for its font information. If ParentFont is True, the control uses the font in its parentcomponent’s (Band) Font property. If the ParentFont is False the control uses its own Font property. By using ParentFont, you can ensure that all the controls on a report have uniform appearance.


TQRCustomLabel.Lines
Lines

property Lines : TStrings

Applies to

TQRCustomLabel

Description

The multiple lines of text to be printed should be entered in the Lines property. See TStrings for information on how to access this text. Double clicking on this property in the Object Inspector brings up a text editor that lets you enter text.


TQRCustomLabel.WordWrap
WordWrap

property WordWrap : Boolean

Applies to

TQRCustomLabel, TQRLabel

Description

The WordWrap property controls how a line of text that is too long to fit in the width of the control is printed. If WordWrap is True the text will be wrapped to a new line. If the AutoStretch property is True this might make the control expand vertically.

If WordWrap is False the text will be clipped. WordWrap is True by Default


TQRCustomLabel.Create

constructor Create(AOwner : TComponent)

Description

Creates an instance of a TQRCustomLabel object.. Users should never create this class manually but descending classes like TQRLabel, TQRDBText etc. can be created at runtime and added to a report.

See also

TQRCustomLabel


TQRCustomLabel.Destroy

Destructor Destroy

Description

Do not call Destroy to free an object, call Free.

See also

TQRCustomLabel


TQRCustomLabel.GetControlsAlignment

function GetControlsAlignment : TAlignment

Description

This is a method used by Delphi (version 4)

See also

TQRCustomLabel


TQRCustomLabel.OnPrint
OnPrint

type TQRLabelOnPrintEvent = procedure (sender : TObject; var Value : string) of object

property OnPrint : TQRLabelOnPrintEvent

Applies to

TQRCustomLabel, TQRLabel

Description

The OnPrint event is used with caption based components like TQRLabel and TQRExpr. It is called just before the component is about to be printed and you can change the text by changing the Value parameter. The change is not stored in the Caption property.


TQRPrintable
TQRPrintable class

Unit

QuickRep

Description

TQRPrintable is an abstract base class for any component that can be printed in a QuickReport. You will never use TQRPrintable directly. It implements several properties that are used in all printable components.

Properties	Methods
Enabled	Create
Frame	Destroy
ParentReport
Size
Zoom


TQRPrintable.Enabled
Enabled

property Enabled : Boolean

Applies to

TQRPrintable

Description

Use the Enabled property to turn the printing of a printable componenton or off. When Enabled is False the component will not print. When Enabled is True the control will print. You can change the Enabled property in any event during report preparation

Enabled is True by default.

See also

TQRPrintable


TQRPrintableSize.Top

property Top : Extended

Description

Use the Top property to position the printable control vertically within the band.

See also

TQRPrintableSize


TQRPrintable.Frame
Frame

property Frame : TQRFrame

Applies to

TQRPrintable, TQRLabel

Description

Use the Frame property to control the printing of a frame around the component. See TQRFrame for more information on printing frames.

See also

TQRPrintable


TQRPrintable.ParentReport
ParentReport

property ParentReport : TCustomQuickRep

Applies to

TQRPrintable

Description

ParentReport is an internal QuickReport property.

See also

TQRPrintable


TQRPrintable.Create

constructor TQRPrintable.Create(AOwner : TComponent)

Description

Creates an instance of a Printable object. Never create an instance of the TQRPrintable class, always use some descending class like TQRLabel. If you create components at runtime and want them to be included in a report make sure you set the Parent property. This is common Delphi syntax but often a source of frustration.

Example

var

   QRLabel1 : TQRLabel;

begin

   QRLabel1 := TQRLabel.Create(MyReportForm);

   try

      QRLabel1.Parent := MyDetailBand;

      QRLabel1.Caption := 'A new label'

      MyReport.Preview;

   finally

      QRLabel1.Free;

   end;

end;

See also

TQRPrintable


TQRPrintable.Size
Size

property Size : TQRPrintableSize

Applies to

TQRPrintable, TQRLabel

Description

Use the Size property to set the exact position and size of a printable component. The units of measurement depend on the setting of the report's Units property. See TQRPrintableSize for more information.

See also

TQRPrintable


TQRPrintable.Zoom
Zoom

property Zoom : Integer

Applies to

TQRPrintable,

Description

The TQRPrintable.Zoom property is used internally by QuickReport at design time. It has no use at runtime.

See also

TQRPrintable


TQRPrintable.Destroy

destructor Destroy

Description

Never call Destroy to free an object, use Free.

See also

TQRPrintable


TQRFrame
TQRFrame class

Unit

QuickRep

Description

TQRFrame is used throughout QuickReport to store information on frames around components and to print those frames in the reports.

Properties	Methods
Color	AnyFrame
DrawBottom
DrawLeft
DrawRight
DrawTop
Style
Width
TQRFrame inherites from TPersistent


TQRFrame.Color

property Color : TColor

Description

Use the Color property to select the color of the frame.

See also

TQRFrame


TQRFrame.DrawBottom

property DrawBottom : Boolean

Description

Set DrawBottom to True to draw to bottom line of the frame.

DrawBottom is False by default

See also

TQRFrame


TQRFrame.DrawLeft

property DrawLeft : Boolean

Description

Set DrawLeft to True to draw to left line of the frame.

DrawLeft is False by default

See also

TQRFrame


TQRFrame.DrawRight

property DrawRight : Boolean

Description

Set DrawRight to True to draw to Right line of the frame.

DrawRight is False by default

See also

TQRFrame


TQRFrame.DrawTop

property DrawTop : Boolean

Description

Set TopLeft to True to draw to Top line of the frame.

DrawTop is False by default

See also

TQRFrame


TQRFrame.Style

property Style : TPenStyle

Description

Use the Style property to select the pen style to use when drawing the frame. Please read help on TPenStyle for more information.

The default style is psSolid

See also

TQRFrame


TQRFrame.Width

property Width : Integer

Description

Width is the width of the frame in number of pixels.

See also

TQRFrame


TQRFrame.AnyFrame

function AnyFrame : Boolean

Description

This is an internal QuickReport method. It returns True if DrawTop, DrawBottom, DrawLeft or DrawRight is True, otherwise it returns False

See also

TQRFrame


TQRBasePanel.FontSize

property FontSize : Integer

Description

FontSize is used internally by QuickReport

See also

TQRBasePanel


TQRBasePanel
TQRBasePanel class

Unit

QuickRep

Description

TQRBasePanel is an internal QuickReport class used as lowest level building block for the design time appearance of TCustomQuickReps and band classes. It implements some methods used internally by QuickReport and some properties.

Properties

FontSize

Frame

Zoom


TQRBasePanel.Zoom

property Zoom : Integer

Description

TQRBasePanel.Zoom is used internally by QuickReport. Use TCustomQuickRep.Zoom.

See also

TQRBasePanel


TQRBasePanel.Frame

property Frame : TQRFrame

Description

The Frame property is used to store information on the frame around a band or a report. Read about TQRFrame for more information on frames.

See also

TQRBasePanel


TQRPrintableSize
TQRPrintableSize class

Unit

QuickRep

Description

TQRPrintableSize is used throughout QuickReport to store size and positioning information for printable components. The units of measurment depends on the setting of the reports Units property.

Properties

Height

Left

Top

Width


TQRPrintableSize.Height

property Height : Extended

Description

Height is the height of the printable control. For text controls inheriting from TQRCustomLabel this property will be set automatically.

See also

TQRPrintableSize


TQRPrintableSize.Left

property Left : Extended

Description

Use the Left property to position the printable control horizontally on the band.

See also

TQRPrintableSize


TQRExpr
TQRExpr component

Unit

QRCTRLS

Description

Use TQRExpr to calculate an expression during report generation. For more information on using expressions please see the users guide.

Double clicking on the expression property in the Object Inspector brings up an expression builder.

Properties	Methods
Expression	Reset
Mask
Master
ResetAfterPrint
Value
TQRExpr inherits additional properties, methods and events from TQRCustomLabel


TQRPrintableSize.Width

property Width : Extended

Description

Width is the width of the printable control. For text controls inheriting from TQRCustomLabel this property will be set automatically.

See also

TQRPrintableSize


TQRDBText
TQRDBText component

Unit

QRCTRLS

Description

Use TQRDBText to print any text field from a table except RichText formatted memo fields. TQRDBText can print Alphanumeric fields, floating point fields, date and time fields and memo fields.

TQRDBText can expand vertically to make all text fit if there is too much text to fit in the original size. The AutoStretch property must be True for stretching to be allowed. A component can stretch over several pages.

To format the output use the Mask property.

Properties

DataField

DataSet

Mask

TQRDBText inherits additional properties from TQRCustomLabel


TQRExprMemo
TQRExprMemo component

Unit

QRCTRLS

Description

The TQRExprMemo component is a hybrid of the TQRExpr component and the TQRMemo component. It allows you to have a memo text with embedded expressions. Put the expressions in brackets and QuickReport will substitute the expression with the result of the expression during report generation.

An example of a expression memo text could be:

Company : {CompanyName}

Address : {Address1}

          {Address2}

Contact : {Contact + ' ' + Phone number}

Properties

RemoveBlankLines

In addition TQRExprMemo inherites properties, methods and events from TQRCustomLabel


TQRImage
TQRImage component

Unit

QRCTRLS

Description

Use TQRImage to print images in the report. QuickReport can print any image type supported by the VCL. When printing a color image on a blank and white printer QuicKReport will try to make a raster representation of the image.

Properties

AutoSize

Center

Picture

Stretch


TQRMemo
TQRMemo component

Unit

QRCTRLS

Description

The TQRMemo component is very much like a TMemo components, only for reports. Use it to print large multiline text blocks. A TQRMemo can expand vertically to span several pages.

The text to be printed is stored in the Lines property.

TQRLabel inherits properties, methods and events from TQRCustomLabel


TQRDBImage
TQRDBImage component

Unit

QRCTRLS

Description

Use TQRDBImage to print images stored in BLOB fields in tables. TQRDBImage can print any graphics types supported by the VCL.

Properties	Methods
Center	LoadPicture
DataField
Dataset
Field
Picture
Stretch
TQRDBImage inherites additional properties from TQRPrintable


TQRDBRichText
TQRDBRichText component

Unit

QRCTRLS

Description

Use TQRDBRichText to print RichText formatted memo fields stored in BLOB fields. QuickReport relies on the Windows RTF Control to render the text .

If the memo field is to long to fit in the control the AutoStretch property will be checked to see if the control can expand vertically.

Properties

DataField

Dataset

TQRDBRichText inherits additional properties from TQRPrintable


TQRSysData
TQRSysData component

Unit

QRCTRLS

Description

Use TQRSysData to print system information like, report title, current page number. Select the data to print in the Data property.  Set any preceding text in the Text property.

Properties

Alignment

AlignToBand

AutoSize

Data

Font

ParentFont

Text

Transparent


TQRRichText
TQRRichText component

Unit

QRCTRLS

Description

Use TQRDBRichText to print RichText formatted memo text. The text to be printed can be fetched from a TRichEdit control directly by using the ParentRichEdit property. Formatted text can also be read into the Lines property.

Properties

Lines

ParentRichEdit

The TQRRichText also inherites properties from the TQRCustomRichText class.


TQRShape
TQRShape component

Unit

QRCTRLS

Description

TQRShape is used to draw simple shapes like rectangles, circles and lines on a report.

Set the type of shape you want in the Shape property.

Set the pen color and style you want in the Pen property.

Set the fill style and color you want in the Brush property.

Properties

Brush

Pen

Shape

In addition the TQRShape component inherites properties and events from TQRCustomLabel


TQRDBText.DataField

property DataField : String

Description

Use the DataField property to select the field to print. Click on the property in the Object Inspector to see a list of available fields.

Note that changing the field name during report generation is not allowed.

See also

TQRDBText


TQRDBText.DataSet

property Dataset : TDataset

Description

Use the Dataset property to select the dataset that contains the field you want to print.

Note that changing the Dataset during report generation is not allowed.

See also

TQRDBText


TQRDBText.Mask

property Mask : String

Description

Use the Mask field to format the output of the TQRDBText. If no mask is specified QuickReport will use the default formatting for the field.

For more information on formatting numeric field please see FormatFloat in the VCL help.

For more information on formatting date and time fields please FormatDateTime in the VCL help

See also

TQRDBText


TQRDBImage.Center

property Center : Boolean

Description

Use Center to control how an image should be positioned in the control if the Stretch property is False. If Center is True the image will be centered within the control. If Center is False the image will be aligned with the top left corner of the control.

See also

TQRDBImage


TQRDBImage.DataField

property DataField : String

Description

Use the DataField property to connect the TQRDBImage control to a field that contains images. The field should be a BLOB field. Click on the property in the Object Inspector to see a list of available fields.

See also

TQRDBImage


TQRDBImage.Dataset

property Dataset : TDataset

Description

Use the Dataset property to connect the QRDBImage component to a dataset. The dataset should contain a BLOB field with images. Click on the property in the Object inspector to see a list of available datasets.

See also

TQRDBImage


TQRDBImage.Field
TQRDImage.Field

property Field : TField

Description

Field is an internal QuickReport property.

See also

TQRDBImage


TQRDBImage.Picture

property Picture : TPicture

Description

Picture is an internal QuickReport property

See also

TQRDBImage


TQRDBImage.Stretch

property Stretch : Boolean

Description

Use Stretch to control how images that doesn't exactly fit the size of the TQRDBImage should print. If Stretch is True the image will be adjusted to the size of the control. If Stretch is False the image will be printed in its original size.

See also

TQRDBImage


TQRDBImage.LoadPicture

procedure LoadPicture

Description

LoadPicture is an internal QuickReport method and should not be called.

See also

TQRDBImage


TQRDBRichText.DataField

property DataField : String

Description

Use the DataField property to select the field that contains the RichText. Click on the property in the Object Inspector to see a list of available fields.

Note that changing the field name during report generation is not allowed.

See also

TQRDBRichText


TQRDBRichText.Dataset

property DataField : Dataset

Description

Use the Dataset property to select the dataset that contains a field with RichText formatted memo.

Note that changing the Dataset during report generation is not allowed.

See also

TQRDBRichText


TQRExpr.Expression

property Expression : String

Description

Enter the expression to evaluate in the Expression property.

It is not allowed to change the expression during report generation.

See also

TQRExpr


TQRExpr.Mask

property Mask : String

Description

Use the Mask field to format the output of the TQRExpr component. If no mask is specified QuickReport will use the default formatting for the data type. Note that this might be different from the default formatting of any datafield used in the expression.

For more information on formatting numeric field please see FormatFloat in the VCL help.

For more information on formatting date and time fields please FormatDateTime in the VCL help

See also

TQRExpr


TQRExpr.Master

property Master : TComponent

Description

Use the Master property to force an expression to be reevaluated each time the current row of a dataset is advanced. Connect the Master property to the Report component or any TQRSubDetail on the report to allow operations such as SUM and COUNT to work on the dataset connected to the report controller.

Although the Master property is defined of type TComponent it should only be connected to a TCustomQuickRep descendant or a TQRSubDetail.

See also

TQRExpr


TQRExpr.ResetAfterPrint

property ResetAfterPrint : Boolean

Description

Set ResetAfterPrint to True if the result of the expressions should be reset to 0 after the component is printed. This is useful for printing totals in group footers where you want the result to reflect only a subset of the records.

See also

TQRExpr


TQRExpr.Value

type TQREvResultType = (resInt, resDouble, resString, resBool, resError)

type TQREvResult = record

       case Kind : TQREvResultType of

         resInt    : (intResult : Longint);

         resDouble : (dblResult : Double);

         resString : (strResult : String[255]);

         resBool   : (booResult : Boolean);

     end

property Value : TQREvResult

Description

Use the Value property to access the value of the Expression. It returns a variant record with the result of the calculation.

See also

TQRExpr


TQRExpr.Reset

procedure Reset

Description

Call Reset from any event handler during report generation for the value of an expression to be reset to 0. This is useful when having aggregated expressions and you want manual control of when the calculations should restart.

For automatic resetting after printing an expression use the ResetAfterPrint property.

See also

TQRExpr


TQRExprMemo.RemoveBlankLines

property RemoveBlankLines : Boolean

Description

Use RemoveBlankLines if you want QuickReport to remove any blank lines in the evaluated memo field. This is useful for suppressing blank lines in address fields etc.

See also

TQRExprMemo


TQRImage.Stretch

property Stretch : Boolean

Description

Use Stretch to control how images that doesn't exactly fit the size of the TQRImage should print. If Stretch is True the image will be adjusted to the size of the control. If Stretch is False the image will be printed in its original size.

See also

TQRImage


TQRImage.Center

property Center : Boolean

Description

Use Center to control how an image should be positioned in the control if the Stretch property is False. If Center is True the image will be centered within the control. If Center is False the image will be aligned with the top left corner of the control.

See also

TQRImage


TQRImage.AutoSize

property AutoSize : Boolean

Description

If AutoSize is True the component will automatically resize to the same size as the image. If AutoSize is False the component size is not affected by the image size. This might result in clipping of the image.

See also

TQRImage


TQRImage.Picture

property Picture : TPicture

Description

Picture is a reference to the actual image to be printed. Double click this property in the Object Inspector to bring up a dialog where an image can be loaded.

See TPicture in the VCL help for more information.

See also

TQRImage


TQRShape.Brush

property Brush : TBrush

Description

Use the Brush property to select the brush to be used to fill the shape. Set the brush to bsClear for a transparent interior of the shape.

See TBrush in the VCL help form more information.

See also

TQRShape


TQRShape.Pen

property Pen : TPen

Description

Use the Pen property to select the pen to be used when drawing the outline of the shape.

See TPen in the VCL help form more information.

See also

TQRShape


TQRShape.Shape

type TQRShapeType = (qrsRectangle, qrsCircle, qrsVertLine, qrsHorLine,

                     qrsTopAndBottom, qrsRightAndLeft)

property Shape : TQRShapeType

Description

Use the Shape property to select the type of shape to draw. It is allowed to change the shape property during report generation.

See also

TQRShape


TQRRichText.ParentRichEdit

property ParentRichEdit : TRichEdit

Description

Setting the ParentRichEdit control to reference some RichText control in an application makes QuickReport print the text from the RichEdit control in the report.

See also

TQRRichText


TQRTextFilter
TQRTextFilter component

Unit

QRExport

Description

Drop a TQRTextFilter component on a form in an application to enable reports to be exported to ASCII text files. The Text file option will appear in the Save to file dialog in the preview form and reports can also be exported to ASCII files by code.

For more information on export reports by code read about the ExportToFilter method.


TQRCSVFilter
TQRCSVFilter component

Unit

QRExport

Description

Drop a TQRCSVFilter component on a form in an application to enable reports to be exported to comma separated text files. The CSV file option will appear in the Save to file dialog in the preview form and reports can also be exported to comma separated files by code.

For more information on export reports by code read about the ExportToFilter method.

Properties

Separator


TQRHTMLFilter
TQRHTMLFilter component

Unit

QRExport

Description

Drop a TQRHTMLFilter component on a form in an application to enable reports to be exported to HTML documents for publishing on the web or viewing in a web browser. The HTML file option will appear in the Save to file dialog in the preview form and reports can also be exported to HTML files by code.

For more information on export reports by code read about the ExportToFilter method.


TQRCSVFilter.Separator

property Separator : String

Description

Use the Separator property to select what character should be used to separate fields in the comma separated export file. The default is the comma character but this might be impractical in many applications being used internationally.

See also

TQRCSVFilter


QREXPORT
QREXPORT unit

Description

The QRExport unit contains export filter classes and related utility classes and functions.

File name

QREXPORT.DCU

Components

TQRCSVFilter

TQRHTMLFilter

TQRTextFilter


QuickReport Knowledge Base

Click any topic to display questions for additional QuickReport tips, examples and useful techniques:

Adding reports and/or controls at runtime

Bands

Barcodes

Borland Database Engine

Composite reports and multiple-dataset reporting

DLLS and ActiveX

Exporting reports

Expressions and user functions

Frames

Frequently Asked Questions

Groups

Images and Shapes

Installing and upgrading from previous version

Master Detail Reports

Multiple columns

Page size

Preview

Printing and printer setup

RichEdit controls problems

Saved reports

Text controls

Using TQREditor

What’s new or missing in QuickReport 3

Text controls

For more information and new articles in the QuickReport Knowledge Base, please check the QuickReport Web site at http://www.qusoft.com.


Adding reports and/or controls at runtime

When I use QRCreateList() it looks like it's finding fields from the current record in another dataset. The other dataset has the same field names as the one that I am passing to QRCreateList().

When I create a report at runtime and pass it to QRCreateList(), it does not use my title.

Using QR2 and trying to call addprintable in the beforeprint event of a band causes a GPF (or an Access Violation). Is this not allowed for some reason?

I am generating report at run time and I have a question: If for example I set QuickReport.HasTitle as true it automatically creates the title band. The problem is that I won't be able to know the name of title variable that was created.

If you use the method AddPrintable, how can you access the control that was created?

I get an error when I try to use the QRCreateList example from the manual.

How can I change the field width and spacing in a report created with QRCreateList?


Bands

I have a childband and I set it's PrintBand to false based on certain conditions.  When the band doesn't print, QuickReport doesn't check this and will generate a new page is this band would have been the last band on page.

How can I create a report with a Title band to print ABOVE the Page Header band?

How do I get the column header for to print right above the detail band when I also have a group band?

Is there a way to print a band as footer only on the last page of a report.

When my band is split on two pages, how can I keep the non-stretching text controls on the first page?

How do I disable the detail band so that I can calculate in the detail section without printing it?  I just want the summary band to print.

How can I add a child band at runtime and fields to it?

Is there any possibility to extract the fields embedded in a specific band during run-time?

We are trying to use a QRBand in order to create a 'ColumnFooter' but w/o success. Do you have some tips?

We trying to use a QRBand in order to create a 'ColumnFooter' but w/o success.  Do you have some tip ?

How do I check the height of a band with stretching controls at runtime?

Is it possible to have 2 or more PageHeader Bands in same Report ?

I have a detail band with a child band.  I want to change the number and layout of the controls on the child band at runtime, but I get an exception error when I add new controls while the report is running.

I have a report that has about 10 child bands that may or may not get printed depending on run time criteria. This report always prints two pages, even if it only needs one to accommodate the childbands allowed at run time. Is there a workaround for this?


Barcodes

 component to use with QuickReport?

Where can I find a barcode font that I can use with QuickReport?


Composite reports and multiple-dataset reporting

What are the steps to load reports and preview composite reports.  I add reports to the TList property of QRComposite and then call preview and the preview is empty.

How can we save a composite report to a file (*.QRP) from source code?  (We can not access a QRPrinter object for Composite Report (seems to be declared 'private')).

Is there a way to set it up so that each individual report making up the composite starts on a new page when that portion goes to print?

Is there a way to set it up so that each individual report making up the composite starts on a new page when that portion goes to print?

Why wasn't the Composite Report fixed in 2.0?

I wish to create a report which lists the contents of two unrelated tables. How do I do this if you can only have one detail band per report?

One of the reports in my Composite Report has Landscape Orientation, and the others are Portrait. The report prints everything in Portrait

I'm currently using QuickReports for printing static forms without any report functionality. This works fine for me. Then I try to print multiple forms (multiple TQuickReps) as one print job. Therefore I´m using the TQRCompositeReport component but if there are no report components on the TQuickReps nothings happens if you try to print or preview. Is there a way to print different static forms as one print job ?

In a report I need just to apply a new filter to the qreport dataset and then continue the report.  It's like running several reports but "bundled" all together in one preview / report.


Borland Database Engine

Is it possible to exclude the BDE in any of the 2.x versions of QuickReport as one can do with QR1.1a using the line: {$define XBDE}? If so, which 2.x version?

I am getting the error "Unable to locate source file "quickrpt.pas" and after that EBDEngineError "Table does not support this operator"


DLLS and ActiveX

Is there any known problems using QR 2.0j in a Delphi 2 (or 3) DLL?  Each time I am finished and make a call to FreeLibrary() from my calling application, the calling application freezes.

Where is the ActiveX component that is mentioned on your web page?


Exporting reports

PrintPreview & Print work OK until I use ExportToFilter after which PrintPreview & Print do not produce output.

When I try to export a previously saved report, nothing happens.

How do I get all of the export filters to show in the save dialog in my preview?

How do I use the HTML export filter?


Expressions and user functions

I am using a TQRExpr to print the SUM of a field of a Query.  But I have a problem. If the Query has no result (zero records) then instead of printing the number 0, It is printing SUM(qry.Total).

When I add lines to a QRExprMemo control at runtime, the control does not filter out any blank lines that may have added.

How do you use the FORMATNUMERIC function, I can't find a help files to help me?

Is there an expression that will permit grouping by month? The underlying database has a date field.

I want to have a database field as the expression, but the table is not available to me at design time and adding <tablename>.<fieldname> to the expression string at run time doesn't work.

I couldn't find any information for the meaning of the "arguments" parameter in the RegisterQRFunction

Expression wont work if the field name has a space or a hyphen in it

My function doesn't work  I want to use:

I can't sum TTimeFields?

Expressions are being evaluated from right to left

The following expression always returns 0: SUM(IF(Query1.CartonID='SI', Query1.Caliper, 0))

Why doesn't the expression Count(Table1.Field1) return the right value?

How do I check the value of QRExpr control at runtime?

I use QRExpr to calculate the Average of a currency field but it shows as numerical, not currency.

Why does my report crash when I use TQRExpr controls uner Delphi 1?  The same report runs fine when I compile it with Delphi 2.

I have a simple query that uses the SQL COUNT(*) and I am  trying to display it in a QRExpr component but it is not displaying that field.

I can't get the QRExprMemo to display more than 255 characters when I use Delphi 1.

How can I count frequencies of the values in a dataset field?

How can I get the dataset of the report to display in the QRExpression if the dataset is on a separate form?

I want to sum a field, but I need to ignore the highest and lowest value, can this be done?

What are the allowable datatypes that can be used in a TQRExpr control?


Frames

How can I separate the letters from the top of the frames with a QRDBText control?

Setting DrawBottom to true of the report's Frame property of works on preview, not when printed.

Some lines do not appear in the preview, but they appear in the printout.


Frequently asked questions

Will my Quick Report professional 2.0i work with new C++Builder 3.0 or I should wait for an upgrade from you?

I am trying to use QuickReport with C++Builder, but your documentation and examples are all Delphi based.

I am trying to reset the page number for every group band.  How can I do that ?

Does quickreports support BDE alternatives such as ODBC98?

My report uses tables on a datamodule and even when my report form is using the datamodule, I can't get the tables or fields to show up.

I use the following procedure to create forms at run time:

Is there a way to reset the page number based on a group header?  This would be useful when printing invoices.

Is it possible, to use the MS Intellimouse's wheel inside the preview of quickreport?

What's the difference between this file and QR2FAQ.TXT?

When I set the height of the report, it keeps going back to the default value, is this a bug?

It is difficult to manage reports with many bands. Is there a better way to create complex reports ?

I want to print reports with text and pictures. Each of the pictures (two in a row) shall have a caption. Now it sometimes happens that the caption is printed on the first page, but the pictures on the next page. How can I keep that together?

I want a 1.5" top margin and 0.5" bottom margin on odd numbered  pages and a 0.5" top margin and 1.5" bottom margin on even pages.

I have several Group Bands in my report. How is it possible to change the printing order of these bands at runtime. Eg. at case one I need to print only Group1, case two Group2, Group 1, Group 3, case three Group 4, Group 2 etc. The order is set by the user at runtime.

How can I set the contents of the page header based on the first subdetail band that prints on that page?

All of my fields come out blank.

An error appears when we set the "Orientation" in the "Page" property to "poLandscape" and the "PaperSize" property to "Default". If we now call the Preview, the following error message appears on the screen : "Error on floatingpoint operation".

When I use the Apollo driver to access a Foxpro table and I can not preview reports that use QRDBText controls with MEMO fields.

Every time I preview a report, I lose memory.

I have two forms, Form1 contains a TTable, Form2 contains a TQuickRep. Form2 includes Form1 in its uses clause. I place a TQRExpr on the report, and open up the Expression property editor by clicking ellipsis. The table in Form1 cannot be viewed/selected in this editor.

Is there any way to perform "Hide Duplicates" for some repeated data item in a report?

Using QR2 and trying to call addprintable in the beforeprint event of a band causes a GPF (or an Access Violation). Is this not allowed for some reason?

Why does QuickReport change my detailband's Size.Height property from 33.0 to 33.07 after I preview a report?

How can I convert from pixels to the measurement unit used by the QRPrinter object to be able to print to the screen or printer?

My shapes print out thinner than they appear in the preview

In my report I want to print a blank line every between every 5 lines with data, to make it easier to read. How can I do that?

How can I make a row wider than 1 page.

Can you tell me how I can view the non-continuous rows in a DBGRid by using QuickReport? I set dgMultiSelect from TDBGrid to True, and I select some records in non-continuous order, then ...?

How can I put a blank page in front of a report.

How do I print a text file as a report?

How do I change the Delphi help file to be able to search in the new QuickReport Help?

I am having trouble with the QRChart control.

I'm having trouble placing controls at precise locations when the I have the report set to 50% zoom

What is the difference between the global QRPrinter, the preview's qrprinter, and the report's, qrprinter?

How do I print out text rotated at an angle?

How can I to begin a report (QR) with current record and then continue from that record?

How do I do duplex margins?

How do I keep the preview from rebuilding the report when I print?

My report works under 95 but not under NT

How do I do a title page?

Is there a maximum length/size of a report?

There is a mention of qrsPageCount and QuickReport.Options.TwoPass in the documentation. Are these available yet?

How can I build a report with data that doesn't come from a BDE table or query?

How do I print only the current record of the dataset?

I define multiple TQRlabels on a page.  I can not find the end of the qrlabel.caption to figure out where to start the next qrlabel.

Quickreports seems to leave a trail of files of the form QRPDxxx.TMP in the windows temp directory.  Is this a result of normal operation, crash or aborted preview?

I get the error "Metafile is not valid" when I preview a very simple but large report (2,500,000 lines). The same report with a smaller data table runs OK.  Why do I get this error?

I have an invoice form. If in the form can't put all the details records in one page, and it must go to the next page, I must put a message in the bottom of the form saying something like this " continued on the next page..." or "carried forward ...".  Which is the best solution for this?

How can I do subscripts for chemical formulas?

I tried using the OnPrint event to change the font style but it does not respond.  Will it show up in the preview, or do I have to compile and run the report from Delphi?

I have a report with just a page header and a title band.  The title band has a memo control that can span multiple pages.  When it does span a page, the text in the memo starts getting chopped up the closer you get to the bottom of the page.  What is wrong?

Are there any year 2000 issues with QuickReport?

The graphics mode of my dot matrix mode is too slow, so I'd like to know if there is another way to print using the text format of the printer.  I must print using the standard size and the compressed size of the fonts as we used to do in the DOS environment...


Groups

Is there an expression that will permit grouping by month? The underlying database has a date field.

I have a billing report. In the group-footer I take the sum of the amounts. I print it at the summary . Now I would like to print the intermediate-results of the amounts at the end of each page (except at the end of the last page). How can I do it?

When I have a group header for a sub-detail band, the header gets printed twice for the first record and only once for every record thereafter.

TQRGroup does not work with an expression on a queryfield if the query component is not on the report form.

A new page is not generated on the GROUPHEADER if the current page number is 1 (one) and the Property NewPage is TRUE.  It will work fine if this occurs on page number 2 or higher.

How do I do set a group expression to break on multiple fields?

We query our data grouped by a field and is there any neat way to get the text "to be continued" to the bottom of the page if the group is several pages, i.e. how do we know before page change the last row was not the last record in the group?

How do I get group headers to print after a page break?

How do I create a group band at runtime?

I have several Group Bands in my report. How is it possible to change the printing order of these bands at runtime. Eg. at case one I need to print only Group1, case two Group2, Group 1, Group 3, case three Group 4, Group 2 etc. The order is told by enduser at runtime.


Images and shapes

How I do to make background shadow in alternated lines (detail) of report?

Is there a 3rd party component vendor for QR that supports PNG images?

(Delphi 3) I am trying to use the QRImage component to print a jpg image. I noticed that if I select a jpg image after placing a qrimage component on a quickreport, it shows up correctly on screen. But when I then PREVIEW the report, the image is not there.

Why won’t QRImage doesn't print icon files when Stretch is set to true?

My shapes don't print correctly on bands that wrap over a page

Why do TQRShapes appear thicker on screen than when it prints

I'm creating a report which requires a couple of vertical lines on the page.  I have added the appropriate QRShapes (shape=qrsVertLine) to the detail band.  How do I continue the vertical line on the page even when there are not enough detail records to fill the page?


Installing and upgrading from previous version

My custom preview doesn't work the way it did with QR1

In D2 and QR 1.1 I used "TQRCustomControl" how can I get it to work in D3 and QR2.0 ?

We have just installed QR20K instead of QR20Kbeta (working with D3 +Language Pack).  We now notice that the Quick Report Units are not translated into Dutch as it used to be with QR20Kbeta.

I am porting a report from QR1 to QR2 and the FromPage and ToPage properties are missing.

I keep getting the error: "Can't load package (the path & such)" A device attached to the system is not functioning"

Recently I upgraded Delphi 3 to Delphi 3.02.  I now get an error trying to install QRPro package.

I recently received the latest copy of Delphi v3, build number 5.83. Whenever I load Delphi, an error message appears:

I am trying to convert a Report from version 1.x to 2.0i, in Delphi 3.  In version 1.x it was possible to have several detailbands in the same report, and then enabling the detailbands as they where needed, thus having different bands visible, depending on a field in the dataset.

The TQRGroup property GroupData was in Version 1 does not exist in QuickReport 2.  Is there a replacement?

[Delphi 3] How can I restore a German layout during runtime in the Preview ?

I updated to QuickReport 2 with C++ Builder and I can't compile my existing QR1 reports.

The QRGroup in version 1.0 had a field called DataField, in the 2.0 version this field doesn't exist. In the unit that called the report I would set the contents of this field. How do I do it now?

I cannot run the QuickReport demo programs in Delphi 1.

I could not find the Linkband feature that QR1 has.

When compiling and starting the qr2demo.dpr the following error occurs: Error while reading GrpListForm.Font.Charset. Property does not exist !

Will reports written in 2.0 be compatible with 2.1?

In QR1, we had ShowDialog Property to Show PrintSetup Dialog before Print, but in QR2 does not have this. How can I do this function?

I installed QuickReport Professional version 2.0 in my Delphi 3.0, all went well and the two new components were installed. When I try to run the example project for the QREditor Component, EDITOR.DPR, I get a error message in line 41 of the QREDFOR unit that says: Undeclared identifier: TQREditor.

I just installed QuickReport 2 Pro, but I can't find the editor component

After I install QuickReport Pro into Delphi 3, I only see the QREditor and QExprMemo components

I keep getting CGI timeouts when I try to download from your web site.

I have upgraded to version 2.0 from 1.1. Since then I can't load an already saved report.

What happened to the thumbnail feature of QR1?

I tried to download qreg20g.exe from your Web site but I get the 'Document contains no data' message.

Every time I try to download the new release of QR, I  receive the message: Impossible to open http://www.qusoft.no/scripts/filelist/filelist.exe?DL.

How can I tell which version of QuickReport is installed in Delphi?

But what is that TQRExprMemo? I can't find this component....

I have removed QR from the package list but how do I reregister it?


Master Detail Reports

I would like to know if it is possible to include subreports into reports like Microsoft Access.

How do I insert a new QRsubdetail band in between two existing subdetail bands? I have a very long report and when I insert a new band at the end and use the "move band up" option on the pop-up menu, it seems to really mess the report up.

How do I create a QRSubDetail band at runtime?

I could not get the SUM() expression to work on subdetail bands.

I have a two level report where I on the primary level tries to cancel the output for both levels by setting the printband property to false for some of the primary records. Why is the secondary level printed anyway? How can I avoid this?

I want to make a report with 2 subdetails. The first subdetail works fine, but the second I need that it has 2 or 3 columns but I don't know how can I make that a subdetail can have 3 columns and the other sections has only one column.


Multiple columns

When I create multi-column report, second, third etc. columns overwrite children of the title band.

I have a multiple column report where I want to have two groups, one that forces a page break, and one that forces a column break.  I can set this just fine.  But what happens is when I get the page break, the data prints in the second column of the report and the first column is blank.  Is there a way to suppress the column break after a page break?

I am interested in adding the capability of generating mailing labels to my current application.  I could not find any information about mail labels in your documentation.

Is there a way to make QReports print columns Left to Right - Top to Bottom instead of Top to Bottom - Left to Right?

When I do a multiple column report, the detail bands print on the same line as the group bands

I have a multiple column report that uses subdetail bands but doesn't have a detail band.  I get an exception in the TQRCustomBand.GetBandSize function when I try to run the report.


Page size

How do I set the paper size?

How do I determine the default paper size of the selected printer?


Preview

How can I implement a modal preview? The standard preview isn't modal, when the user make it smaller and click on another form the preview form is hidden. Is there a way to show the preview modal?

Is it possible to set preview "Fit To Page" as default when opening the preview of a report ?

When repeatedly previewing a report and closing BEFORE the first page is displayed, there is a access violation.

Can I preview only selected pages?

Why doesn't the printersetup button work from the preview when I load a saved report?

We've a problem with QRPrinter.PageCount. We've created our own Previewform and when we call QRPrinter.PageCount we always get 0. What's wrong??

If I change the Paper Size in the Printer Setup of the preview, the report does not reflect the size selected.

My custom preview does not use the zoom value that I set at design time, how do I get it to start up with the value that I want?

How can I augment the preview's print function to display a dialog box after the report prints?

How can I determine the number of pages in my report before I preview or print it?

How can I have my custom preview print a range of pages without going through the printersetup dialog?

I can't get the cursor to display as an hourglass during custom preview processing.

I am using custom preview and want to know if there is an easy way to know when the report is done being generated?

Why in report preview mode, does the CPU usage for the quick-reports application go to 100%

My custom preview doesn't work the way it did with QR1

Why wont the progress bar work properly with non-BDE reports?

Some computers do not display a report and others work fine.

When the preview method of a report is called, it looks like the report is being painted twice and there is some flicker

In QR1, I could disable/hide the save, print and load report speed buttons in the preview. Is this no longer an option?

Some lines do not appear in the preview, but they appear in the printout.

How can I tell in BeforePrint if I am Printing or Previewing?

Is there a way to tell QuickReport that when you generate a preview, you only want the preview to span a certain number of pages or have a starting/ending page number?


Printing and printer setup

I get a printer error when I print a range of pages.

I am setting the control's font to Arial but it is printing as Courier (or vice versa).

I can't get the Bin Selection for quick reports to work. No matter what I try, everything goes to the same bin. How do you select output bins?

I am trying to layout my report to print using the Generic/Text Only driver, but I am having trouble getting the text to line up and blank lines get inserted into the printout.

I don't see the progress window during the print when I use:

I'm getting a 'Printer is not currently printing' error when I try to print a report, I have not been able to find a reason for this, it only happens with certain reports. (Others print without problems)

The printout doesn't match the preview exactly.

I have a report that prints fine on a HPIII printer but not on the HP4.  Either the text is missing, or the bands print black.

The output from preview is correct, but printing from the preview does not print all of the data.

How can I tell how the user exits the report's PrinterSetup method?  It does not pass back the status.

How can I check to see if the user cancelled the printing of a report?

How do I determine the paper size of the printer at runtime?

After calling QuickRep.PrinterSetup to pick a specific printer, what's the best way to get the name of the printer that was just chosen?

I can not get the PrintBackground to work. In the preview sample I added a menu with the code:

We have an application, that prints a form developed in QR 2.0i. During development we used a LEXMARK printer an everything worked fine. But our customer have another printer a Kyocera, on that printer the print doesn’t work.

I'm trying to write a report that gets printed to the windows generic text-only printer driver.  Some lines move around when it is actually printed.  Do you have any ideas?

How can I send control chars to the printer with Quickreport?

I can't set the printer at runtime, I get an exception if I use the following syntax:

How can let the users select the printer before running the report?

I can not get the PrintBackground to work. In the preview sample I added a menu with the code:

We have an application, that prints a form developed in QR 2.0i. During development we used a LEXMARK printer an everything worked fine. But our customer have another printer a Kyocera, on that printer the print doesn’t work.

I'm trying to write a report that gets printed to the windows generic text-only printer driver.  Some lines move around when it is actually printed.  Do you have any ideas?

How can I send control chars to the printer with Quickreport?

I can't set the printer at runtime, I get an exception if I use the following syntax:

How can let the users select the printer before running the report?

I retrieve the values of the Delphi PrinterSetupDialog and when I use the printerindex returned by it, I get the error: PRINTER INDEX OUT OF RANGE

When I change the printerindex, I can't select the right paper size.

When I use Printer Settings from within QuickReport, it suggests me to write out all 10000 pages, even though my report contain only 10-15 or so...

I can't select a tray for HP printers

How do I the printer properties if I use my own printersetup dialog box?

I get an extra blank page when I print a range of pages.

Why do the Properties QRPrinter.Canvas.TextHeight and TextWidth return always zero value when running in 16 bits?

When I use printer fonts, the preview does not match the print out.

When i use the EPSON LQ-1070+ printer driver  the program closed, no error message

When I print my reports under NT 4, the font changes are not working correctly.

I get a exception error when running our application on a machine without a default printer.

How do I print to a printer different than the Windows default printer?

I have some easy reports very simple ones (without graphics), but in a matrix printer they are printed very slowly. Is there a way to print them like the DOS programs did in PRINT, and TYPE filename.ext > PRN?

I would set to specify a default printer to be used for multiple reports.

My report only prints one page, but the design-time preview shows all pages.

How can I print multiple copies of a report without having to generate it over and over again?

I am getting printer overrun errors with some reports when I print to my laser printer

When I call the printersetup dialog, it always shows the default printer, even if I have preset the printerindex to another printer.


Using TQREditor

I want to be able to execute a report made in "QREditor" (*.qr) without using the QREditor.  How can I do this so the user can not edit the report?

I'd like to know how to use my QR files made by Delphi 3 with the release of Delphi 1.

Where can I get documentation for the QREditor?

How can I send parameters to the QREditor when using a Query?

After pressing the open button on the QREditor and cancelling this action the buttons do not return to the original state and the 'new' button is disabled.

The QREditor's NewImage button is commented out.  When will this be enabled?

Can I use the PAGE function somehow in TQREditor?

I am interested in the TQREditor component, but I have a question: How can I create a master-detail report through the component?

When working with the QREditor, the Title band does not get previewed nor printed.  All the layout options and the band properties appear to be set correctly, but the band will not preview or print.

Is it possible to bypass the login dialog when I want to report data from a database server with the QREditor? (by providing username and password via code)

I'm using Quickreport editor and I found a problem. If I want to put in a report a label and its caption is the same name of a dataset field's, I can't put this label caption in the report.

The fields in the QREditor are printing as the field names instead of the values.


What's new or missing in QuickReport 3
What’s new or missing in QuickReport 3

Where are the documentation, Help files, examples, QREditor, etc?

What is the TQuickAbstractRep control?

Why do report event use TCustomQuickRep instead of TQuickRep?

What happened to OnGenerateToPrinter?

Are there any plans to continue support of QR1 in Delphi 4 like was done in Delphi 3 with QR 1.1b?

What is the TQRLoopBand control?

What is the TQRStringsBand control?

How do you use the export filter controls?

What is the new 'LinkBand' property?

How can I display a text file with QR3?


RichEdit controls problems

I get an access violation when I have QRDBRichText on a subquery

My RTF field will not span more than one page

My RTF field doesn't consistently print out the last line in the memo.

Can I print a rich text object that is in a field of a file with ole2 bmp object inserted in it?

My QRDBRichText control is not resizing correctly.

My QRRichText/QRDBRichText will not display or print embedded bitmaps.


Saved reports

I am using the QRPrinter object and I can't get it to save to a text file.

If I save a report with the Report's Options.Compression property set to true, I can't load the saved the report back into the preview.

How do I load a previously saved report via code?

What is the format of a report saved to disk by clicking the save button in the previewer?

Why can't I load reports saved from the preview into the Editor and vice versa?

I am trying to do is distribute .qrp files to our sales force.  On their end I will associate .qrp with a viewer we create.  If I create the .qrp file here where my default printer is a LaserJet and distribute the report to someone who has a canon?


Text controls

The OnPrint event of my TQRLabel control is never being called.

I have controls on the page footer that use the detail table.  On the each page of a report (except for the last page) the first record's data appears everywhere except in the page footer where the second record's data appears.

On a band, I have some QRDBText fields and a QRMemo field (set to autostretch=true).  When the memo field is going to go beyond the current page - QR prints the memo first (instead of the text fields) and then rolls on to the new page, finishes the memo, and then prints the text fields on top of the next page.  How can I force the QRDBText fields to print first?.

I can't get my text to word wrap if it doesn't have any carriage returns in the text?

My RTF text does not have the same formatting as it appears in MS Word.

I can't get the mask property work with my phone number field (it's a string field)

If the report contains nulls or blanks these are not included, this destroys the alignment of the columns. Is there any way to include all nulls?

My multiple line QRDBText controls are having the words cutoff at the right margin even when autosize is set to false.

I can't get the mask property to work on my numbers.

I read the FAQ to use TQRDBText because there is no TQRDBMemo, but when my memo contains embedded carriage returns they show up as a square symbol, not as a new line.

Is there a property for QRDBText to tell it *not* to split itself across pages? (i.e. widow/orphan protection.)

What about adding real "LeftAndRightJustify" (newspaper style) (aka Full Justification) in an upcoming release?

How do I control interline spacing within a QRMemo?  Sometimes I need greater control over the line spacing.

I put a mask 999\-999\-9999 for a phone number. And it still printing 5144559400 instead of 514-455-9400. Why?

I have two autostretched text controls on one band and it doesn't work right.

I have a calculated table field and it has line breaks in the text and those line breaks don't print.

I am setting QuickRep1.QRPrinter.OnGenerateToPrinter:=nil to expedite the printing of a large report from the preview form.  When I use the printersetup to select a subset of the pages for printing, I still get all of the pages printed. When I don't set OnGenerateToPrinter:=nil, the settings take effect and I get the subset of pages printed. How can I print a subset of the pages and still use OnGenerateToPrinter:=nil to expedite printing?

Is there a simple way to use a single QRLabel and create a label with the letters stacked on top of each other.  An example is shown below.

I need to change the DataField properties on the QRDBText component under run-time so that it uses one field on page 1 and another the rest of the pages.

If I use tabs (ctrl-tab in the editor) in my TQrMemo fields the report prints []. Is that a general problem in TQrMemo fields?

Is it possible to change the Autosize property of the QRImage and the Autostretch property of the QRRichtext at runtime ?

Can you advise me how to suppress the printing of blank fields in mailing label report?


QRQA1
Q:

When I use QRCreateList() it looks like it's finding fields from the current record in another dataset. The other dataset has the same field names as the one that I am passing to QRCreateList().

A:

The problem is in the field names.  The QRCreateList adds TQRExpr controls to the report and sets the expression to the field name without the table name.  When the report runs, QuickReport searches until it finds the first matching field name.  Without the table name, it will use the first dataset that has a matching a field name.  This is a known bug and will be addressed in a future release.  That's the bad news.  The good news is that you can easily alter the report after calling QRCreatelist and add the table name to the expression.

Example:

QRCreateList(aReport, Self, MyTable, 'Customer Listing', SomeFields);

{ Search the detail band for any TQRExpr controls and insert }

{ the table name after the left bracket in the expression }

for nIdx := 0 to aReport.Bands.DetailBand.ControlCount -1 do

  if aReport.Bands.DetailBand.Controls[nIdx] is TQRExpr then

    with TQRExpr(aReport.Bands.DetailBand.Controls[nIdx]) do

      Expression := '[' + aReport.DataSet.Name + '.' + copy(Expression, 2, 99);

(QR3) This has been fixed for QuickReport 3


QRQA2
Q:

When I create a report at runtime and pass it to QRCreateList(), it does not use my title.

A:

This is happening because you have created the report before the call to QRCreateList.  If the report that is passed to QRCreateList is nil, then it is assumed that you want QuickReport to create the entire report for you.  If you pass in a report that has already been created, we assume that you have already formatted the report with a title, pageheader, pagefooter, etc, and that you only want QuickReport to create the detail band for you.


QRQA3
Q:

Using QR2 and trying to call addprintable in the beforeprint event of a band causes a GPF (or an Access Violation). Is this not allowed for some reason?

A:

You can only call AddPrintable or otherwise add a control to a report band before you start the report.  QuickReport needs to know about all printable controls before it starts the report.


QRQA4
Q:

I am generating report at run time and I have a question: If for example I set QuickReport.HasTitle as true it automatically creates the title band. The problem is that I won't be able to know the name of title variable that was created.

A:

You can reference it through the report's bands property like with the following example:

    with QuickRep1 do

    begin

      ReportTitle := 'Sample Report';

      Bands.HasTitle := true;

      with TQRSysData(Bands.TitleBand.AddPrintable(TQRSysData)) do

      begin

         Data := qrsReportTitle;

         AlignToBand := true;

         Alignment := taCenter;

      end;

      Preview;

    end;

This adds a titleband with the report's title centered on the band.  You will need to add the quickrpt and qrctrls units to the use list in the unit that has this code.

You can reference each band type that can be set through the HasXXXXX properties from the following list:

TitleBand

PageHeaderBand

ColumnHeaderBand

DetailBand

PageFooterBand

SummaryBand


QRQA5
Q:

If you use the method AddPrintable, how can you access the control that was created?

A:

Just assign the control created by AddPrintable to a variable of that type of control.  You can then change the top and left properties by referencing that variable.

Example:

var

  MyCtrl : TQRSysdata;

  .....

  MyCtrl := TQRSysData(Bands.TitleBand.AddPrintable(TQRSysData));

  with MyCtrl do

  begin

     Data := qrsReportTitle;

     AlignToBand := true;

     Alignment := taCenter;

  end;


QRQA6
Q:

I get an error when I try to use the QRCreateList example from the manual.

A:

You must make sure to set the aReport variable to nil before calling the QRCreateList method.  This was omitted from the documentation.  The following example shows how to call this method:

procedure TFormMain1.btnCreateListClick(Sender: TObject);

var

  aReport : TQuickRep;

  SomeFields: TStringList;

  MyTable: TTable;

  nIdx: integer;

begin

  { Create a table on the fly, this example uses a table from the demo database }

  MyTable := TTable.Create(self);

  { create the list of fields to output from the table }

  SomeFields := TStringList.Create;

  with MyTable do

  begin

    DatabaseName := 'DBDEMOS';

    TableName := 'COUNTRY.DB';

    ReadOnly := True;

    Active := True;

    { For this example, we will pull the field names from the table }

    for nIdx := 0 to FieldCount - 1 do

      SomeFields.Add(Fields[nIdx].FieldName);

  end;

  { You must set the report object to nil before calling QRCreateList}

  areport := nil;

  { Build the report }

  QRCreateList(aReport, Self, MyTable, 'Test Listing', SomeFields);

  { You can change the report objects before calling the report }

  areport.page.orientation := poLandscape;

  {preview or print the report}

  aReport.Preview;

  { all done, free the objects }

  aReport.Free;

  MyTable.Free;

  SomeFields.Free;

end;


QRQA7
Q:

How can I change the field width and spacing in a report created with QRCreateList?

A:

The width of the fields is calculated by setting the caption of each header to the character 'X', with count coming from the field's DisplayWidth property.  The spacing between each field is set to 10.  If you change the DisplayWidth property of a field, it will be reflected in the report.

To change the spacing, you can either modify the source code or change the spacing in the report after you call QRCreateList.

Example:

  QRCreateList(aReport, Self, tbCountry, 'Test Listing', SomeFields);

  // Now reduce the spacing between each field by 5 (nIdx declared as integer)

  for nIdx := 0 to aReport.Bands.ColumnHeaderBand.ControlCount -1 do

    if aReport.Bands.ColumnHeaderBand.Controls[nIdx] is TQRPrintable then

      with TQRPrintable(aReport.Bands.ColumnHeaderBand.Controls[nIdx]) do

        Left := Left - (5 * nIdx);

  for nIdx := 0 to aReport.Bands.DetailBand.ControlCount -1 do

    if aReport.Bands.DetailBand.Controls[nIdx] is TQRPrintable then

      with TQRPrintable(aReport.Bands.DetailBand.Controls[nIdx]) do

        Left := Left - (5 * nIdx);


QRQA8
Q:

I have a childband and I set it's PrintBand to false based on certain conditions.  When the band doesn't print, QuickReport doesn't check this and will generate a new page is this band would have been the last band on page.

A:

QuickReport checks the space required for the next band before the BeforePrint event of that band is processed.  There is a simple work around that will resolve this issue.  In the BeforePrint event of the previous band (in this case, the detail band), set the height of the child band to 0.  You could store the height of the child band in it's Tag property at the same time.  In the BeforePrint event of the ChildBand, you would set the height back to original height when you have set PrintBand to True.


QRQA9
Q:

How can I create a report with a Title band to print ABOVE the Page Header band?

A:

The print order of the bands is fixed, you can not print a title band above the page header.  One work around would be to use a child band with the page header.  Put the page header information on the child band and place the title information on the actual page header band.  In the Page Header band's BeforePrint event, set PrintBand to false when the report's PageNumber property is greater than 1.


QRQA10
Q:

How do I get the column header for to print right above the detail band when I also have a group band?

A:

ColumnBands always printed at the top (after the title and pageheader bands).  There are a couple of ways of doing what you are looking for.  You could either put the column labels on the group band or on a child band attached to the group band.


QRQA11
Q:

Is there a way to print a band as footer only on the last page of a report.

A:

Instead of using a footer band, use a summary band and set it's AlignToBottom property to true.


QRQA12
Q:

When my band is split on two pages, how can I keep the non-stretching text controls on the first page?

A:

Note that if you have both stretching and non-stretching components on the same band make sure the non-stretching are printed first (right click and select 'send to back')


QRQA13
Q:

How do I disable the detail band so that I can calculate in the detail section without printing it?  I just want the summary band to print.

A:

Set PrintBand to false in the band's BeforePrint event.  That will suppress the output of the band, but the expressions will still be calculated.


QRQA14
Q:

How can I add a child band at runtime and fields to it?

A:

The way to create a child band is to set the HasChild property of the parent to true.  The following code creates a child band and then adds a QRLabel control to the child band

  QRGroup1.HasChild := true;

  with TQRLabel(QRGRoup1.ChildBand.AddPrintable(TQRLabel)) do

  begin

    Left := 0;

    Top := 0;

    Caption := 'Hello there';

  end;


QRQA15
Q:

Is there any possibility to extract the fields embedded in a specific band during run-time?

A:

The bands are descended from TCustomPanel and you can use the ControlCount property to loop through all of the controls on the band.

For example:

with PageHeaderBand1 do

  for nIdx := 0 to ControlCount -1 do

    if Controls[nIdx] is TQRLabel then

      TQRLabel(Controls[nIdx]).Caption := IntToStr(nIdx);


QRQA16
Q:

We trying to use a QRBand in order to create a 'ColumnFooter' but w/o success.  Do you have some tip?

A:

Quickreport does not have a column footer band.  One way to get a band to print at the bottom of each page would be to use a page footer band and place QRLabels underneath where each column would be.


QRQA17
Q:

How do I reference the name of a childband created at runtime by setting a band's HasChild property to true?

A:

You must create the Childbands before the report starts.  All QuickReport bands and controls must exist before the report starts.  The easiest way to create a childband is the set the HasChild Property of the parent band to true.  You can reference the child band through the Parent band's ChildBand property.  The childband will have a blank name property, but you can set that at runtime.  The following example shows how to create a childband, add a label to it, and then get the name of that band:

procedure TfrmReport.FormCreate(Sender: TObject);

var

  MyChild: TQRChildBand;

begin

  QRGroup1.HasChild := true;

  with TQRLabel(QRGRoup1.ChildBand.AddPrintable(TQRLabel)) do

  begin

    Left := 0;

    Top := 0;

    Caption := 'Hello there';

  end;

  MyChild := QRGRoup1.ChildBand.Name;

end;


QRQA18
Q:

How do I check the height of a band with stretching controls at runtime?

A:

This can not be done with QuickReport 2.0.  The ability to retrieve the height of stretching controls will in the 3.0 release (due out later this year).


QRQA19
Q:

Is it possible to have 2 or more PageHeader Bands in same Report ?

A:

You can not have multiple PageHeader bands on a report, but there are ways to resolve this.  The simplest way would be to add a child band to the page header and put the fields on the child band that would be used for the 2nd page header.  You would then use the BeforePrint event of the page header and of it's child to decide at run time which band to print.


QRQA20
Q:

I have a detail band with a child band.  I want to change the number and layout of the controls on the child band at runtime, but I get an exception error when I add new controls while the report is running.

A:

All bands and the controls on the bands must be created before the report starts, otherwise you will get the exception that you reported.

There are a couple of ways of doing this.  One way is to have multiple child bands, each one with a different layout to fit your needs.  At run-time, you control which child bands can be output.  Just use the BeforePrint event and set the PrintBand variable to false for the ones that you do not want to print.

If you only want one band, put all of the controls on it. and at run time hide the ones that you do not need by setting their Enabled property to false.  To have the controls use the enabled property, you must be using version 2.0j or newer.


QRQA21
Q:

I have a report that has about 10 child bands that may or may not get printed depending on run time criteria. This report always prints two pages, even if it only needs one to accommodate the childbands allowed at run time. Is there a workaround for this?

A:

In the report's form create event, set each childband's tag property to it's height value and then set the height to 0.  Whenever you set printband to true in the BeforePrint event of a band, set the band's height to the it's tag value.  In the AfterPrint event, set the height back to zero again.


QRQA22
Q:

Where can I get a barcode component to use with QuickReport?

A:

We do not provide a barcode control, but on our download page, there are some links to companies who do barcode controls for QuickReport.


QRQA23
Q:

Where can I find a barcode font that I can use with QuickReport?

A:

There are many companies that have barcode fonts, here are a few of them:

CIA (Bar Codes), Wythenshawe, Manchester, UK   http://ourworld.compuserve.com/homepages/CIA_UK

Rivers Edge, Cedar Park, TX, USA               http://www.riversedge.com

Azalea, Seattle, WA, USA                       http://www.azalea.com

[C++Builder]

==================


QRQA24
Q:

Will my Quick Report professional 2.0i work with new C++Builder 3.0 or I should wait for an upgrade from you?

A:

The current release will not work with it, but C++Builder 3.0 will come with a version of QuickReport 2 that we have compiled for it.  We will post new releases for it after Borland releases 3.0.


QRQA25
Q:

I am trying to use QuickReport with C++Builder, but your documentation and examples are all Delphi based.

A:

QuickReport is primarily a Delphi product, we do not have the resources to provide the same level of support to the C++Builder users as we can for Delphi users.


QRQA26
Q:

What are the steps to load reports and preview composite reports.  I add reports to the TList property of QRComposite and then call preview and the preview is empty.

A:

You must add the reports in the TQRCompositeReport's OnAddReports event or they will not be picked up.

Example:

procedure TMainForm.QRCompositeReport1AddReports(Sender: TObject);

begin

  with QRCompositeReport1 do

  begin

    Reports.Add(ListForm.QuickRep);

    Reports.Add(GrpListForm.QuickRep);

    Reports.Add(MDForm.QuickRep);

    Reports.Add(ManyGrpForm.QuickRep);

  end;

end;


QRQA27
Q:

How can we save a composite report to a file (*.QRP) from source code?  (We can not access a QRPrinter object for Composite Report (seems to be declared 'private')).

A:

You should be able access the qrprinter by referencing the qrprinter of one of the individual reports in the composite report after you call Prepare.


QRQA28
Q:

Is there a way to set it up so that each individual report making up the composite starts on a new page when that portion goes to print?

A:

To get the second (or 3rd...) report to start on a new page, make sure that 2nd report has a title band and in the title band's BeforePrint event, call the NewPage method of the second report.  If this report is used outside of the composite report, you will need to disable that code.


QRQA29
Q:

Is there a way to set it up so that each individual report making up the composite starts on a new page when that portion goes to print?

A:

Have a title band with ForceNewPage set to true.


QRQA30
Q:

Why wasn't the Composite Report fixed in 2.0?

A:

There are problems with TQRCompositeReport that are related to printer settings and header/footer bands. If this isn't important to you please use the component as much as you like. The reason for not publishing the fixes is that they require changes to the interface sections of the units/packages and this breaks package dependencies with Delphi 3.

You can build a single report that would behave like multiple reports.  The way you would lay it out would be to leave out the detail band and set PrintIfEmpty to true.  Then add subdetail bands to handle each report.  The master property of each band would be set to the report and they would run one after the other.  You would use each subdetail band as if it was the detail band for the individual report.


QRQA31
Q:

I wish to create a report which lists the contents of two unrelated tables. How do I do this if you can only have one detail band per report?

A:

Use multiple subdetail bands, one for each table.  Set their Master property to the report.  You don't need a detail band, but you will need to set the PrintIfEmpty property of the report to true.  Each subdetail band can have nested subdetail bands and group header and footer bands.


QRQA32
Q:

One of the reports in my Composite Report has Landscape Orientation, and the others are Portrait. The report prints everything in Portrait

A:

You can not mix landscape and portrait oriented reports with the composite report.


QRQA33
Q:

I'm currently using QuickReports for printing static forms without any report functionality. This works fine for me. Then I try to print multiple forms (multiple TQuickReps) as one print job. Therefore I’m using the TQRCompositeReport component but if there are no report components on the TQuickReps nothings happens if you try to print or preview. Is there a way to print different static forms as one print job ?

A:

The CompositeReport control requires that the reports have their controls on report bands.  I was able to print two static reports in a composite report by using a detail band size to fit the page and with the report's PrintIfEmpty set to true.


QRQA34
Q:

In a report I need just to apply a new filter to the qreport dataset and then continue the report.  It's like running several reports but "bundled" all together in one preview / report.

A:

You can not change the filter on an open dataset, that's a BDE limitation.  One way to do this would be to use multiple subdetail bands for each band.  Each band could use the same dataset.  You would add a group footer band to each dataset.  You would close it, change the filter, and the reopen it in the group footer band of the PREVIOUS dataset.


QRQA35
Q:

Is it possible to exclude the BDE in any of the 2.x versions of QuickReport as one can do with QR1.1a using the line: {$define XBDE}? If so, which 2.x version?

A:

QuickReport 2 does not have the XBDE compiler directive that was in QuickReport 1. If you are using Delphi 2 or later, this should not be a problem, as the BDE does not get initialized until the first time that it's called.  If you are using Delphi 1, the only alternatives are to either include the BDE or to use QuickReport 1.


QRQA36
Q:

I am getting the error "Unable to locate source file "quickrpt.pas" and after that EBDEngineError "Table does not support this operator"

A:

There appears to be a bug in the BDE that allows datasets to make a call to the RecordCount property when that value is not supported by all databases.  We have yet to find a satisfactory work around that works for all databases.  You can manually edit the quickrpt unit and comment out the call that causes this exception.

Copy the quickrpt.pas to your project directory.

Look for the line that contains "RecCount := ParentReport.RecordCount;" in the quickrpt unit (the location of the line in the unit will vary depending on which release of QR2 you are using) and comment it out.

Recompile your report (you don't need to add the quickrpt unit to your project, Delphi will find it).

Even though there is a try..except block in our code, Delphi is still throwing an exception.  If you modify this code in the quickrpt unit and comment out the code in the if DataSetOK block, you will no longer get that error.


QRQA37
Q:

Is there any known problems using QR 2.0j in a Delphi 2 (or 3) DLL?  Each time I am finished and make a call to FreeLibrary() from my calling application, the calling application freezes.

A:

There is a known problem unloading a quickreport dll, something is not being freed and that's why your call to FreeLibray hangs.

We are aware of the problem and it will be addressed later this year.  The only work around is leave out the call the FreeLibrary().  When your application exits, the dll will be released automatically.


QRQA38
Q:

Where is the ActiveX component that is mentioned on your web page?

A:

We still have some remaining issues to fix with the ActiveX component before we can release it.


QRQA39
Q:

I like to have the manual loaded, but Word takes up a lot of resources

A:

We have an Adobe Acrobat version of the manual available on our web site and available via FTP from ftp://ftp.qusoft.no/pub/quickrep/qr2acro.zip


QRQA40
Q:

I don't find information on TQRCompositeReport.

A:

Documentation for the TQRCompositeReport will be included in a later release.  There are a few programming issues that still need to be fixed for the Composite Reports and we will release the documentation after they have been resolved. The example demo program included with QuickReport 2 does use the CompositeReport so you can follow that if you wish to work with the CompositeReports before we release the update.


QRQA41
Q:

I cannot find information about Options Property for TQuickRep

A:

The first options (FirstPageHeader, LastPageFooter) are self describing.  If the FirstPageHeader is set to false, then the page header will not be printed on the first page.  LastPageFooter works in a similar manner  If the Compression property is set to true, then a simple compression routine is used on the internal metafile storage of a rendered report.


QRQA42
Q:

How does the OnPrint event work?

A:

The OnPrint event is called just before the control is printed. The string to be outputted is in the Value property and can be changed. This property is also useful to suppress printing of repeated values.  This event only gets called at runtime, the design time preview will not call any of the event handlers.


QRQA43
Q:

How do I install the help files into Delphi 3's integrated help?

A:

1. Copy the file QUICKRPT.HLP  into the HELP directory under the Delphi 3 main directory.

2. Add the line

:Link quickrpt.hlp

to the "Third-Party Help" section at the bottom of the DELPHI3.CFG file  located in the Delphi HELP directory.

3. Delete the hidden file Delphi3.GID in the HELP directory.

The next time you launch the Delphi 3 help, it will rebuild the delphi3.gid file and the QuickReport help file will be in the integrated help.  Please note that this help file is not complete and will not have support for all controls.  This will addressed in the 3.0 release.


QRQA44
Q:

PrintPreview & Print work OK until I use ExportToFilter after which PrintPreview & Print do not produce output.

A:

This was a known bug and was address in the 2.0j release


QRQA45
Q:

When I try to export a previously saved report, nothing happens.

A:

Quickreport can only export reports when they are being generated.


QRQA46
Q:

How do I get all of the export filters to show in the save dialog in my preview?

A:

Add the qrextra and qrhtml units to your report's uses clause and the filters in those units will show up at runtime.


QRQA47
Q:

How do I use the HTML export filter?

A:

The export filter topics start at page 98 in the manual, under the topic "ExportFilter".  The HTML filter is an add-on and you will need to add qrextra and qrhtml to your uses clause (and the QuickRep source directory will need to be on your library search path.  You would call the HTML filter like this:

QuickRep1.ExportToFilter(TQRHTMLExportFilter.Create('file.htm'));

Please note that the HTML filter does not work well and is scheduled to be rewritten in the 2.1 release of QuickReport.  If you need HTML functionality now, you will probably get better results if you use Microsoft's free HTML printer driver (Window 95 only).


QRQA48
Q:

I am using a TQRExpr to print the SUM of a field of a Query.  But I have a problem. If the Query has no result (zero records) then instead of printing the number 0, It is printing SUM(qry.Total).

A:

This is a known problem with QR2 and the work around is to use the OnPrint event of the TQRExpr control to blank out or zero out the value when the value is equal to the expression like the following example:

procedure TfrmReport.QRExpr1Print(sender: TObject; var Value: String);

begin

  if sender is TQRExpr then

    if Value = TQRExpr(sender).Expression then

      Value := '0.0';

end;

(QR3) This has been fixed with QuickReport 3


QRQA49
Q:

When I add lines to a QRExprMemo control at runtime, the control does not filter out any blank lines that may have added.

A:

This control filters out blank lines when the lines are defined before the report starts.  When you add blank lines in the BeforePrint event, we assume that you actually want them in the memo.  The work around is to add code to the BeforePrint event so that you are not adding blank lines at runtime.


QRQA50
Q:

How do you use the FORMATNUMERIC function, I can't find a help files to help me?

A:

This function is a wrapper for Delphi's FormatFloat() function.


QRQA51
Q:

Is there an expression that will permit grouping by month? The underlying database has a date field.

A:

You have to pass in an expression that would be the month, the easiest way is to use a calculated database field that would be the year and the month (unless you want the same month from multiple years grouped together.


QRQA52
Q:

I want to have a database field as the expression, but the table is not available to me at design time and adding <tablename>.<fieldname> to the expression string at run time doesn't work.

A:

To define an expression at runtime, you must define it before the report starts.  Group bands initialize their expression at the start of the report and you can not change the expression while the report is running.  This limitation will be removed in a future release.


QRQA53
Q:

I couldn't find any information for the meaning of the "arguments" parameter in the RegisterQRFunction

A:

The last parameter is used for the expression builder to know what

    group to put the function in and what parameters to accept.

    First is the group (1-6), followed by one character for each

    parameter.

    1NN would be in the first group (don't remember which one), with two

    numeric arguments.

    2SNB would be in the second group, three parameters (text,  numeric

    and boolean


QRQA54
Q:

Expression wont work if the field name has a space or a hyphen in it

A:

The expression parser will not work with field names with spaces or hyphens in it.  This is a limitation that we try to fix in a future release.  There are a few simple workarounds for this.  One way is to use a TQuery control and rename the field name in the SQL statement.  If you have to use a TTable, create a calculated field based that equals the original.


QRQA55
Q:

My function doesn't work  I want to use:

if (table1.field1 = '', 'Blank', table1.field1)

to output the text "blank" when the field is blank or null

A:

Change "if (" to "if(" and the function will work.


QRQA56
Q:

I can't sum TTimeFields?

A:

TTimefields get converted to strings by the expression evaluator which prevents the report from doing

    math operations on it.  A future release will have a function to 'convert back' to a float.


QRQA57
Q:

Expressions are being evaluated from right to left

A:

This will be addressed in a later release. The work around is to use parentheses


QRQA58
Q:

The following expression always returns 0: SUM(IF(Query1.CartonID='SI', Query1.Caliper, 0))

A:

Change the 0 to 0.0 and the SUM() function will work correctly.


QRQA59
Q:

Why doesn't the expression Count(Table1.Field1) return the right value?

A:

The Count function in the expression builder returns a number that increments by 1 with every call to Count.  It does not behave like the SQL Count() function that counts the variable passed to the function.  If you click on Count in the expression builder you should see "Increments for each iteration" appear under the Count label as the function's description.


QRQA60
Q:

How do I check the value of QRExpr control at runtime?

A:

The "Value" property of a TQRExpr component is of type TQREvResult, which is defined in qrprntr.pas.  You can check "Value.Kind" to see what the datatype is.  The following table shows how to retrieve the results of the expression based on the value of "Value.Kind"

If Value.Kind = resInt then the results of the expression are in Value.IntResult

If Value.Kind = resDouble then the results of the expression are in Value.DblResult

If Value.Kind = resString then the results of the expression are in Value.StrResult (defined as string[255])

If Value.Kind = resBool then the results of the expression are in Value.BooResult

If Value.Kind = resError then the expression had an error


QRQA61
Q:

I use QRExpr to calculate the Average of a currency field but it shows as numerical, not currency.

A:

This is a known limitation of the QRExpr control.  You can have the control display the currency character by using the mark property and set the mask to something like '$,###.00'.  The QRExpr control's mask is the format string used by FormatFloat() and FormatDateTime functions.  Please refer to their documentation for allowable values.


QRQA62
Q:

Why does my report crash when I use TQRExpr controls uner Delphi 1?  The same report runs fine when I compile it with Delphi 2.

A:

Delphi 1 uses a lot of stack space when you use nested expressions with the TQRExpr control.  This is why we suggest that you raise the stack size as high as Delphi 1 will let you go for your project.  We allocate all of our expression variables from the heap. but Delphi 1 still uses stack space to handle the multiple function calls required to evaluate the expressions.  With Delphi 1, some expressions are bettered handled by adding code to calculate the results instead of using the TQRExp control.


QRQA63
Q:

I have a simple query that uses the SQL COUNT(*) and I am  trying to display it in a QRExpr component but it is not displaying that field.

A:

The SQL COUNT(*) is conflicting with the QR COUNT function.  You will have to alias the column or use a QRDBText to output the field.


QRQA64
Q:

I can't get the QRExprMemo to display more than 255 characters when I use Delphi 1.

A:

The number of characters in a QRExprMemo is limited to the maximum string size.  In Delphi 1, the maximum string length is 255 characters.


QRQA65
Q:

How can I count frequencies of the values in a dataset field?

A:

You can do this with expressions like:

SUM(IF(Table1.GENDER = 'M', 1, 0)) and SUM(IF(Table1.GENDER = 'F', 1, 0))


QRQA66
Q:

How can I get the dataset of the report to display in the QRExpression if the dataset is on a separate form?

A:

You will need to add the dataset to the report, using the report's AllDataSets property.  The expression will not work at design time, but it will work at runtime.

Example:

 Form1 has a dataset named tbCountry with the field 'Capital' in the table.

Form2 has a report named QuickRep1 with a qrexpr control on the summary band.

You want qrexpr to read the capital field of the tbCountry dataset.

You would have form2 use form1 and in the report's BeforePrint event you would add the tbcountry table to the report with the following syntax:

procedure TForm2.QuickRep1BeforePrint(Sender: TQuickRep;

  var PrintReport: Boolean);

begin

  with quickrep1.AllDataSets do

    if IndexOf(Form1.tbCountry) = -1 then

      Add(Form1.tbCountry);

end;

The QRExpr.Expression property would be set to tbcountry.capital


QRQA67
Q:

I want to sum a field, but I need to ignore the highest and lowest value, can this be done?

A:

You can do this by using the expression 'SUM(Field)-MIN(Field)-MAX(Field'.  Please note that if you only have two records, the sum will be zero.


QRQA68
Q:

What are the allowable datatypes that can be used in a TQRExpr control?

A:

The allowable Delphi datatypes that can used in a TQRExpr control (or Group expression) are longint, double, string[255], and boolean.  Currency fields are stored as double.  Date and time fields are stored as string.


QRQA69
Q:

How can I separate the letters from the top of the frames with a QRDBText control?

A:

The current release provides no control over the relative positioning of the frame in regards to the text.  You can get finer control by using a QRShape control and place it underneath the text control.


QRQA70
Q:

Setting DrawBottom to true of the report's Frame property of works on preview, not when printed.

A:

The default bottom margin of a report goes beyond the printable area of many printers.  If you set the bottom margin to a greater value (try 1.0 in as an example), you should see the bottom frame.


QRQA71
Q:

Some lines do not appear in the preview, but they appear in the printout.

A:

The report is rendered to a TMetafile object when it is sent to the preview.  Depending on the zoom value of the preview, the scaling of the TMetafile may crop out some of the lines.  If you zoom in (you may need to use a custom preview to zoom in close enough), the lines will reappear.


QRQA72
Q:

Is there an expression that will permit grouping by month? The underlying database has a date field.

A:

You have to pass in an expression that would be the month, the easiest way is to use a calculated database field that would be the year and the month (unless you want the same month from multiple years grouped together.


QRQA73
Q:

I have a billing report. In the group-footer I take the sum of the amounts. I print it at the summary . Now I would like to print the intermediate-results of the amounts at the end of each page (except at the end of the last page). How can I do it?

A:

You would put the TQRExpr component to handle the amounts on a page footer band.  Set the QRExpr's ResetAfterPrint to true so that the total will get reset after each page.  To suppress the final page footer, set the report's Options.LastPageFooter to true.

If you want to have a page footer on the last page, but want to suppress the output of the last page's total, one easy way to tell that you are on the last page is to use a summary band.  It will be called before the last page footer and you can use it's BeforePrint event to set a flag to prevent the output of the final QRExpr total.  If you don't need a summary band, set it's height to 0.


QRQA74
Q:

When I have a group header for a sub-detail band, the header gets printed twice for the first record and only once for every record thereafter.

A:

If you just want a group header band to print for each set of subdetails, do not use a TQRGroupband, that band is for when you want to break up the data in groups.  Just set the subdetail band's Bands.HasHeader to true.  This will add a band of type TQRBand and it will only print at the start of each set of subdetails.


QRQA75
Q:

TQRGroup does not work with an expression on a queryfield if the query component is not on the report form.

A:

The dataset must be either on the form or on the report's datamodule.


QRQA76
Q:

A new page is not generated on the GROUPHEADER if the current page number is 1 (one) and the Property NewPage is TRUE.  It will work fine if this occurs on page number 2 or higher.

A:

QuickReport was designed to ignore the first ForceNewPage band if that band is on the first page.  To get around this, set ForceNewPage back to false and call the report's NewPage method from the BeforePrint event of that band like the following:

procedure TfrmGroupTest.QRGroup1BeforePrint(Sender: TQRCustomBand;

  var PrintBand: Boolean);

begin

  Quickrep1.NewPage;

end;


QRQA77
Q:

How do I do set a group expression to break on multiple fields?

A:

Set your group band expression to 'Query1.Field1 + Query1.Field2', if they are strings.  If they are not strings, convert them to strings first using the STR() function.


QRQA78
Q:

We query our data grouped by a field and is there any neat way to get the text "to be continued" to the bottom of the page if the group is several pages, i.e. how do we know before page change the last row was not the last record in the group?

A:

There isn't a "neat" way to do this with the current version.  You may want to add with some code to the BeforePrint event of the page footer band.  You could check the next row in your dataset to see if the group changes.  Just remember to leave yourself in the original row of the dataset so that you don't skip any rows.


QRQA79
Q:

How do I get group headers to print after a page break?

A:

The ability to do this automatically will be in the 2.1 release (due out later this year).  You can emulate repeating group headers through code and some duplicate bands. An example program that shows how to do this can be downloaded from our web site.  Look for the file "repeats.zip".


QRQA80
Q:

How do I create a group band at runtime?

A:

Before the report starts, you can add a group by creating a control of that type and setting some of it's properties.  The following code would add a group band to a report using the orders table

procedure TfrmCreateControls.FormCreate(Sender: TObject);

begin

  { Create the group on this form }

  QRGroup1 := TQRGroup.Create(Self); { QRGroup1 defined as TQRGroup in the form declarations}

  with QRGroup1 do

  begin

    { assign it to this report }

    Parent := QuickRep1;

{ assign it to the detail band }

    Master := Parent;

{ Set it's expression }

    Expression := 'CustNo';

  end;

  { Now add a text control to this band }

  with TQRDBText.Create(Self) do

  begin

    Parent := QRGroup1;

    Dataset := QuickRep1.Dataset;

    DataField := 'CustNo';

  end;

end;


QRQA81
Q:

I have several Group Bands in my report. How is it possible to change the printing order of these bands at runtime. Eg. at case one I need to print only Group1, case two Group2, Group 1, Group 3, case three Group 4, Group 2 etc. The order is entered by the user at runtime.

A:

QuickReport uses the creation order of the group bands to set the order at runtime.  You can change the ordering of the group bands by calling the their SendToFront and SendToBack methods.


QRQA82
Q:

How I do to make background shadow in alternated lines (detail) of report?

A:

Place a TQRShape underneath all of the other controls on the band.  Make sure the transparent property of the text controls on top of the shape is set to true.   In the BeforePrint event of the Band, "toggle" the Brush.Color of the TQRShape.  This will not appear at design time, but will work at runtime. Example:

procedure TfrmMasterDetail.QRSubDetailItemsBeforePrint(

  Sender: TQRCustomBand; var PrintBand: Boolean);

begin

  { toggle the item background so that we can have alternating colors }

  { like the greenbar paper we all know and love.	  }

  with QRShape1.Brush do

    if Color = $00F0F0F0 then

      Color := $00E0E0E0

    else

      Color := $00F0F0F0;

end;

This will allow you have a color that does not use up the entire width of the band.  If you want to do the entire band, set the band's color property and leave out the TQRShape.


QRQA83
Q:

Is there a 3rd party component vendor for QR that supports PNG images?

A:

I don't know of any PNG controls for QR2.  Delphi 3's Image control can be extended to support other formats, if a vendor has provided a package that adds PNG to the standard Delphi 3 TImage control, it should work in Quickreport 2.


QRQA84
Q:

(Delphi 3) I am trying to use the QRImage component to print a jpg image. I noticed that if I select a jpg image after placing a qrimage component on a quickreport, it shows up correctly on screen. But when I then PREVIEW the report, the image is not there.

A:

Did you add jpeg to your uses clause for that report?


QRQA85
Q:

Why wont QRImage doesn't print icon files when Stretch is set to true?

A:

The Stretch property has no affect on icons.  This is documented in Delphi's help for the stretch property of TImage (ancestor of QRImage)


QRQA86
Q:

My shapes don't print correctly on bands that wrap over a page

A:

Right click on QRShape and select print to back so that it get printed first


QRQA87
Q:

Why do TQRShapes appear thicker on screen than when it prints

A:

There is a known problem where the thickness of the Shape's lines vary between the preview and the printer.  The work around is to set the Shape.Pen.Width property to a variable and set the value depending on whether you are printing or previewing.  In the report's BeforePrint event, you can check the value of the report's QRPrinter.Destination property.  If it's set to qrdMetafile, then it's rendering the preview.  If it's set to qrdPrinter, then it's rendering the report directly to the printer.


QRQA88
Q:

I'm creating a report which requires a couple of vertical lines on the page.  I have added the appropriate QRShapes (shape=qrsVertLine) to the detail band.  How do I continue the vertical line on the page even when there are not enough detail records to fill the page?

A:

Try dropping a TQRShape directly on the report control (not on a band), and set it's height to fit the printable area of the page.  If you use "Send to back" on the shape, the bands will appear on top of it.  This will give you a continuous shape going down the page.  You may need to add code in the report's BeforePrint event to set the Size.height of the QRShape to the height of the report minus the top and bottom margins.

Note:  This will not work with Composite Reports.


QRQA89
Q:

My custom preview doesn't work the way it did with QR1

A:

The preview must be called with Show instead of ShowModal.  This a change from the QuickReport 1 behavior, but is required for QuickReport 2.


QRQA90
Q:

In D2 and QR 1.1 I used "TQRCustomControl" how can I get it to work in D3 and QR2.0 ?

A:

This was replaced in QuickReport 2 by the TQRPrintable class.  This is documented in the manual.  The example control detailed in the manual had a couple of bugs, a better example control can be downloaded from our web page under the name "qrcb.zip".


QRQA91
Q:

We have just installed QR20K instead of QR20Kbeta (working with D3 +Language Pack).  We now notice that the Quick Report Units are not translated into Dutch as it used to be with QR20Kbeta.

A:

You will need to uninstall and then re-install the Language Pack.


QRQA92
Q:

I am porting a report from QR1 to QR2 and the FromPage and ToPage properties are missing.

A:

In QuickReport 2 they are named FirstPage and LastPage.


QRQA93
Q:

I keep getting the error: "Can't load package (the path & such)" A device attached to the system is not functioning"

A:

Delete the file qrpt30.dpl from the Delphi 3.0\bin directory.


QRQA94
Q:

Recently I upgraded Delphi 3 to Delphi 3.02.  I now get an error trying to install QRPro package.

Error Message comes back as: Can't load package c:\quickrep\delphi3\bin\dclqpro.dpl.  A device attached to the system is not functioning.

A:

When upgrading Delphi 3 to the new release, you must reinstall QuickReport 2 and follow all of the original instructions.  This error is happening because you did not delete all copies of qrpt30.dpl from your system BEFORE installing QR Pro.


QRQA95
Q:

I recently received the latest copy of Delphi v3, build number 5.83. Whenever I load Delphi, an error message appears:

    PROCEDURE ENTRY POINT QREXTRA.TQREDITOR AT 7DBEC950 COULD NOT

    BE LOCATED IN DYNAMIC LINK LIBRARY QRPT30.DPL

A:

The Delphi 3.01 maintenance release comes with the standard version of QuickReport 2.0g and it does not come with the QREditor component.  You will need to reinstall your current QuickReport Pro over the one that comes with Delphi 3.01.


QRQA96
Q:

I am trying to convert a Report from version 1.x to 2.0i, in Delphi 3.  In version 1.x it was possible to have several detailbands in the same report, and then enabling the detailbands as they where needed, thus having different bands visible, depending on a field in the dataset.

A:

QuickReport 2 does not support multiple detail, page header, or title bands, but each band can have a child band and you can control the output of each band individually at runtime.  Please see the manual topics on ChildBands for more information.


QRQA97
Q:

The TQRGroup property GroupData was in Version 1 does not exist in QuickReport 2.  Is there a replacement?

A:

QuickReport 2 does not have a groupdata property, it has an expression property for determining group breaks.


QRQA98
Q:

[Delphi 3] How can I restore a German layout during runtime in the Preview ?

A:

The German resource files supplied with Delphi 3 does not work with current release of QuickReport Pro.  We will post a revised German resource file as we can get it updated.


QRQA99
Q:

I updated to QuickReport 2 with C++ Builder and I can't compile my existing QR1 reports.

A:

In addition to following Appendix C in the manual, C++ Builder users will have to remove the following line from their source code:

#include <vcl\QuickRep.hpp>

This file is part of QuickReport 1 and will cause conflicts when compiling with QuickReport 2


QRQA100
Q:

The QRGroup in version 1.0 had a field called DataField, in the 2.0 version this field doesn't exist. In the unit that called the report I would set the contents of this field. How do I do it now?

A:

The QuickReport 2 QRGroup has an expression field that works like the expression property of a QRExpr component.


QRQA101
Q:

I cannot run the QuickReport demo programs in Delphi 1.

A:

We apologize for that, but that error will not stop Delphi 1 from compiling the QR2demo.  If you select "Ignore All" when errors pops up when loading a form, the project will run under Delphi 1.  Just load each form and save it back out again.  The errors will only appear once.


QRQA102
Q:

I could not find the Linkband feature that QR1 has.

A:

This is scheduled for the 2.1 release.


QRQA103
Q:

When compiling and starting the qr2demo.dpr the following error occurs: Error while reading GrpListForm.Font.Charset. Property does not exist !

A:

The version of Delphi that you used did not support that property, you should be able to load the form by selecting "Ignore All" on the error dialog.


QRQA104
Q:

Will reports written in 2.0 be compatible with 2.1?

A:

Yes,  2.0 will be upwardly compatible with 2.1, and 2.1 (and 2.0) reports will be upwardly compatible with 3.0


QRQA105
Q:

In QR1, we had ShowDialog Property to Show PrintSetup Dialog before Print, but in QR2 does not have this. How can I do this function?

A:

If you call the Report's PrinterSetup method, this will set the printer settings for the report before you run it.  You could do it like:

  with frmReport do

  begin

    QuickRep1.PrinterSetup;

    QuickRep1.Preview;

  end;


QRQA106
Q:

I installed QuickReport Professional version 2.0 in my Delphi 3.0, all went well and the two new components were installed. When I try to run the example project for the QREditor Component, EDITOR.DPR, I get a error message in line 41 of the QREDFOR unit that says: Undeclared identifier: TQREditor.

A:

Please make sure that you have enabled the dclqlpro.dpl package under project options.  This package is labeled "Delphi QuickReport Professional Components" and it should be in your "...\Delphi 3\bin" directory.


QRQA107
Q:

I just installed QuickReport 2 Pro, but I can't find the editor component

A:

This control gets installed when you install QuickReport, it's usually one of the rightmost components on the qreport pallet.


QRQA108
Q:

After I install QuickReport Pro into Delphi 3, I only see the QREditor and QExprMemo components

A:

Make sure that you have selected the dclqrt30.dpl package


QRQA109
Q:

My QuickReport right-click menus have blank lines (German release of Delphi 3)

A:

In the "bin" directory of Delphi, delete the file "dclqrt30.DE".  In the windows system directory and in Delphi 3.0\bin, delete "qrpt30.DE"

Borland is using "FR" extension for the French release. So you need to delete all copies of "dclqrt30.FR" and "qrpt30.FR" before installing QR2 Professional.


QRQA110
Q:

I keep getting CGI timeouts when I try to download from your web site.

A:

We have had some technical difficulties on our server and with our ISP.  If you get an error, please

    again later.


QRQA111
Q:

I have upgraded to version 2.0 from 1.1. Since then I can't load an already saved report.

A:

The saved reports from QuickReport 1 are not compatible with QuickReport 2


QRQA112
Q:

What happened to the thumbnail feature of QR1?

A:

Thumbnails are not supported in QuickReport 2.0, it will be back in version 3.0 later this year.


QRQA113
Q:

I tried to download qreg20g.exe from your Web site but I get the 'Document contains no data' message.

A:

The maximum number of users that can access our web site may have been reached.  Please wait a few minutes and try again.


QRQA114
Q:

Every time I try to download the new release of QR, I  receive the message: Impossible to open http://www.qusoft.no/scripts/filelist/filelist.exe?DL.

A:

What program are you using to download QuickReport?  If you are using Microsoft Internet Explorer 4.0, we have received reports that this program can not download from many web sites, including our own.  MS IE 3.0x and Netscape have no problems downloading from our site.


QRQA115
Q:

How can I tell which version of QuickReport is installed in Delphi?

A:

When you right-click on the QuickReport component, the version is displayed as the first line of the pop-up menu.


QRQA116
Q:

But what is that TQRExprMemo? I can't find this component....

A:

This component is in the qrbonus unit.  You'll need to install that unit to get that control.


QRQA117
Q:

I have removed QR from the package list but how do I reregister it?

A:

That means that you will need to add that package back into Delphi 3.

Select Component->Install Packages

Press the Add button in the "Design packages" panel.

Select the bin directory in your Delphi 3 directory

Select the dclqrt30.dpl and press the Open button

Repeat for the dclqrpro.dpl package.

Finally, press "OK" in the "Project Options" window.

If this does not work, I would try reinstalling the QuickReport all over again, making sure that you follow the instructions in the readme.txt file without missing a step.


QRQA118
Q:

I would like to know if it is possible to include subreports into reports like Microsoft Access.

A:

QuickReport 2 has a similar feature with the TQRSubDetail band.  This is documented in the manual and in the kb.zip file on our download page.  A Master/detail tutorial project is available on our download page.


QRQA119
Q:

How do I insert a new QRsubdetail band in between two existing subdetail bands? I have a very long report and when I insert a new band at the end and use the "move band up" option on the pop-up menu, it seems to really mess the report up.

A:

QuickReport uses the creation order of the group bands to set the order at runtime.  You can change the ordering of the group bands by calling the their SendToFront and SendToBack methods.


QRQA120
Q:

How do I create a QRSubDetail band at runtime?

A:

The following code creates a subdetail band and adds a QRDBText control to it:

  SubBand := TQRSubDetail.Create(self);

  MyText := TQRDBText.Create(self);

  with SubBand do

  begin

    Height := 20;

    Parent := QuickRep1;

    Master := QuickRep1;

    Dataset := tbOrders;

  end;

  with MyText do

  begin

    Top := 0;

    Left := 10;

    Parent := SubBand;

    Height := 17;

    Dataset := tbOrders;

    DataField := 'OrderNo';

  end;


QRQA121
Q:

I could not get the SUM() expression to work on subdetail bands.

A:

Make sure that you have Master property of the QRExpr control set to the SubDetail band.


QRQA122
Q:

I have a two level report where I on the primary level tries to cancel the output for both levels by setting the printband property to false for some of the primary records. Why is the secondary level printed anyway? How can I avoid this?

A:

The PrintBand feature was designed to work independent of any other band.  In this case, one work around would be to set the detail band's tag property to 1 when print and 0 when you do not print.  When you get to the subdetail, set it's PrintBand to true only when the detailband's tag property is greater than 0


QRQA123
Q:

I want to make a report with 2 subdetails. The first subdetail works fine, but the second I need that it has 2 or 3 columns but I don't know how can I make that a subdetail can have 3 columns and the other sections has only one column.

A:

You can not do this with QuickReport at this time.  The number of columns applies to all detail and subdetail bands.  One work around is to put three sets of TQRLabels on your second subdetail band and manually handle the columns.  In the BeforePrint event of the band, you would populate the first set of QRLabels.  You would then call the dataset's Next method (if not EOF) and populate the 2nd set of QRLabels. If not EOF, you would  do one more time for the 3rd set of labels.


QRQA124
Q:

I am trying to reset the page number for every group band.  How can I do that ?

A:

This is not supported by the QRSysData control.  You will have to track the page number manually and assign the value to a TQRLabel.


QRQA125
Q:

Does quickreports support BDE alternatives such as ODBC98?

A:

As long as the 3rd party package supplies a descendant TDataset control it should work.  I use OBDCExpress and their TOEDataset control works just fine with QuickReport 2 and 3.  The general rule of thumb is that if the regular Delphi data-aware controls work with your 3rd party TDataset, then QuickReport will work too.  The release of QR3 bundled with Delphi 4 would not work with non thread safe database drivers (like SQL Links or Opus), but this was addressed in the 3.0.1 release.


QRQA126
Q:

My report uses tables on a datamodule and even when my report form is using the datamodule, I can't get the tables or fields to show up.

A:

Make sure that the datamodule is loaded when you are setting the fields at design-time.


QRQA127
Q:

I use the following procedure to create forms at run time:

procedure TfmMainForm.ShowModalForm(FormClass: TFormClass);

begin

  Screen.Cursor := crHourGlass;

  with FormClass.Create(Application) do

  try

    ShowModal;

  finally

    Free;

  end;

  Screen.Cursor := crDefault;

end;

Usage: ShowModalForm(TfmSpecialForm), ShowModalForm(TfmOtherForm);

I need a similar routine to create reports.

A:

The FormClass is specific to forms and you can not do the same thing with the report class.  Put the report on the form and use the form's FormShow event to call the report's preview.


QRQA128
Q:

Is there a way to reset the page number based on a group header?  This would be useful when printing invoices.

A:

Instead of using a TQRSysdata control, use a TQRLabel and manually track the page number.  You can increment and reset that value in your code based on the events that you select.  Then in the footer band, set that TQRLabel's Caption to the string value of the page number.


QRQA129
Q:

Is it possible, to use the MS Intellimouse's wheel inside the preview of quickreport?

A:

This should be handled by the OS or by the mouse driver.  With Win98, the mouse wheel support is in the OS, with Win95 you can enable the wheel with the Intellimouse 2.2 driver from MS.  I have tested the preview with Intellimouse 2.2 under Win95 and the preview could be scrolled by the wheel.


QRQA130
Q:

What's the difference between this file and QR2FAQ.TXT?

A:

QR2FAQ.TXT was intended to list the current release notes along with some common questions.  This file is basically the most common questions (and some uncommon ones) that the users have sent in.


QRQA131
Q:

When I set the height of the report, it keeps going back to the default value, is this a bug?

A:

The height value of the report is derived from the page size.  If you manually set this value, it will snap back to the calculated value.


QRQA132
Q:

It is difficult to manage reports with many bands. Is there a better way to create complex reports ?

A:

When I have a single report with many bands, I set the height property of the bands that I am not working on to a small value to shrink them out of the way at design time.  I assign the actual height to the band's tag property and at runtime, I just copy the tag to the height property to expand the band back out.


QRQA133
Q:

I want to print reports with text and pictures. Each of the pictures (two in a row) shall have a caption. Now it sometimes happens that the caption is printed on the first page, but the pictures on the next page. How can I keep that together?

A:

Right-click on the image controls and select "send to back".  This put the images at the top of the creation order on the band and they will be printed first, forcing a page break if needed.


QRQA134
Q:

I want a 1.5" top margin and 0.5" bottom margin on odd numbered  pages and a 0.5" top margin and 1.5" bottom margin on even pages.

A:

You can't change the margins while the report is running.  One work around would be use childbands on the page header and page footer bands and selectively print the childbands on every other page.  First set the top and bottom margins to 0.5".

For the footer band, you add a blank child band of 1" in height.  In that band's BeforePrint event, you would set PrintBand to true only on even numbered pages.  This will give the appearance of increasing the bottom margin by 1" on the even number pages.

For the Headerband, you would do almost the same thing.  You add a child band and move all of the header information from the actual page header band to the childband.  You then set the height of the pageheader band to 1" and in it's BeforePrint event, you would set PrintBand to true only on odd numbered pages.  This will give the appearance of increasing the top margin by 1" on the odd number pages.


QRQA135
Q:

I have several Group Bands in my report. How is it possible to change the printing order of these bands at runtime. Eg. at case one I need to print only Group1, case two Group2, Group 1, Group 3, case three Group 4, Group 2 etc. The order is entered by the user at runtime.

A:

QuickReport uses the creation order of the group bands to set the order at runtime.  You can change the ordering of the group bands by calling the their SendToFront and SendToBack methods.


QRQA136
Q:

How can I set the contents of the page header based on the first subdetail band that prints on that page?

A:

You could do this by using childbands on the page header.  Use group footer bands (if you don't actually need one, set their height to 0 before the report starts) and in the BeforePrint event of the group footer, set a global variable to a value that would represent the next subdetail band.  When the it comes time to output the child bands on the pageheader, you would set their PrintBand variable in their BeforePrint event based on the value of that global variable.  Since the variable is being updated when a subdetail is finished, if you hit the page header that means that there is more data.

You would not want to increment the value by 1 each time, that would get out of synch when a subdetail band did not have any data.

Remember to initialize the global variable in the report's BeforePrint event.


QRQA137
Q:

All of my fields come out blank.

A:

Did you set the dataset property of the report to an active dataset?


QRQA138
Q:

An error appears when we set the "Orientation" in the "Page" property to "poLandscape" and the "PaperSize" property to "Default". If we now call the Preview, the following error message appears on the screen : "Error on floatingpoint operation".

A:

There is a known problem with QR2 if you change the orientation at runtime when the paper size is set to Default or Custom.  This will be addressed in a future release.  One work around would be to use the following code:

with QuickRep1 do

begin

  {Get the current paper size from the default printer and set the report to use it}

  with TQRPrinter.Create do

  begin

    Printerindex := -1;

    QuickRep1.Page.PaperSize := PaperSize;

    Free;

  end;

  Page.Orientation := poLandscape;

  Preview;

end;


QRQA139
Q:

When I use the Apollo driver to access a Foxpro table and I can not preview reports that use QRDBText controls with MEMO fields.

A:

It has been reported to use that if you have the Apollo driver configured so that the BDE can also be used, you can get this problem. Setting the Apollo driver so that it's the only driver has been reported to fix this problem.


QRQA140
Q:

Every time I preview a report, I lose memory.

A:

There are a few things that could cause this.  Older versions of QuickReport did have some memory leaks, you should be using version 2.0J or newer.  If you are using a custom preview, make sure that you are freeing the form in the preview form's OnClose event.  If you set the close action to caFree, the form will not be actually freed until the application has terminated.

We have had many reports of cumulative memory losses when using HP DeskJet drivers.  This is a problem with the printer driver, not with Quick Report. If you are using one of these drivers, you should get the latest driver for your printer from HP's web site.  Switching the printer driver to another printer (make sure it's a very different kind of printer) is an easy to test if your printer driver is causing the problem.


QRQA141
Q:

I have two forms, Form1 contains a TTable, Form2 contains a TQuickRep. Form2 includes Form1 in its uses clause. I place a TQRExpr on the report, and open up the Expression property editor by clicking ellipsis. The table in Form1 cannot be viewed/selected in this editor.

A:

You will need to use the report's AllDataSets property to add datasets from other forms.  This is documented in the manual under the "AllDatatSets" topic.  Please note that you should use the AllDataSets's Add method in the report's BeforePrint event.


QRQA142
Q:

Is there any way to perform "Hide Duplicates" for some repeated data item in a report?

A:

You would have to store the previous field value in a variable and compare the current field against it.  You would reset the variable in the report's BeforePrint event and compare the variable against the current dataset field in the control's OnPrint event.

Example:

  LastVar is defined as string the form's public section

procedure TfrmSub2.QuickRep1BeforePrint(Sender: TQuickRep;

  var PrintReport: Boolean);

begin

  { Clear our variable }

  LastVar := '';

end;

procedure TfrmSub2.QRDBText5Print(sender: TObject; var Value: string);

begin

  {

  If this field is same as the last one, then we clear it. If it's new

    we set our variable to that field and let this one print

  }

  if Value = LastVar then

    Value := ''

  else

    LastVar := Value;

end;


QRQA143
Q:

Using QR2 and trying to call addprintable in the beforeprint event of a band causes a GPF (or an Access Violation). Is this not allowed for some reason?

A:

You can only call AddPrintable or otherwise add a control to a report band before you start the report.  QuickReport needs to know about all printable controls before it starts the report.

Q. If I print a invoice with two lines at the bottom of a page, I have this problem. The  pagefooter is necessary because the lines of Subdetail prints at bottom of the page. The first page is Ok. On the second page, the last page of invoice, in GroupfooterBand1Beforeprint I have

QRFooterband.enabled := false;

QuickRep1.ResetPageFooterSize ;

The pagefooter doesn't print, but Groupfooterband does not align to bottom.

A:

If you call this code from the group footer's BeforePrint event, it is too late, it's print position has already been set.  What will work is if you that code in the PageHeader's BeforePrint event.  If you are not using a PageHeader band, add an empty one to do this code and then set PrintBand to false to suppress the output of the PageHeader.


QRQA144
Q:

Why does QuickReport change my detailband's Size.Height property from 33.0 to 33.07 after I preview a report?

A:

Try setting the report's SnapToGrid property to false, that should keep the band from resizing.  The Delphi IDE will also round certain values, if you set the value to a slightly smaller value, it should round up to the correct value.  If the rounding error is really throwing your report off, you can always set the value at runtime and it will not get rounded.


QRQA145
Q:

How can I convert from pixels to the measurement unit used by the QRPrinter object to be able to print to the screen or printer?

A:

QRPrinter.XSize(aNumber * ParentReport.TextWidth(Font,'W')) should do the trick.


QRQA146
Q:

My shapes print out thinner than they appear in the preview

A:

This is a known issue that we are researching.  A user sent in the following work around: I can get the thick line by changing then shape to qrsrectangle with a width of 2 and change the brush color to clblack.


QRQA147
Q:

In my report I want to print a blank line every between every 5 lines with data, to make it easier to read. How can I do that?

A:

On every 5th record, double the height of the detail band in the BeforePrint event. In the AfterPrint event, reset it back to normal.


QRQA148
Q:

How can I make a row wider than 1 page.

A:

This is not currently supported.  One alternative would be to use multiple subdetail bands and run through the data set a couple of times, for each set of columns.  Let say that you have 20 columns and only 10 will fit on the width of a page.  Leave out the detail band and set PrintIfEmpty to true.  Set each subdetail band to the same dataset and put different columns each.  Each subdetail will print all of the records but with different columns.  You will need to call the dataset's first method after each subdetail set has been executed.


QRQA149
Q:

Can you tell me how I can view the non-continuous rows in a DBGRid by using QuickReport? I set dgMultiSelect from TDBGrid to True, and I select some records in non-continuous order, then ...?

A:

You'll need to use the QuickReport OnNeedData event (it's in the manual) to pull data from a DBGrid.  In the OnNeedData event, try the following code:

MoreData := DBGrid.SelectedRows.CurrentRowSelected;

Another method would be populate a temporary table with the selected rows and have the report work with the temporary table.


QRQA150
Q:

How can I put a blank page in front of a report.

A:

Put a blank title band on the report and call the report's NewPage method in the title band's AfterPrint event.


QRQA151
Q:

How do I print a text file as a report?

A:

There are several ways to do this.  The qrprntr example project in the \quickrep\demos\qrprntr directory prints a text file using the TQRPrintJob class.  You could use a single detailband and read the text file into a QRMemo, just make sure to set PrintIfEmpty to true.  Or you could use the OnNeedData event and read the file line by line and set a qrlabel.caption on the detail band to the current line.


QRQA153
Q:

I am having trouble with the QRChart control.

A:

This control is a QuickReport compatible component written by Tee-Mach.  Please contact them at http://www.teemach.com/ for all QRCHart support questions.


QRQA154
Q:

I'm having trouble placing controls at precise locations when the I have the report set to 50% zoom

A:

You should keep the zoom value at 100% when adding controls to a form, otherwise you will not be able to have precise control over the placement of the controls.


QRQA155
Q:

What is the difference between the global QRPrinter, the preview's qrprinter, and the report's, qrprinter?

A:

Each report has it's own QRPrinter object.  There is a global QRPrinter object that can be used outside of the QuickRep object.  Each QRPrinter is a distinct object.

The Preview's QRPrinter object is just a pointer to the QRPrinter of the report using that preview.  When you reference the preview's qrprinter, you actually referencing the qrprinter object of the report currently being previewed.


QRQA156
Q:

How do I print out text rotated at an angle?

A:

BitSoft Development, L.L.C, has shareware control called QrRotateLabel and you can download it from http://www.bitsoft.com

Another control can be found on the Delphi Super Page (http://sunsite.icm.edu.pl/delphi/)


QRQA157
Q:

How can I to begin a report (QR) with current record and then continue from that record?

A:

QuickReport starts with the first record of the dataset, you will need to have the dataset return a set of records starting with the one that you want to start with.  If using the TQuery, use the WHERE clause of it's SQL property to specify the starting record.  With TTable, you can use it's filter properties (Delphi 2 or higher).

Another way would be to use the OnNeedData event to navigate through the dataset, this would work, but would require more code than limiting the dataset through their own properties

QuickReport 2 really doesn't have a direct way of filtering by record count.  One thing that you could do is to use the BeforePrint event of the detail band and set the PrintBand boolean to true for the records that you want to print.  If you add two global integers to the report form like "FirstRec" and "LastRec", you could control it that way.  I would initialize them to 0 and only check them when they were greater than 0 like the following:

procedure TfrmQR.DetailBand1BeforePrint(Sender: TQRCustomBand;

  var PrintBand: Boolean);

begin

  with frmQR do

  begin

    if FirstRec > 0 then

       PrintBand := QuickRep1.RecordCount >= FirstRec;

    if PrintBand then

      if LastRec > 0 then

        PrintBand := QuickRep1.RecordCount <= LastRec;

  end;

end;

This has NOT been tested, you may have to modify it to get it to work


QRQA158
Q:

How do I do duplex margins?

A:

QuickReport does not have the built in ability to do duplex margins.  You should be able to do this by changing the margins in the AfterPrint event of the page footer band.


QRQA159
Q:

How do I keep the preview from rebuilding the report when I print?

A:

When you print from the preview, the report is rendered again.  The reason is the preview is rendered to a metafile, and the output looks better if it's directly rendered to the printer canvas.  You can override this behavior, when you print a previously saved report, the preview metafile is sent to the printer.

Set the OnGenerateToPrint event of the report's qrprinter object to nil.  This will force the report to not render the report a second time.

Example:

procedure Tfrmqr.QuickRep1BeforePrint(Sender: TQuickRep; var PrintReport: boolean);

begin

  QuickRep1.qrprinter.OnGenerateToPrinter := nil;

end;


QRQA160
Q:

My report works under 95 but not under NT

A:

When the report crashes at 25 to 50 pages and the OS is NT, then the problem is usually file permissions based.  QR2 renders the report to a temporary file if it can't do it in RAM.  QuickReport calls the Delphi GetTempPath() and GetTempFileName() functions to build the filename.  These functions check directories specified by the TMP, and TEMP variables, and they fail, the current directory.  If the user does not have sufficient access to create a temporary file, then an error will occur.


QRQA161
Q:

How do I do a title page?

A:

For single column reports add a title band and call the report's NewColumn method from the title band's AfterPrint event.

A:

For multiple column reports, add a title band and set it's height so that no other band will fit on it's page.  One way would be to use the report's BeforePrint event to set the titleband.size.height property

The following assumes a page header and footer band...

procedure TfrmQR.QuickRep1BeforePrint(Sender: TQuickRep;

  var PrintReport: Boolean);

begin

  with QuickRep1.Page do

    titleband1.size.height := Length - TopMargin -

      BottomMargin - PageHeaderBand1.Size.Height - PageFooterBand1.Size.Height;

end;

Q. I can't get AddPrintable to work

A. The Addprintable does not work the way the manual states it will.

The following won’t compile:

  with DetailBand1.AddPrintable(TQRDBText) do

  begin

    DataField := 'Test';

While this will:

  with TQRDBText(DetailBand1.AddPrintable(TQRDBText)) do

  begin

    DataField := 'Test';


QRQA162
Q:

Is there a maximum length/size of a report?

A:

There are no limits on the size of report that can be printed. Preview is limited by the amount of free disk space, however disk usage can be significantly reduced by enabling QuickReport's internal compression.


QRQA163
Q:

There is a mention of qrsPageCount and QuickReport.Options.TwoPass in the documentation. Are these available yet?

A:

There are references to qrsPageCount and QuickReport.Options.TwoPass in the documentation.  Unfortunately this feature was not completed in time for the 2.0 release.


QRQA164
Q:

How can I build a report with data that doesn't come from a BDE table or query?

A:

QuickReport was designed to work with BDE datasources, but it can use data from other sources via the OnNeedData events.  Please see the manual topic for OnNeedData for more information.


QRQA165
Q:

How do I print only the current record of the dataset?

A:

To print the current record, clear the DataSet property of the report and set the report's PrintIfEmpty property to True.


QRQA166
Q:

I define multiple TQRlabels on a page.  I can not find the end of the qrlabel.caption to figure out where to start the next qrlabel.

A:

If you use the size properties, this should be easy to do.  If you have two labels, qrlabel1 and qrlabel2, then you would use the following syntax:

qrlabel2.Size.Left := qrlabel1.Size.Left + qrlabel1.Size.Width after you have set the caption properties.


QRQA167
Q:

Quickreports seems to leave a trail of files of the form QRPDxxx.TMP in the windows temp directory.  Is this a result of normal operation, crash or aborted preview?

A:

These files are created when you preview a report and are deleted when the preview exits.  If your report crashes or is terminated by the IDE, these files will not be removed.  You can safely delete these files at any time.


QRQA168
Q:

I get the error "Metafile is not valid" when I preview a very simple but large report (2,500,000 lines). The same report with a smaller data table runs OK.  Why do I get this error?

A:

Are you running out of disk space?  QR renders the report to a temporary file and you will get that error message if you are running out of room.  Try setting the report's Options.Compression property to true and see if the report will run.


QRQA169
Q:

I have an invoice form. If in the form can't put all the details records in one page, and it must go to the next page, I must put a message in the bottom of the form saying something like this " continued on the next page..." or "carried forward ...".  Which is the best solution for this?

A:

There are a few ways to do this.  One way would be to use a summary band with height set to zero and TQRLabel on the page footer that has the text " continued on the next page...".  In the AfterPrint event of the summary band, set the caption of the TQRLabel to ''.  If the summary band prints on the first page, the label will be cleared, if it gets called on the next page, the first page will print the label.


QRQA170
Q:

How can I do subscripts for chemical formulas?

A:

You would have to use a TQRRichText or a TQRDBRichText control and insert the RTF codes to the text effect.  If you are not familiar with the RTF format codes, an easy way to get the codes is to type the text in MS Word with the formatting and save the file out as a RTF file.


QRQA171
Q:

I tried using the OnPrint event to change the font style but it does not respond.  Will it show up in the preview, or do I have to compile and run the report from Delphi?

A:

Any code that you put in an event handler will only be executed at runtime.


QRQA172
Q:

I have a report with just a page header and a title band.  The title band has a memo control that can span multiple pages.  When it does span a page, the text in the memo starts getting chopped up the closer you get to the bottom of the page.  What is wrong?

A:

The report will not work properly without a detail band.  It was designed around it and leaving it out will have odd side effects like the one that you described.  The work around is to add an empty detail band (no controls with it's height set to 0) and the report should print normally.


QRQA173
Q:

Are there any year 2000 issues with QuickReport?

A:

Year 2000 Compliance (Y2K)

This question does not apply to QuickReports.  If the programmer writes his application to be Y2K compliant, then his reports will be Y2K compliant.

All date and time calculations are done using TDateTime fields.  If the data supplied to the is Y2K compliant, then the calculations will be Y2K compliant.

All date and time fields are displayed with the format masks defined by the programmer.  Date format masks that are not defined by the programmer will use the default values supplied by Delphi from Windows.

Additional information about Delphi Y2K compliance can be found at http://www.inprise.com/devsupport/y2000/


QRQA174
Q:

The graphics mode of my dot matrix mode is too slow, so I'd like to know if there is another way to print using the text format of the printer.  I must print using the standard size and the compressed size of the fonts as we used to do in the DOS environment...

A:

QuickReport was not designed to do that kind of printing, you will need to be able to set your printer driver that way and I do not have any information on that.

An alternative means would be to use the ASCII export filter to send the report to a text file and then copy that file to the printer.  To set any printer and/or font properties, you would have to edit the text file and insert the characters or use a similar method.


QRQA175
Q:

When I create multi-column report, second, third etc. columns overwrite children of the title band.

A:

This is a known bug with QuickReport 2.  One work around be to use a pageheader band with child bands.  Since the page header prints after the title, you would put the actual page header information on the last child band and use the preceding page header (and children) for the title information.  In  the BeforePrint events for the bands, you would set PrintBand to false when the page number was greater than 1.

(QR3) This has been fixed with QuickReport 3


QRQA176
Q:

I have a multiple column report where I want to have two groups, one that forces a page break, and one that forces a column break.  I can set this just fine.  But what happens is when I get the page break, the data prints in the second column of the report and the first column is blank.  Is there a way to suppress the column break after a page break?

A:

What you need to do is to set the 2nd group's ForceNewColumn property to false the first time the group is printed on each page.  Then set it back to true to handle the reset of the page.  Set the property to false in the report's OnStartPage event, which gets called at the start of each page.  In the AfterPrint event of the group band, set the property to True so it will work the next time it's called on that page.


QRQA177
Q:

I am interested in adding the capability of generating mailing labels to my current application.  I could not find any information about mail labels in your documentation.

A:

Doing labels is pretty straight forward.  You set the detailband's height or Size.Height properties to fit the height of your labels and then set the report's Page.Columns property to the number of labels that would go across the page.  You may need to adjust the top and bottom margins of the page to fit your labels.


QRQA178
Q:

Is there a way to make QReports print columns Left to Right - Top to Bottom instead of Top to Bottom - Left to Right?

A:

This is scheduled for the QuickReport 3.0 release.


QRQA179
Q:

When I do a multiple column report, the detail bands print on the same line as the group bands

A:

Group bands are the same width as the detail bands and since the columns go down then across, it is possible to have detail bands at the same vertical position (different horizontal position) as group band.  If you want column headers to stay above the detail bands, use the page header to store the header fields.


QRQA180
Q:

I have a multiple column report that uses subdetail bands but doesn't have a detail band.  I get an exception in the TQRCustomBand.GetBandSize function when I try to run the report.

A:

You must have a detail band for multiple column reports.  This is a known bug and will be addressed in a future release.  If your report does not require a detail band, then just set it's height to 0.


QRQA181
Q:

If the QuickReport.Page.TopMargin is to small then the Top of the QuickReport is not be printed.  QuickReport should tell the user that the QuickReport is out of printable range

A:

This is being considered for a future release.


QRQA182
Q:

How do I set the paper size?

A:

For detailed information about setting the paper size, please refer to the section on Paper size and Margins (page 2-21) in the QuickReport 2 manual. This manual comes with QuickReport under the filename qr2.doc.


QRQA183
Q:

How do I determine the default paper size of the selected printer?

A:

The following code checks the printer to see what paper size is the default.

with TQRPrinter.Create do

begin

  PrinterIndex := QuickRep1.PrinterSettings.PrinterIndex;

  { for the default printer use the following line }

  PrinterIndex := -1;

  QuickRep1.Page.PaperSize := Papersize;

  free;

end;


QRQA184
Q:

How can I implement a modal preview? The standard preview isn't modal, when the user make it smaller and click on another form the preview form is hidden. Is there a way to show the preview modal?

A:

Quickreport 2 requires a non-modal preview form to allow the report to process the data.

What you can do is use a custom preview and set it's form style to fsStayOnTop, that would keep the users in the preview until they close it.

(QR3) QuickReport 3 (3.0.1 or newer) has some additional preview methods, PreviewModal and PreviewModeless.  These two methods run in a thread and can not be used with non-thread safe database drivers (like SQL Links).


QRQA185
Q:

Is it possible to set preview "Fit To Page" as default when opening the preview of a report ?

A:

You can modify the source code for the default preview, or build a custom preview that has this behavior.  We have a sample project for custom previews on our download page that shows how to specify the starting zoom setting for the preview.


QRQA186
Q:

When repeatedly previewing a report and closing BEFORE the first page is displayed, there is a access violation.

A:

If you are using a custom preview, you must make sure that you have set the qrpreview's qrprinter property to nil when you close the preview.  If you are repeatedly calling preview or print, you may to add code to check the report's state property.  When it's set to qrAvailable (defined in quickrep.pas), then the report is safe to call.


QRQA187
Q:

Can I preview only selected pages?

A:

There isn't any easy way to preview a range of pages.  As each page is rendered, the preview is notified that the page is now available.  You could have to modify the report to stop after a certain page, but there isn't any way to tell the preview to start at a specific page.


QRQA188
Q:

Why doesn't the printersetup button work from the preview when I load a saved report?

A:

This is actually a design feature.  When the orientation or paper size was changed, the result was poor output from the saved repots so this functionality was removed from the default preview.  If you build a custom preview, you can use the printersetup on saved reports.  An example project with a custom preview with functionality can be downloaded from our download page under the filename custprev.zip


QRQA189
Q:

We've a problem with QRPrinter.PageCount. We've created our own Previewform and when we call QRPrinter.PageCount we always get 0. What's wrong??

A:

You need to specify the preview's qrprinter, otherwise the global qrprinter will be used.  Also, the total page count is not known when the preview is first shown, you must use the preview's OnPageAvailable to update the page count as each page is rendered.

Example:

procedure TfrmPreview.QRPreviewPageAvailable(Sender: TObject;

  PageNum: Integer);

begin

  if PageNum = 1 then

    Caption := QRPreview.QRPrinter.Title + ' - 1 page'

  else

    Caption := QRPreview.QRPrinter.Title + ' - ' + IntToStr(PageNum) + ' pages';

  case QRPreview.QRPrinter.Status of

    mpReady: Caption := Caption + ' READY';

    mpBusy: Caption := Caption + ' BUSY';

    mpFinished: Caption := Caption + ' FINISHED';

  end;

end;


QRQA190
Q:

If I change the Paper Size in the Printer Setup of the preview, the report does not reflect the size selected.

A:

This is a known issue and will be addressed in a future release.  The work around would be to provide a selection of available page sizes to user before you run the report and the set the report's Page.PaperSize property to paper selected.


QRQA191
Q:

My custom preview does not use the zoom value that I set at design time, how do I get it to start up with the value that I want?

A:

When the QRPreview is created, it defaults with a zoom value of 100, you'll need to set the value after you create the QRPreview.


QRQA192
Q:

How can I augment the preview's print function to display a dialog box after the report prints?

A:

The default preview wont let you do this, but if you create a custom preview for your report, you can call the dialog after printing.

An example print button event could look like this:

procedure TfrmPreview.PrintClick(Sender: TObject);

begin

  Print.Enabled := False;

  QRPreview.qrprinter.Print;

  Print.Enabled := True;

  MessageDlg('Did we print?', mtconfirmation, [mbOk], 0);

end;


QRQA193
Q:

How can I determine the number of pages in my report before I preview or print it?

A:

If you call the report's Prepare method, it will generate the report without printing or previewing it.  After Prepare has finished, the pagecount will be in the report's qrprinter.pagecount property.  Please refer to the manual topic on Prepare for more information.

Example:

    QuickRep1.Prepare;

    QuickRep1.ReportTitle := 'This report has ' +

      IntToStr(QuickRep1.QRPrinter.PageCount) + ' pages';

    QuickRep1.QRPrinter.Free;

    QuickRep1.QRPrinter := nil;

    QuickRep1.Preview;


QRQA194
Q:

How can I have my custom preview print a range of pages without going through the printersetup dialog?

A:

What you need to do is to add a public property of your preview form of type TQuickRep like the following:

type

  TfrmPreview = class(TForm)

    QRPreview: TQRPreview;

    .....

  public

    { Public declarations }

    CurrentReport : TQuickRep;

  end;

In the OnPreview event of the report, you would use something like:

procedure TfrmMyReport.QuickRep1Preview(Sender: TObject);

begin

  with frmPreview do

  begin

    CurrentReport := QuickRep1;

    QRPreview.QRPrinter := TQRPrinter(Sender);

    Show;

  end

end;

That lets you reference the calling report through the preview's CurrentReport variable.  Then to print out a range of pages with out going through the printer setup, you would do something like the following:

  with CurrentReport.PrinterSettings do

  begin

    { To set your own printer }

    PrinterIndex := MyDesignatedPrinterIndex;

{ set the page range }

    FirstPage := MyDesignatedFirstPage;

    LastPage := MyDesignatedLastPage;

  end;

  QRPreview.qrprinter.Print;


QRQA195
Q:

I can't get the cursor to display as an hourglass during custom preview processing.

A:

This is a known issue and will be addressed in a future release


QRQA196
Q:

I am using custom preview and want to know if there is an easy way to know when the report is done being generated?

A:

When the report is done, the preview's qrprinter.status property will be set to mpFinished.  The following code will display the title, total pages, and status as the preview caption when used as the preview's OnPageAvailable event.

procedure TfrmPreview.QRPreviewPageAvailable(Sender: TObject;

  PageNum: Integer);

begin

  if PageNum = 1 then

    Caption := QRPreview.QRPrinter.Title + ' - 1 page'

  else

    Caption := QRPreview.QRPrinter.Title + ' - ' +

     IntToStr(PageNum) + ' pages';

  case QRPreview.QRPrinter.Status of

    mpReady: Caption := Caption + ' READY';

    mpBusy: Caption := Caption + ' BUSY';

    mpFinished: Caption := Caption + ' FINISHED'; { <-- all done }

  end;

end;


QRQA197
Q:

Why in report preview mode, does the CPU usage for the quick-reports application go to 100%

A:

This was a known issue and was addressed in the 2.0j release.


QRQA198
Q:

My custom preview doesn't work the way it did with QR1

A:

The preview must be called with Show instead of ShowModal.  This a change from the QuickReport 1 behavior, but is required for QuickReport 2.  We are considering adding a modal preview for QuickReport 3.0


QRQA199
Q:

Why wont the progress bar work properly with non-BDE reports?

A:

QuickReport 2 checks the TTable or TQuery for the current record number and the total number of records.  These two values are used for displaying the progress bar percentage.  SQL based queries and non-BDE data have no way of telling QR2 what the total number of records is, which is why the progress bar does not update for those kinds of reports


QRQA200
Q:

Some computers do not display a report and others work fine.

A:

We have seen that happen on machines that do not have a default printer defined.  Without a default printer, QR has no way of knowing how to render the report.


QRQA201
Q:

When the preview method of a report is called, it looks like the report is being painted twice and there is some flicker

When a form is created the event handlers are executed in the following order:

   OnCreate   OnShow   OnPaint   OnActivate   OnResize   OnPaint again

A:

This is a known issue and will be addressed with a future release.


QRQA202
Q:

In QR1, I could disable/hide the save, print and load report speed buttons in the preview. Is this no longer an option?

A:

This is not an option with QuickReport 2.  You would have to create a custom preview and build it with only the functionality that you require for your application.


QRQA203
Q:

Some lines do not appear in the preview, but they appear in the printout.

A:

The report is rendered to a TMetafile object when it is sent to the preview.  Depending on the zoom value of the preview, the scaling of the TMetafile may crop out some of the lines.  If you zoom in (you may need to use a custom preview to zoom in close enough), the lines will reappear.


QRQA204
Q:

How can I tell in BeforePrint if I am Printing or Previewing?

A:

In the report's BeforePrint event, you can check the value of the report's QRPrinter.Destination property.  If it's set to qrdMetafile, then it's rendering the preview.  If it's set to qrdPrinter, then it's rendering the report directly to the printer.  This only works when you are generating a report, if you load a saved report, the destination will always be qrdMetafile.


QRQA205
Q:

Is there a way to tell QuickReport that when you generate a preview, you only want the preview to span a certain number of pages or have a starting/ending page number?

A:

You can't tell the preview to start at a specific page, but you can get it to stop after a specified number of pages.  You can use the OnEndPage event (documented in the manual) to get the report to stop processing after the specified number of pages.  If you do this an extra blank page will be generated, there isn't much you can do to get around that.  The following example shows how to stop the preview after only 32 pages without affecting the number pages when you print from the preview:

procedure TfrmSomeReport.QuickRep1EndPage(Sender: TQuickRep);

var

  nIdx: integer;

begin

  {

  This code will only take affect when previewing, you will need to

  add qrprntr to the uses clause.

  }

  if QuickRep1.QRPrinter.Destination = qrdMetafile then

    if QuickRep1.PageNumber = 2 then

    begin

      {

      Disable the printing of all bands, requires 2.0J or later.

      If you do this, remember to renable the bands in the reports

      BeforePrint event the next time you run the report.

      }

      for nIdx := 0 to QuickRep1.BandList.Count - 1 do

        TQRCustomBand(QuickRep1.BandList[nIdx]).Enabled := false;

      {

      Tell the report that we are done reading data.

      }

      QuickRep1.qrprinter.cancel;

    end;

end;

Make sure to have the following code in the report's preview to re-enable the bands again.

procedure TfrmSomeReport.QuickRep1BeforePrint(Sender: TQuickRep;

  var PrintReport: Boolean);

var

  nIdx: integer;

begin

  for nIdx := 0 to QuickRep1.BandList.Count - 1 do

    TQRCustomBand(QuickRep1.BandList[nIdx]).Enabled := true;

end;


QRQA206
Q:

I get a printer error when I print a range of pages.

A:

There is a known problem where a range of pages will cause an error when you have controls that cause a band to stretch.  The length of a band that stretches is not known until the band is actually printed.  If pages are skipped, the page count is off and report throws an error.  This will be addressed in a future release.


QRQA207
Q:

I am setting the control's font to Arial but it is printing as Courier (or vice versa).

A:

Check the control's Font.Pitch property.  If you select Arial and set the pitch to fpFixed, Windows will substitute the closest match that supports that pitch.


QRQA208
Q:

I can't get the Bin Selection for quick reports to work. No matter what I try, everything goes to the same bin. How do you select output bins?

A:

You should be setting the report's PrinterSettings.Outputbin property to the bin that you want to use.  Only the bins listed on the manual page for the outputbin property (5-121) can be selected.  Device specific bins are not supported at this time.  If the printer's default bin is a device specific bin, you may have to set to another bin in order for QR2 to be able to select a bin.


QRQA209
Q:

I am trying to layout my report to print using the Generic/Text Only driver, but I am having trouble getting the text to line up and blank lines get inserted into the printout.

A:

This is what I do when I am designing a report for the Generic/Text only driver.

Set the report units to Characters.

Set the report font to 'Courier New' and the size to 10.

Set the height of the band to slightly less than the height of the text controls.  The default height of the QRDBText control is 17 when I use these settings.  I set the detailband height to 16.  This should eliminate any extra blank lines from the output.


QRQA210
Q:

I don't see the progress window during the print when I use:

myreport.quickrep1.Prepare;

myreport.quickrep1.QRPrinter.Print;

myreport.quickrep1.QRPrinter.Free;

myreport.quickrep1.QRPrinter := nil;

How do I enable the progress window using the above code?

A:

The progress windows is not applicable to that method as the report is not being generated at print time.  The report was rendered to a metafile with the prepare method and the print method is just copying the metafile to the printer.


QRQA211
Q:

I'm getting a 'Printer is not currently printing' error when I try to print a report, I have not been able to find a reason for this, it only happens with certain reports. (Others print without problems)

A:

Check the report.printersettings.FirstPage and the report.printersettings.LastPage properties.  If they are set to values outside of the number of actual pages in the report, you will get this error at runtime.


QRQA212
Q:

The printout doesn't match the preview exactly.

A:

We use Windows API calls to get the font height and width information back and some fonts do not return the correct information.


QRQA213
Q:

I have a report that prints fine on a HPIII printer but not on the HP4.  Either the text is missing, or the bands print black.

A:

There have been many reports of problems with the HP4 (and Hp5) printers.  You should make sure that you are using the current driver from HP's web site.  You may also need to check the page protect option in the printer driver and/or set the DPI to 300.


QRQA214
Q:

The output from preview is correct, but printing from the preview does not print all of the data.

A:

If the problem is only when you print from a preview, then you will need to reset your data (datasets and/or variables) in the BeforePrint event of the QuickReport.  This event gets called whenever the report needs to be generated.

When the report is regenerated, sometimes you will have to reset your dataset.  One example is if the dataset has a memo and you are connected to a SQL database server like Oracle.  The problem seems to be in the BDE's BLOB caching.

Another situation would be if you are using OnNeedData and that event is controlled by a variable that needs to be initialized at the start of the report.


QRQA215
Q:

How can I tell how the user exits the report's PrinterSetup method?  It does not pass back the status.

A:

You can test the value of report's tag property (with version 2.J or newer) after calling PrinterSetup and if it's 1, then they selected OK.

Many users have asked for the ability to print automatically if the user selects OK from PrinterSetup.  You would code that like this:

  with frmReport.quickrep1 do

  begin

    PrinterSetup;

    if tag = 0 then

      print;

  end;

To do this in the preview will require using a custom preview and passing in a reference to the calling report to the preview.  That will allow you to call PrinterSetup and be able to check the tag value.  We have a sample preview that does this and it is available upon request.


QRQA216
Q:

How can I check to see if the user cancelled the printing of a report?

A:

You can use the AfterPrint of the report to set a flag as it will only get called if the report prints to completion.

A:

(QR3) The report has a Cancelled property that gets set to True if the user cancels a report.


QRQA217
Q:

How do I determine the paper size of the printer at runtime?

A:

If you use the following code before you call your report, you can specify the default size:

with TQRPrinter.Create do

begin

  Printerindex := -1;

  QuickRep1.Page.PaperSize := PaperSize;

  Free;

end;

This assumes that you are using the default printer and your report is named QuickRep1.


QRQA218
Q:

After calling QuickRep.PrinterSetup to pick a specific printer, what's the best way to get the name of the printer that was just chosen?

A:

The printerindex is stored in the report's printersettings.printerindex property.  The following example will set the form's caption to the current printer for the selected report:

  with TfrmReport.Create(Application) do

  begin

    QuickRep1.PrinterSetup;

    self.caption := printer.printers[QuickRep1.printersettings.printerindex];

    QuickRep1.Preview;

    Free;

  end;


QRQA219
Q:

I can not get the PrintBackground to work. In the preview sample I added a menu with the code:

procedure TMain.PrintBackground1Click(Sender: TObject);

var

  aForm : TReport1Form;

begin

  Application.CreateForm(TReport1Form, aForm);

  aForm.QuickRep1.PrintBackground;

  aForm.Free;

end;

When the PrintBackground method is called an exception is raised.

A:

You are freeing the report while it is printing in the background.  You can't free the report until it has finished printing.  The following example creates a report, calls PrintBackground, and then waits until it has finished before freeing the report:

Application.CreateForm(TfrmGroupTest, frmGroupTest);

with frmGroupTest do

begin

  QuickRep1.PrintBackground;

  while QuickRep1.QRPrinter.Status <> mpBusy do

    Application.HandleMessage;

  while QuickRep1.Available = False do

    Application.HandleMessage;

  Free;

end;


QRQA220
Q:

We have an application, that prints a form developed in QR 2.0i. During development we used a LEXMARK printer an everything worked fine. But our customer have another printer a Kyocera, on that printer the print doesn’t work.

A:

One thing to look at is how complicated your form is and how much memory is in each printer.  QuickReport renders each page to the printer canvas supplied by the printer driver.  If the printer resolution is set too high and it doesn't have enough ram to render the entire page, you will get garbled or missing output, depending on the printer and/or driver.  One way to verify that this is the problem would be to lower the printer's resolution through it's driver and then try to print the report.


QRQA221
Q:

I'm trying to write a report that gets printed to the windows generic text-only printer driver.  Some lines move around when it is actually printed.  Do you have any ideas?

A:

Try setting the report's font to "Courier New" at size 10.  Then set the height of the band to 16 and if that cleans up the output.  To save paper while testing this, set the printer driver's destination to "FILE:"


QRQA222
Q:

How can I send control chars to the printer with Quickreport?

A:

QuickReport uses the Windows printer GDI calls to output data, it does not support sending escape codes directly to the printer.  You could use the ASCII text export filter to save the report as text.  You would then insert your printer escape sequences into that file and then copy that file to printer port.


QRQA223
Q:

I can't set the printer at runtime, I get an exception if I use the following syntax:

Quickrep1.Printersettings.printerindex:=Quickrep1.printer.printers.Indexof('HP LaserJet 4 on LPT1:');

A:

QuickReport does not create it's printer until it needs it, you'll need to use a regular printer object that Delphi will initialize for you. the following code will work:

Quickrep1.Printersettings.printerindex:=printer.printers.Indexof('HP LaserJet 4 on LPT1:');


QRQA224
Q:

How can let the users select the printer before running the report?

A:

If you call the Report's PrinterSetup method, this will set the printer settings for the report before you run it.  You could do it like:

  with frmReport do

  begin

    QuickRep1.PrinterSetup;

    QuickRep1.Preview;

  end;


QRQA225
Q:

I can not get the PrintBackground to work. In the preview sample I added a menu with the code:

procedure TMain.PrintBackground1Click(Sender: TObject);

var

  aForm : TReport1Form;

begin

  Application.CreateForm(TReport1Form, aForm);

  aForm.QuickRep1.PrintBackground;

  aForm.Free;

end;

When the PrintBackground method is called an exception is raised.

A:

You are freeing the report while it is printing in the background.  You can't free the report until it has finished printing.  The following example creates a report, calls PrintBackground, and then waits until it has finished before freeing the report:

Application.CreateForm(TfrmGroupTest, frmGroupTest);

with frmGroupTest do

begin

  QuickRep1.PrintBackground;

  while QuickRep1.QRPrinter.Status <> mpBusy do

    Application.HandleMessage;

  while QuickRep1.Available = False do

    Application.HandleMessage;

  Free;

end;


QRQA226
Q:

We have an application, that prints a form developed in QR 2.0i. During development we used a LEXMARK printer an everything worked fine. But our customer have another printer a Kyocera, on that printer the print doesn’t work.

A:

One thing to look at is how complicated your form is and how much memory is in each printer.  QuickReport renders each page to the printer canvas supplied by the printer driver.  If the printer resolution is set too high and it doesn't have enough ram to render the entire page, you will get garbled or missing output, depending on the printer and/or driver.  One way to verify that this is the problem would be to lower the printer's resolution through it's driver and then try to print the report.


QRQA227
Q:

I'm trying to write a report that gets printed to the windows generic text-only printer driver.  Some lines move around when it is actually printed.  Do you have any ideas?

A:

Try setting the report's font to "Courier New" at size 10.  Then set the height of the band to 16 and if that cleans up the output.  To save paper while testing this, set the printer driver's destination to "FILE:"


QRQA228
Q:

How can I send control chars to the printer with Quickreport?

A:

QuickReport uses the Windows printer GDI calls to output data, it does not support sending escape codes directly to the printer.  You could use the ASCII text export filter to save the report as text.  You would then insert your printer escape sequences into that file and then copy that file to printer port.


QRQA229
Q:

I can't set the printer at runtime, I get an exception if I use the following syntax:

Quickrep1.Printersettings.printerindex:=Quickrep1.printer.printers.Indexof('HP LaserJet 4 on LPT1:');

A:

QuickReport does not create it's printer until it needs it, you'll need to use a regular printer object that Delphi will initialize for you. the following code will work:

Quickrep1.Printersettings.printerindex:=printer.printers.Indexof('HP LaserJet 4 on LPT1:');


QRQA230
Q:

How can let the users select the printer before running the report?

A:

If you call the Report's PrinterSetup method, this will set the printer settings for the report before you run it.  You could do it like:

  with frmReport do

  begin

    QuickRep1.PrinterSetup;

    QuickRep1.Preview;

  end;


QRQA231
Q:

I retrieve the values of the Delphi PrinterSetupDialog and when I use the printerindex returned by it, I get the error: PRINTER INDEX OUT OF RANGE

A:

There is a bug in the Delphi printer setup dialog that causes it to create new instances of printers in the printer list. QuickReport 2.0i (and later) includes a fixed printer dialog in the qrprnsu unit. Please use that instead of Delphi's dialog.


QRQA232
Q:

When I change the printerindex, I can't select the right paper size.

A:

There is a problem in the printers unit where when the printerindex index is changed, the new printer "inherits" the properties of the previous printer.  With the 2.0j release, we now reset the printer driver when the printerindex is changed.


QRQA233
Q:

When I use Printer Settings from within QuickReport, it suggests me to write out all 10000 pages, even though my report contain only 10-15 or so...

A:

This is a cosmetic bug (the report will never print out anything past the last page) and this will be fixed with the 2.1 release.


QRQA234
Q:

I can't select a tray for HP printers

A:

The printer dialog QuickReport uses is a standard print setup dialog. QuickReport defaults to the Default tray defined in Windows. I believe the problem with some printer drivers (LJ5/6) is that they try to redefine the tray order. We will look for a solution to this for a later version.

One work around is to use the LaserJet III driver when printing with QuickReport.


QRQA235
Q:

How do I the printer properties if I use my own printersetup dialog box?

A:

Please see the TQuickRep.PrinterSetup method in quickrpt.pas for code showing how to set the printer to what was selected in the setup dialog.


QRQA236
Q:

I get an extra blank page when I print a range of pages.

A:

The extra blank page is a known issue and was addressed in the 2.0k release.


QRQA237
Q:

Why do the Properties QRPrinter.Canvas.TextHeight and TextWidth return always zero value when running in 16 bits?

A:

The QRprinter.Canvas is a standard metafile in Delphi 1 and a standard metafile doesn't support these functions. Enhanced metafiles in Delphi 2/3 does.


QRQA238
Q:

The report prints under Win95 but not under Win 3.1

A:

This is probably a printer driver problem even though they use the latest driver. A possible solution might be to try to blank the QRPrinter.OnGenerateToPrinter event to see if that helps.

A workaround is to clear the QuickRep.QRPrinter.OnGenerateToPrinter event, setting it to NIL when the preview is brought up. This will force QR to print the generated metafiles instead of generating the report all over directly to the printer. The down side is that you might experience a slight scaling of the report page and that images might have a lower resolution.


QRQA239
Q:

When I use printer fonts, the preview does not match the print out.

A:

A possible solution to this problem is to assign the printer specific font to your report at runtime. If you use the same font for all controls in your report you should be able to say

QuickRep.Font.Name := 'Your font name'

before starting your report. If Windows is able to a reasonably good substitution it should work.


QRQA240
Q:

When I use the QRPrinter object, the scaling is off

A:

There are some known problems with using the QRPrinter object in this way.  With the 2.0h release, we have added a new class, QRPrintJob, which is a wrapper for the QRPrinter object.  This code is in the \quickrep\demos\qrprntr directory and makes it easier to do code like what you sent in.


QRQA241
Q:

When i use the EPSON LQ-1070+ printer driver  the program closed, no error message

A:

There is a known problem with using QuickReport with printers that support more than 64 different page sizes.  This will be addressed in an upcoming release.  At the present time, there is no work around, short of using a generic Epson compatible printer driver.


QRQA242
Q:

When I print my reports under NT 4, the font changes are not working correctly.

A:

There is a known printing problem with Windows NT 4.0 when you have multiple font changes on the printer canvas.  Installing the Service Pack 3 to NT should solve the problem.


QRQA243
Q:

I get a exception error when running our application on a machine without a default printer.

A:

QuickReport requires that a default printer be installed.  The report is prepared using information from the printer driver.  The following code shows one way to check and see if a default printer has been defined.

procedure TfrmReport.btnReportClick(Sender: TObject);

var

  FDevice:     PChar;

  FDriver:     PChar;

  FPort:       PChar;

  FHandle:     THandle;

  CurrentPrinterName: string;

begin

  GetMem (FDevice, 255);

  GetMem (FDriver, 255);

  GetMem (FPort, 255);

  Printer.GetPrinter (FDevice, FDriver, FPort, FHandle);

  CurrentPrinterName := FDevice;

  if FDevice <> nil then FreeMem (FDevice, 255);

  if FDriver <> nil then FreeMem (FDriver, 255);

  if FPort <> nil then FreeMem (FPort, 255);

  if CurrentPrinterName <> '' then

    { Preview the report }

    QuickRep1.Preview

  else

    MessageDlg('You do not have a default printer defined.' +

               #13#13 + 'Please select a printer before running a report.',

               mtError,[mbOK],0);

end;


QRQA244
Q:

How do I print to a printer different than the Windows default printer?

A:

Set QuickRep.PrinterSettings.PrinterIndex to a value corresponding to the printer you want to print to. This value is the same as for the Delphi TPrinter.PrinterIndex. Set to -1 to print to the default printer again


QRQA245
Q:

I have some easy reports very simple ones (without graphics), but in a matrix printer they are printed very slowly. Is there a way to print them like the DOS programs did in PRINT, and TYPE filename.ext > PRN?

A:

QuickReport renders a report to the printer driver's canvas.  It doesn't really have a text mode for printing, rendering the pages is left completely up to the printer driver.  You can try using the "Generic / Text Only" printer driver that comes with Windows.  You may have to modify the fonts and/or control placement with the report to get satisfactory results with this driver.


QRQA246
Q:

I would set to specify a default printer to be used for multiple reports.

A:

You have to add the code to determine what the printerindex value is for the printer.  Then set the QuickRep1.PrinterSettings.PrinterIndex property to this value for each report before you call the print or preview methods


QRQA247
Q:

My report only prints one page, but the design-time preview shows all pages.

A:

Check the report's PrinterSettings.FirstPage and PrinterSettings.LastPage properties and make sure that they are set to 0.  If you print a range of pages from the design-time preview, these two fields may get set to the values that you had selected.


QRQA248
Q:

How can I print multiple copies of a report without having to generate it over and over again?

A:

You would set the report's PrinterSettings.Copies property to the value that you want.  Currently this property is not working for all printers, the 2.0k beta seems to work for some and we are working on the rest for the 2.0k final release.

Another way to print multiple copies is to use the prepare method instead of calling the print method directly.  For example:

Instead of:

  with TfrmQR.Create(Application) do

  begin

    QuickRep1.Print;

    free;

  end;

Try:

  with TfrmQR.Create(Application) do

  begin

    QuickRep1.Prepare;

    QuickRep1.QRPrinter.Print;  { print first copy }

    QuickRep1.QRPrinter.Print;  { print second copy }

    QuickRep1.QRPrinter.Free;

    QuickRep1.QRPrinter := nil;

    free;

  end;

This method generates the report to an internal metafile and then rendered report is sent to the printer twice.


QRQA249
Q:

I am getting printer overrun errors with some reports when I print to my laser printer

Q:

Some reports are printing dark bands on my laser printer.

A:

These problems can happen when you send a full page to a laser printer and that printer does not have enough RAM to print a full page at the specified DPI.  Try reducing the DPI or adding more RAM to the printer.


QRQA250
Q:

When I call the printersetup dialog, it always shows the default printer, even if I have preset the printerindex to another printer.

A:

This is a bug in Borland's dialog, it always comes up with the default printer no matter what the printerindex is set to.


QRQA251
Q:

I want to be able to execute a report made in "QREditor" (*.qr) without using the QREditor.  How can I do this so the user can not edit the report?

A:

You can load a qreditor report with the QRLoadREport function (defined in the qrextra unit).  Remember to add the qrextra unit to your uses clause.  The following code shows how load, preview, and finally free a saved report:

procedure TfrmTest.btnQRLoadReportClick(Sender: TObject);

var

  MyReport: TQuickRep;

begin

  try

    MyReport := QRLoadReport('myreport.qr');

    MyReport.Preview;

  finally

    QRFreeReport(MyReport);

  end;

end;


QRQA252
Q:

I'd like to know how to use my QR files made by Delphi 3 with the release of Delphi 1.

A:

The .QR files saved by the QREditor are form description files (.DFM) and DFM files are not downwardly compatible.  You will need to either create your .QR files with Delphi 1 or manually edit them to remove the properties that are not supported with Delphi 1.


QRQA253
Q:

Where can I get documentation for the QREditor?

A:

We will be updating the documentation and help with the 2.1 release due out in a few months.  A pre-release help file for the QREditor can be FTPed from ftp://ftp.qusoft.no/pub/quickrep/qredithl.zip


QRQA254
Q:

How can I send parameters to the QREditor when using a Query?

A:

This is not directly supported in the current release.  What you can do is to load the saved report and modify the query properties.  While you can't pass parameters, you can build an SQL statement with those parameters embedded in the text of the SQL statement.  The following example loads a previously saved report and replaces the SQL property if a TQuery was being used or it sets the filter if a TTable is being used:

procedure TfrmMain.Button1Click(Sender: TObject);

var

  MyEdit: TfrmQREdit;

begin

  MyEdit := TfrmQREdit.Create(Application);

  with MyEdit do

  begin

    show;

    qreditor1.OpenReportFile('cust1563.qr');

    if qreditor1.Report.DataSet is TQuery then

    begin

      with TQuery(qreditor1.Report.DataSet) do

      begin

        SQL.Clear;

        SQL.Add('select * from customer where CustNo=6312');

        Open;

      end;

    end

    else

    begin

      with TTable(qreditor1.Report.DataSet) do

      begin

        Active := False;

        {$ifdef win32}

        Filter := 'CustNo=6312';

        {$endif}

        Active := True;

      end;

    end;

    qreditor1.Report.Preview;

    Close; { if you want to make the editor go away after the preview }

  end;

end;


QRQA255
Q:

After pressing the open button on the QREditor and canceling this action the buttons do not return to the original state and the 'new' button is disabled.

A:

The demo editor project shows how to add a menu to the qreditor with ability to reenable the new button.


QRQA256
Q:

The QREditor's NewImage button is commented out.  When will this be enabled?

A:

This function will be in the 2.1 release (due out later this year)


QRQA257
Q:

Can I use the PAGE function somehow in TQREditor?

A:

This will be in the 3.0 release (due out in 98)


QRQA258
Q:

I am interested in the TQREditor component, but I have a question: How can I create a master-detail report through the component?

A:

At the current time, the QREditor component is limited to a single dataset.  This functionality will part of a future release.


QRQA259
Q:

When working with the QREditor, the Title band does not get previewed nor printed.  All the layout options and the band properties appear to be set correctly, but the band will not preview or print.

A:

Have you defined a dataset for this QREditor report?  If you do not have one, the title band will not be output.


QRQA260
Q:

Is it possible to bypass the login dialog when I want to report data from a database server with the QREditor? (by providing username and password via code)

A:

With the BDE, you'll need to use a TDatabase component and set the username and password via the params property.  You can't add this to a report created by QREditor, but if you put the component on the same form as the QREditor, this should work.  I tested this with a password protected MS Access database and it worked.


QRQA261
Q:

I'm using Quickreport editor and I found a problem. If I want to put in a report a label and its caption is the same name of a dataset field's, I can't put this label caption in the report.

A:

This is a known problem and will be addressed in a future release.  One work around is to use a SQL statement to rename the columns in the table so that the names do not overlap.  Example

SELECT Name AS qName FROM SomeTable


QRQA262
Q:

The fields in the QREditor are printing as the field names instead of the values.

A:

When you select a dataset with the editor, it names it either TTable1 or TQuery1.  If you have datasets with the same name, this can cause a conflict with the QREditor where it tries to use the wrong dataset.  Renaming the other datasets removes this conflict.  This will be addressed in a future release.


QRQA264
Q:

What is the TQuickAbstractRep control?

A:

This is a descendant of the TCustomQuickRep base class that does not use the TDataset.  If your application does not use the BDE, this will shrink the code size.


QRQA265
Q:

Why do report event use TCustomQuickRep instead of TQuickRep?

A:

This is the base class that TQuickRep is descended from.  This change makes it easier to do variations QuickReport objects


QRQA266
Q:

What happened to OnGenerateToPrinter?

A:

This feature has not been finished yet and has been disabled until it has been fixed.


QRQA267
Q:

Are there any plans to continue support of QR1 in Delphi 4 like was done in Delphi 3 with QR 1.1b?

A:

This fileset is available from our sales department upon request.


QRQA268
Q:

What is the TQRLoopBand control?

A:

This is a band that is not connected to any dataset and will print for the number of times that it's PrintCount property is set to.


QRQA269
Q:

What is the TQRStringsBand control?

A:

This is a band with a items property that is a built in stringlist.  It's name will appear in the expression builder and can be assigned to a TQRExpr control.  At runtime, this band will print for each line in the items property.


QRQA270
Q:

How do you use the export filter controls?

A:

Just drop them on a form in your project and they will show in the previews.


QRQA271
Q:

What is the new 'LinkBand' property?

A:

This works like the LinkBand property in QuickReport 1.  The Band components have a LinkBand property which is used to make several bands stick together. The LinkBand property can be set connected to another Band and QuickReport will then make a page break if there is not enough space left on the page for both bands. The second band can in turn be linked to a third band, and so on.


QRQA272
Q:

How can I display a text file with QR3?

A:

Qr3 has some new functions to make this an easy task.

#1 Create a report using the TQuickAbstractRep control instead of using the TQuickRep control.  The TQuickAbstractRep control does not use any data-aware controls and can shrink the size of your executable if you are not using any data-aware controls in your application.  You can use the TQuickRep control, you just don't need to use it.

#2 Add a TQRStringsBand to the report.  This is a band with a items property that is a built in stringlist.

#3 Add a TQRExpr control to the band.  Set the following properties

Autosize - False

AutoStretch - True

Expression - to the name of the band (like 'QRStringsBand1')

Width -  to the width of the band (can be done at runtime)

#4 Before calling Print or Preview, load the text file into the items property of the TQRStringsBand like this:

QRStringsBand1.Items.LoadFromFile(SomeFileName)

#5  Call the preview or print methods.


QRQA273
Q:

I get an access violation when I have QRDBRichText on a subquery

A:

This is a recently discovered problem that happens with TQuery's that do not have persistent fields.  Adding persistent fields will fix this.  If you can not do this, insert a line into the TQRDBRichText.Print method in qrctrls.pas like the following example using the 2.0k beta code:

procedure TQRDBRichText.Print(OfsX, OfsY : integer);

begin

  Field := FDataSet.FindField(FDataField);  { Add this line }

  if assigned(Field) then

    if (Field is TMemoField) or

       (Field is TBlobField) then

      Lines.Assign(Field);

  inherited Print(OfsX,OfsY);

end;


QRQA274
Q:

My RTF field will not span more than one page

A:

There are some serious bugs in Microsoft's implementation of their RichText common control.  We are implementing workarounds to resolve as many of these issues as we can.  At this time we are still working on RTF fields that span more than one page.


QRQA275
Q:

My RTF field doesn't consistently print out the last line in the memo.

A:

This is known problem with the MS RichText common control.  There are two workarounds.  One is to add an extra blank line to the text, the other is to set the OnGenerateToPrint event of the report's qrprinter object to nil.  This will force the report to not render the report a second time.

Example:

procedure Tfrmqr.QuickRep1BeforePrint(Sender: TQuickRep; var PrintReport: boolean);

begin

  QuickRep1.qrprinter.OnGenerateToPrinter := nil;

end;


QRQA276
Q:

Can I print a RichText object that is in a field of a file with ole2 bmp object inserted in it?

Q:

My QRRichText control is ignoring the "\page" page break command.

A:

I'm sorry, but the TRichEdit control that the QRRichText and QRDBRichtext controls link to is limited to text only and it does not appear to support this feature.  Our controls are limited to the functionality of Borland's RichEdit control, which is a  wrapper for Microsoft's RTF control.   The MS RTF common control only supports a subset of the RTF control codes.  To see what sequences are supported, load your RTF text into WordPad.  WordPad uses the same common control and if it doesn't support an RTF control sequence, then it wont work on Delphi.


QRQA277
Q:

My QRDBRichText control is not resizing correctly.

A:

If the design-time height of a QRDBRichText control is greater than some of the fields, it may not resize correctly.  If you set the height to a small value like 10 and set autostretch to true, it should work.


QRQA278
Q:

My QRRichText/QRDBRichText will not display or print embedded bitmaps.

A:

The TRichEdit and TDBRichEdit controls do not support embedded objects and since our RTF controls use the Borland RTF controls, we have the same limitation.


QRQA279
Q:

I am using the QRPrinter object and I can't get it to save to a text file.

A:

Saving as text uses the ASCII export filter and the export filters only work with reports.  When you use the qrprinter object directly, the only save option is the default .QRP save.


QRQA280
Q:

If I save a report with the Report's Options.Compression property set to true, I can't load the saved the report back into the preview.

A:

This is a bug in the TMetaFile component introduced with Delphi 3.02.  This should be addressed in the next Delphi release.


QRQA281
Q:

How do I load a previously saved report via code?

A:

We have a new class, TQRPHandler, that is defined and documented in the QRBonus unit.  This class is designed to easily allow you load a saved report using the following syntax:

  with TQRPHandler.Create do

  try

    Filename := 'somefile.QRP';

    Preview; {or}

    print;

  finally

    Free;

  end;

There is a bug in current release that will prevent this from printing with Delphi 1, this will be addressed in a future release.


QRQA282
Q:

What is the format of a report saved to disk by clicking the save button in the previewer?

A:

The saved report format is a proprietary metafile format that is only readable by QuickReport.


QRQA283
Q:

Why can't I load reports saved from the preview into the Editor and vice versa?

A:

The .QRP files saved by the preview are a rendered copy of the report saved as a metafile (not WMF format).  You can only preview or print a .QRP file.  The .QR file saved by the Editor is a Delphi resource file like a .DFM file and is basically a report form.  It contains the information required to run a report, but it does not have any data from the report in it,


QRQA284
Q:

I am trying to do is distribute .qrp files to our sales force.  On their end I will associate .qrp with a viewer we create.  If I create the .qrp file here where my default printer is a LaserJet and distribute the report to someone who has a canon?

A:

You can, but if the page sizes are different the page will be stretched (or compressed) to fit the page and there may some loss in resolution.  An alternative way of doing this would be to use Adobe Acrobat and print the files as PDF files.  The files would be more compact and Adobe makes the Acrobat Reader program freely available for multiple platforms.


QRQA285
Q:

The OnPrint event of my TQRLabel control is never being called.

A:

Is the caption of the label blank?  The code checks the caption and if it's blank, it doesn't call the OnPrint event to save time.  If you want to use OnPrint with a TQRLabel, you must set the Caption to a non empty string.


QRQA286
Q:

I have controls on the page footer that use the detail table.  On the each page of a report (except for the last page) the first record's data appears everywhere except in the page footer where the second record's data appears.

A:

When the page footer band is printed, the report is already working on the first detail record for the next page.  One way around this would be to use the AfterPrint event of the detail band to store the data for the page footer band in some variables.  In the BeforePrint event of the footerband, you would use TQRLabels and set the their captions to the string representations of the variables.


QRQA287
Q:

On a band, I have some QRDBText fields and a QRMemo field (set to autostretch=true).  When the memo field is going to go beyond the current page - QR prints the memo first (instead of the text fields) and then rolls on to the new page, finishes the memo, and then prints the text fields on top of the next page.  How can I force the QRDBText fields to print first?.

A:

The memo control is being printed first, which causes the page break and the rest of the controls are printed afterwards.  If you change the creation order of the controls on the band so that the memo is last, the other controls will print first.  Select each control (except for the Memo) and right-click on each one and select "Send to Back".  That will create other controls before memo.


QRQA288
Q:

I can't get my text to word wrap if it doesn't have any carriage returns in the text?

A:

Check to make sure that your text has spaces in it.  If the text is unbroken, it will not be word wrapped.


QRQA289
Q:

My RTF text does not have the same formatting as it appears in MS Word.

A:

QuickReport's RichText control uses Delphi's RichEdit control, which in turn is a wrapper for Microsoft's RichEdit common control.  And that control may not be able to handle your file.  Almost all of our RTF problems have been traced to bugs in that common control, and it ripples down to our control.  If you load your RTF file into WordPad and it looses the formatting, then you can trace it to the common control.


QRQA290
Q:

I can't get the mask property work with my phone number field (it's a string field)

A:

The mask property only applies to numeric fields and will be ignored on string data.

Use the OnPrint event to format the field like the following:

procedure TfrmReport.QRDBTextPhonePrint(sender: TObject; var Value: string);

begin

  Value := '(' + copy(Value,1,3) + ') ' + copy(Value,4,3)

    + '-' + copy(Value,7,4);

end;


QRQA291
Q:

If the report contains nulls or blanks these are not included, this destroys the alignment of the columns. Is there any way to include all nulls?

A:

Use a QRExpr control for fields that could have nulls and for the expression use the IF() function to insert a space for null fields like the following:

IF(tbSample.Extra<>'', tbSample.Extra, ' ')


QRQA292
Q:

My multiple line QRDBText controls are having the words cutoff at the right margin even when autosize is set to false.

A:

If you have autostretch turned on, please make sure that the WordWrap is also turned on.


QRQA293
Q:

I can't get the mask property to work on my numbers.

A:

Please make sure that you are using a number field, the mask property will be ignored for string fields.


QRQA294
Q:

I read the FAQ to use TQRDBText because there is no TQRDBMemo, but when my memo contains embedded carriage returns they show up as a square symbol, not as a new line.

A:

This was a known bug and it was fixed in the 2.0j release.


QRQA295
Q:

Is there a property for QRDBText to tell it *not* to split itself across pages? (i.e. widow/orphan protection.)

A:

Support for a "widow/orphan" feature will part of the 3.0 release, due out early next year.

You can provide some of it's functionality with the current release with some minor coding.

First, add the following declarations to the under private in your report form declaration:

  TfrmReport = class(TForm)

  [extra deleted]

  private

    { Private declarations }

    function GetQRAvailableSpace: integer;

    property QRAvailableSpace: integer read GetQRAvailableSpace;

Then define the function:

function TfrmReport.GetQRAvailableSpace: integer;

begin

  with QuickRep1 do

    if Page.Orientation = poPortrait then

      result := round(QRPrinter.PaperLength - Page.BottomMargin - PageFooterBand1.Size.Length - CurrentY)

    else

      result := round(QRPrinter.PaperWidth - Page.BottomMargin - PageFooterBand1.Size.Length - CurrentY);

end;

This assumes a footer band with no child bands.  To see how to check child band size, see the actual available space function in the quickrpt unit.

To use this function to prevent a group band from being orphaned, call it from the BeforePrint event of the group band like the following:

procedure TfrmQRProd.QRGroupCustomerBeforePrint(Sender: TQRCustomBand;

  var PrintBand: Boolean);

begin

  { Set your PrintBand code here if needed }

  if PrintBand then

  begin

    // Force a new page if not enough room for next detail band

    if QRAvailableSpace < round(Sender.Size.Length + QRGroupCustomer.Size.Length + DetailBand1.Size.Length) then

      Sender.ParentReport.NewColumn;

  end;

end;

This will force a new page if there is not enough room for a detail band after the group band.


QRQA296
Q:

What about adding real "LeftAndRightJustify" (newspaper style) (aka Full Justification) in an upcoming release?

A:

This will not be part of QuickReport.  A future release will make the FormatLines procedure virtual so this can be done in a descending component by someone else.


QRQA297
Q:

How do I control interline spacing within a QRMemo?  Sometimes I need greater control over the line spacing.

A:

This will be part of the 2.1 release


QRQA298
Q:

When a TQRDBText field is added to a pageheader band the field is not refreshed (it remains the last field printed).

A:

This is not a bug, the report is designed to retrieve rows from the dataset when it handles the detail band, it's not designed to refresh the dataset at the first call for the PageHeader.  There is a simple way to get the correct for what you want to do.  In the BeforePrint event of the report, add a line that goes to the first row of the dataset.  If you are using a TTable named "Table1" it would look like this:

procedure TfrmSample.QuickRep1BeforePrint(Sender: TQuickRep;

  var PrintReport: Boolean);

begin

  Table1.First;

end;


QRQA299
Q:

I put a mask 999\-999\-9999 for a phone number. And it still printing 5144559400 instead of 514-455-9400. Why?

A:

That is the format of the editmask used by the TMaskedEdit control. The QRExpr control's mask is the format string used by FormatFloat() and FormatDateTime functions.  Please refer to their documentation for allowable values.  In this case, the format mask for the USA phone number would '(000) 000-000'


QRQA300
Q:

I have two autostretched text controls on one band and it doesn't work right.

A:

Multiple stretching controls on one band is not supported.  This is documented on the manual page for the AutoStretch property.  This limitation should be removed in the 3.0 release due out later this year.


QRQA301
Q:

I have a calculated table field and it has line breaks in the text and those line breaks don't print.

A:

Delphi defines calculated table text fields as TStringfield and QR handles that type of field differently than

    it handles actual memo fields.  To output a calculated text field, use a QRMemo component and set QRMemo.Lines.Text to the

the value of the calculated field at runtime.


QRQA302
Q:

I am setting QuickRep1.QRPrinter.OnGenerateToPrinter:=nil to expedite the printing of a large report from the preview form.  When I use the printersetup to select a subset of the pages for printing, I still get all of the pages printed. When I don't set OnGenerateToPrinter:=nil, the settings take effect and I get the subset of pages printed. How can I print a subset of the pages and still use OnGenerateToPrinter:=nil to expedite printing?

A:

This is a known limitation (also applies to saved reports) and will be addressed in a future release.  The only work around would be to only set the OnGenerateToPrinter to nil when you know that the printer setup button has not been pressed.  Starting with the 2.0j release, if you use a custom preview, you can check the result of calling printersetup and then you could set the OnGenerateToPrinter to nil if the user did not use printersetup.


QRQA303
Q:

Is there a simple way to use a single QRLabel and create a label with the letters stacked on top of each other.  An example is shown below.

P

A

T

I

E

N

T

A:

With QR 2.0J you can insert carriage returns and line feeds between each letter and set the Stretch property of the control to true.

Example:

qrlabel1.Caption :=   'V' + #13#10 + 'E' + #13#10 + 'R' + #13#10 + 'T' + #13#10 + 'I' + #13#10 + 'C' + #13#10 + 'A' + #13#10 + 'L';


QRQA304
Q:

I need to change the DataField properties on the QRDBText component under run-time so that it uses one field on page 1 and another the rest of the pages.

A:

You can not change the DataField property after the report starts.  You could use a TQRLabel control and set it's value at runtime in (either in it's OnPrint event or it's parent band's BeforePrint event) based on the current value of the report's PageNumber property.


QRQA305
Q:

If I use tabs (ctrl-tab in the editor) in my TQrMemo fields the report prints []. Is that a general problem in TQrMemo fields?

A:

Tab characters are not supported in the TQRMemo, TQRLabel, TQRExpr, TQRDBtext controls.  The only control that will correctly display a tab character are the RichText controls.


QRQA306
Q:

Is it possible to change the Autosize property of the QRImage and the Autostretch property of the QRRichtext at runtime ?

A:

Yes, you can change most of the properties at runtime in the BeforePrint and AfterPrint events of the report and of the band that the controls are on.


QRQA307
Q:

Can you advise me how to suppress the printing of blank fields in mailing label report?

A:

Use a TQRMemo control and fill it with only the information that is not blank.

Example:

procedure TReportForm.AddIfNotBlank(memo: TQRMemo; s: string);

begin

  { simple function to only add non blank fields }

  if Trim(s) <> '' then memo.Lines.Add(s);

end;

procedure TReportForm.DetailBand1BeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);

begin

  QRMemo1.Lines.Clear;

  QRMemo1.Lines.Add(Table1Company.AsString);

  AddIfNotBlank(QRMemo1, Table1Addr1.AsString);

  AddIfNotBlank(QRMemo1, Table1Addr2.AsString);

  AddIfNotBlank(QRMemo1, Table1City.AsString + ', ' +  Table1State.AsString + '  ' + Table1Zip.AsString);

end;