Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
969 views363 pages

RPPRO Tutorial and Reference

Uploaded by

Brian Feifarek
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
969 views363 pages

RPPRO Tutorial and Reference

Uploaded by

Brian Feifarek
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 363

ReportPrinter Pro 3.

0
Component Suite for Delphi

Tutorial and Reference Guide

This manual and all material accompanying it is Copyright , 1995-1999, Nevrona Designs, All Rights Reserved. (rev 3G-RP)

Table of Contents
Limited Warranty ..............................................................................................................9 Technical Support ..........................................................................................................10 Introduction.....................................................................................................................11 Installation ......................................................................................................................11 Tutorials..........................................................................................................................15 Tutorial 1: Introduction to ReportPrinter Pro ............................................................16

Tutorial 2:

The TReportPrinter component ...............................................................20

Tutorial 3:

The TReportFiler component...................................................................23

Tutorial 4:

The TFilePrinter component ....................................................................25

Tutorial 5:

The TFilePreview component..................................................................26

Tutorial 6:

The TReportSystem component...............................................................28

Tutorial 7:

The TDetailShell component ...................................................................31

Tutorial 8:

The TReportSection class ........................................................................34

Tutorial 9:

The TMasterShell component..................................................................36

Tutorial 10: The TReportShell component ..................................................................40

Tutorial 11: The TLabelShell component....................................................................44

Tutorial 12: The TMemoBuf/TDBMemoBuf classes ..................................................47 3

Tutorial 13: The TDBTablePrinter component............................................................50

Tutorial 14: The TDBTableColumn component..........................................................53

Tutorial 15: The TTableSection component ................................................................57

Tutorial 16: The TTablePrinter/TTableColumn components ......................................59

Tutorial 17: Fonts and the Text Line............................................................................60

Tutorial 18: Margins, Sections and Waste Areas.........................................................61

Tutorial 19: Columns ...................................................................................................62

Tutorial 20: Printing Bitmaps and Graphics ................................................................63

Tutorial 21: Setting up the Printer................................................................................64

Tutorial 22: Using Streams ..........................................................................................65

Tutorial 23: Exporting to RTF .....................................................................................66

Tutorial 24: Quick Start with RAVE ...........................................................................68

Tutorial 25: RAVE Data Connections .........................................................................70

Tutorial 26: Customizing RAVE Data Connections ....................................................71

Tutorial 27: Overview of TRaveProject.......................................................................75

Tutorial 28: Providing End User design support .........................................................77

Tutorial 29: Rave Files ................................................................................................79

Reference Alphabetical
Alphabetical list of all Events/Methods/Properties/Types

81 305

Class

Class Tree...........................................................................................................................305 TBaseReport.......................................................................................................................307 TBaseShell..........................................................................................................................308 TCanvasReport...................................................................................................................309 TDBMemoBuf....................................................................................................................310 TDBTableColumn ..............................................................................................................311 TMemoBuf .........................................................................................................................318 TReportSection...................................................................................................................326 TRPBarsBase......................................................................................................................331 TRPBars2of5...............................................................................................................331 TRPBarsCode128........................................................................................................331 TRPBarsCode39..........................................................................................................331 TRPBarsEAN ..............................................................................................................331 TRPBarsPostNet..........................................................................................................331 TRPBarsUPC ..............................................................................................................331 TRPBaseComponent ..........................................................................................................332 TRPComponent ..................................................................................................................332 TRTFFiler...........................................................................................................................335 TTableColumn....................................................................................................................336 5

TTableItem .........................................................................................................................337 TTableSection.....................................................................................................................339 TTextFiler...........................................................................................................................340

Components
TDBTablePrinter .........................................................................................................312

TDetailShell ...............................................................................................................313

TFilePreview ...............................................................................................................314

TFilePrinter .................................................................................................................315

TLabelShell .................................................................................................................316

TMasterShell ...............................................................................................................317

TReportFiler ................................................................................................................320

TReportPrinter.............................................................................................................323

TReportShell ...............................................................................................................328

TReportSystem ............................................................................................................329

TRPHTMLFiler...........................................................................................................330

TRTFFiler....................................................................................................................335

TTablePrinter ..............................................................................................................338

TTextFiler ...................................................................................................................340

Appendix - Units Appendix Cross Reference by Categories Index

341 344 350

Single User License Agreement


This is a legal Agreement between you, as the end user, and Nevrona Designs. By opening the enclosed sealed disk package, or by using the disk, you are agreeing to be bound by the terms of this Agreement. If you do not agree with the terms of this Agreement, promptly return the unopened disk package and accompanying items, (including written materials), to the place you obtained them for a full refund. 1. Grant of License - Nevrona Designs grants to you the right to use one copy of the enclosed Nevrona Designs program, (the Software), on a single terminal connected to a single computer (i.e. CPU). You may make one copy of the Software for back-up purposes for use on your own computer. You must reproduce and include the copyright notice on the back-up copy. You may not network the Software or use it on more than a single computer or computer terminal at any time, unless a copy is purchased for each computer or terminal on the network that will use the Software. You may transfer this Software from one computer to another, provided that the Software is used on only one computer at a time. You may not rent or lease the Software, but you may transfer the Software and accompanying written material and this license to another person on a permanent basis provided you retain no copies and the other person agrees to accept the terms and conditions of this Agreement. THIS SOFTWARE MAY NOT BE DISTRIBUTED, IN MODIFIED OR UNMODIFIED FORM, AS PART OF ANY APPLICATION PROGRAM OR OTHER SOFTWARE THAT IS A LIBRARY-TYPE PRODUCT, DEVELOPMENT TOOL OR OPERATING SYSTEM, OR THAT MAY BE COMPETITIVE WITH OR USED IN LIEU OF THE PROGRAM PRODUCT, WITHOUT THE EXPRESS WRITTEN PERMISSION OF NEVRONA DESIGNS. This license does include the right to distribute applications using the enclosed software provided the above requirements are met. 2. Term - This Agreement is effective until you terminate it by destroying the Software, together with all copies. It will also terminate if you fail to follow this agreement. You agree upon termination to destroy the Software, together with all copies thereof. 3. Copyright - The software is owned by Nevrona Designs and is protected by United States laws and international treaty provisions. Therefore, you must treat the Software like any other copyrighted material (e.g. a book or musical recording) EXCEPT that you may either (a) make one copy of the Software solely for back-up or archival purposes, or (b) transfer the Software to a single hard disk provided you keep the original solely for back-up or archival purposes. You may not copy the written materials accompanying the Software.

Limited Warranty
1. Limited Warranty - Nevrona Designs warrants that the disks on which the Software is furnished to be free from defects in material and workmanship, under normal use, for a period of 90 days after the date of the original purchase. If, during this 90-day period, a defect in the disk should occur, the disk may be returned with proof of purchase to Nevrona Designs, which will replace the disk without charge. Nevrona Designs warrants that the Software will perform substantially in accordance with the accompanying written materials. Nevrona Designs does not warrant that the functions contained in the Software will meet your requirements, or any operation of the Software will be uninterrupted or error-free. However, Nevrona Designs will after being notified of significant errors during the 90-day period, correct demonstrable and significant Software or documentation errors within a reasonable period of time, or refund all or a fair portion of the price you have paid for the Software at Nevrona Designs option. 2. Disclaimer of Warranties - Nevrona Designs disclaims all other warranties, either expressed or implied, including but not limited to implied warranties of merchantability of fitness from particular purpose, with respect to the Software and accompanying written materials. This limited warranty gives you specific legal rights, you may have other, varying from state to state. Nevrona Designs will have no consequential damages. In no event, shall Nevrona Designs or its suppliers be liable for damages whatsoever, (including without limitation, damages for loss of business profits, business interruption, loss of business information, or any pecuniary loss), arising out of the use or the inability to this Nevrona Designs product, even if Nevrona Designs has been advised of the possibility of such damages. Some states do not allow the exclusion of limitation of liability for consequential or incidental damages, and this limitation may not apply to you. 3. Sole Remedy - Nevrona Designs entire liability in your inclusive remedy shall be, at Nevrona Designs option, either: (1) The return of the purchase price paid; or (2) Repair or replacement of the Software that does not meet Nevrona Designs limited warranty, which is returned to Nevrona Designs with a copy of your receipt. 4. Governing Law - This Agreement will be construed and governed in accordance with laws of the State of Arizona. 5. U.S. Government Restricted Rights - This Software and documentation are provided with restrictive rights. Use, duplication or disclosure by the Government is subject to restrictions set forth in Section c(1)(ii) of the Rights and Technical Data in Computer Software clause at 52.227-7013.

Technical Support
Technical support is provided to registered users for questions or problems with ReportPrinter. For fastest service contact us by e-mail or fax. Please include your serial number (found on the disk or manual) and version of ReportPrinter along with any information related to your problem. Internet:[email protected] Web page:http://www.nevrona.com Fax Phone:(602) 530-4823 Mailing Address:Nevrona Designs 1930 South Alma School Road #B-201 Mesa, Arizona 85210-3041 Voice Phone:(480) 491-5492 9 a.m. to 4 p.m. Pacific Standard Time (Monday-Friday) NOTE: In order for us to bring you timely updates to ReportPrinter, please e-mail or fax your questions or problems and refrain from calling the voice phone number unless it is an emergency requiring immediate assistance. Thank you for your cooperation. Nevrona Forum Mailing List Another service that is offered (free of charge) that can assist you in getting help with ReportPrinter Pro as well as other Nevrona Designs products is to become a member of the Nevrona Forum mailing list. When you become a member, your e-mail account will be connected to a list of other Nevrona Designs customers. If you have a question, just post it to the list and all other member of the list will see the message and be able to respond to it. Youll also see questions and solutions from other users as they are posted. To subscribe to the list you must send a message to [email protected] with the following text in the body (not the subject line) of the message: subscribe nevrona-forum <your e-mail address>
(e.g. subscribe nevrona-forum [email protected])

The e-mail address provided is where the mailing list messages will be sent. Also, any messages coming from the list will have [Nevrona] appended to the subject to make identification easier. You should also be able to use your CompuServe account with this list just make sure to include your proper Internet address (e.g. 71234,[email protected]) when subscribing. NOTE: This is not an official channel for Nevrona Designs technical support so we cannot guarantee that your questions will be answered if posted to this mailing list. However, nobody knows our products better than our customers so you may get a wider range of possible solutions than you would from Nevrona Designs technical staff.

10

Introduction
Congratulations! You've made an excellent choice. ReportPrinter Pro was designed to give the power of reporting back to the programmer where it belongs. ReportPrinter Pro does this by offering a powerful suite of printing components that simplify the task of creating professional reports. ReportPrinter Pro does not need any extra .DLL's, .VBX's or .EXE's. Reports are written with Delphi code and components and are compiled into the application for easier distribution and faster execution. Read through this manual and the examples on the accompanying disk and you'll soon be turning nightmare printing jobs into dream reports.

Installation
IMPORTANT: If you have installed an older or demo copy of ReportPrinter, first remove all instances of those files from the component library and your hard disk before continuing with the installation process. If you do not remove all older versions of ReportPrinter you will get a type mismatch or other compiler/runtime errors. Examples of this are unit version mismatch errors and errors like unit RPSECT was compiled under a different version. Step 1: Backup your component library. For Delphi 1.0 the file is called COMPLIB.DCL typically in the \DELPHI\BIN directory. For Delphi 2.0 the file is called CMPLIB32.DCL typically in the \Program Files\Borland\Delphi 2.0\Bin directory. If you encounter any problems during the installation process, you can restore your component library by restoring this file. Step 2: Run the SETUP.EXE program found on the product disk and answer the prompts as they are presented. Step 3: For installation in the Delphi 1.0 IDE follow these steps: a. Backup the component library file called COMPLIB.DCL in your \DELPHI\BIN directory. If you encounter any problems during the installation process, you can restore your component library by restoring this file. Load up Delphi 1.0 and select Options | Install Components from Delphis menu. Click the Add button to open the Add Module file selection dialog box. Select the full drive and directory path name to the file RPREG16.PAS (e.g. C:\RPPRO\16\RPREG16.PAS) and click the OK button. Click OK to return to the Install Components dialog box and then click OK to accept the changes. Delphi will now re-compile your component library. Once it is finished, you should have a new page on your component palette called Report that contains the new ReportPrinter Pro components.

b. c. d. e.

11

For installation in the Delphi 2.0 IDE follow these steps: a. Backup the component library file called CMPLIB32.DCL in your \Program Files\Borland\Delphi 2.0\Bin directory. If you encounter problems during the installation process, you can restore your component library by restoring this file. Load up Delphi 2.0 and select Component | Install from Delphis menu. Click the Add button to open the Add Module dialog box. Click the Browse button to open the Add Module file selection dialog box. Select the full drive and directory path name to the file RPREG32.PAS (e.g., C:\RPPRO\32\RPREG32.PAS) and click the OK button. Click OK to return to the Install Components dialog box and then click OK to accept the changes. Delphi will now re-compile your component library. Once it is finished, you should have a new page on your component palette called Report that contains the new ReportPrinter Pro components.

b. c. d. e. f.

Make sure to read the installation notes for any additional steps that may be necessary or changes that may have occurred since this document was printed. NOTE: If you get the error RPBASE.DCU not found during the installation process, what this means is that your component path in the Install Components dialog box is too long and that Delphi did not recognize the existence of this file. You need to shorten this path. A good solution is to move some of your third party components to the same directory. For example, create an ADDON subdirectory and move some of your add on components there. Remove the extraneous paths from the component path line in the Install components dialog.

12

Connecting ReportPrinter Pro Help File To Delphi/C++Builder's IDE By connecting ReportPrinter's Help file into Delphi's IDE, you can get context sensitive help for any ReportPrinter event, method or property just by placing the cursor on the keyword and pressing F1. To enable this feature, you must first follow these steps:

Delphi 1 or 2:
1. 2. 3. 4. Copy the RPPRO.HLP, RPPRO.CNT and RPPRO.KWF files from your RPPRO directory to Delphi's HELP directory. From the Windows Program Manager, run the Delphi Help File Installer program (HelpInst), located in your Delphi Program Group. Click the Open an existing HDX file button or select the File | Open menu options and open file DELPHI.HDX in Delphi's BIN directory. Click the Add a new keyword file button or select the Keywords | Add Keyword File menu options and add file RPPRO.KWF, now located in Delphi's HELP directory, to the list of keyword files being displayed. Click the Compile and save the current HDX file button or select the File | Save menu options to save and compile the modified HDX file. This process may take up to 30 seconds. Close the Help File Installer window or select the File | Exit menu options to terminate the program.

5. 6.

For Delphi 3 or 4:
1. Copy the RPPRO.HLP and RPPRO.CNT files into your Delphi ...\Help directory. 2. Edit the DELPHI3/4.CFG file and remove any reference to RPPRO.HLP 3. Edit the DELPHI3/4.CNT file and add two lines :Include RPPRO.CNT :Link RPPRO.HLP 4. See note below.

For Delphi 5:
1. Copy the RPPRO.HLP and RPPRO.CNT files into your Delphi ...\Help directory. 2. Start Delphi Select the Customize option in the Help menu ( OpenHelp utility ) 3. Select the "Index" tab 4. Select the "Add" option under the "Edit" menu. 5. Add RPPRO.HLP to the list 6. See Note below If you do not have access to the OpenHelp utility, then do the following "manual" steps. 1. Add a Link statement referencing the RPPRO.HLP file at the end of the ...\Delphi5\Help\DEL5XTRA.OHL file. :Link RPPRO.HLP

NOTE
After making any changes to the help system, be sure to delete any existing GID file in the Help directory. ( ...\Help\DELPHI#.GID ). This will force the Help system to rebuild this file on the next usage. This is a hidden file, so you will not see it unless you have your Windows File Explorer options set to display hidden files.

13

For C++Builder:
1. 2. 3. 4. 5. Run the ..Borland\Common files\OpenHelp.exe utility. Click the Search Ranges tab in OpenHelp. Choose Add below the Available Help Files list box. Browse to the ..\RPPRO\RPPRO.HLP file then choose Open. Click the OK button to save the changes and close the OpenHelp utility.

Upgrading from ReportPrinter 1.1


If you are upgrading from ReportPrinter 1.1 you should not need to make many changes to your code. The only item that may require a change is any access to the Delphi TPrinter class or its instance variable Printer (found in the PRINTERS unit). ReportPrinter Pro has completely replaced TPrinter with the TRPDevice class found in RPDEVICE.PAS (\RPPRO\SOURCE). This was done to provide better access to the Window Printing API and the benefits can be seen in the added printer setup functionality found in TReportPrinter and TReportFiler. See Tutorial 21: Setting up the Printer for more information. All types and constants have been moved to the unit RPDEFINE for ReportPrinter Pro. Normally Delphi will include all necessary units when using components, however, if you try to recompile your project created with ReportPrinter 1.1 under ReportPrinter Pro without making any changes to it, you will get a compiler error on the first encounter of something like pjCenter or BOXLINEALL. This can be solved by loading all forms containing ReportPrinter components, making a small change on each form (e.g., moving a component to a different spot and then back will work) and then rebuilding your project. If you have created a unit named PRINT.PAS in your project, this will cause conflicts with the Delphi unit named PRINT.DCU and will result in a compiler error for RPDevice (e.g., circular reference, etc.). Please rename the unit PRINT.PAS in your project to some other name to get rid of the compiler error. In most cases however, there should be no problems if you simply install the new components into your component library and rebuild (Compile | Build All) all projects using ReportPrinter.

Upgrading from ReportPrinter Pro 2.0


If you are upgrading from ReportPrinter Pro 2.0, you should not need to make many changes to your code. The only incompatibility that was found with conversion is the addition of the FrameMode property. This property only affects the Rectangle and Ellipse methods and then only if you are using a thick pen width where positioning is critical. If these criteria apply to your reports, the see the reference on FrameMode for more information. In most cases however, there should be no problems if you simply install the new components into your component library and rebuild (Compile | Build All) all projects using ReportPrinter. WARNING! ReportPrinter Pro has been found to cause extreme feelings of temptation to rewrite reports using all of the new components and methods, especially the new Rave visual report designer. Proceed with caution! (he he) 14

Tutorials
ReportPrinter Pro is actually two tools in one. The first is an award winning code based library that offers unparalleled flexibility and control over every aspect of the reporting and printing process. The second is the Rave system which enhances this code based library with a suite of visual components and a powerful visual designer. Whether you decide to use ReportPrinter Pro for its code based library, its visual system or both, youll find that every aspect has been meticulously crafted to give you the most in power and flexibility. The following tutorials will help you learn what you will need to take full advantage of everything that ReportPrinter Pro provides. Tutorials 2-23 are designed for those who wish to learn about the code based side of ReportPrinter Pro while tutorials 24 and up provide information on how to integrate the Rave system into your Delphi and C++Builder applications. For more information on the Rave system, please also refer to the Rave Reference Guide. The demo projects, along with the component source code are also excellent ways to learn ReportPrinter Pro inside and out. So, enjoy this powerful new addition to your Delphi component library and welcome to ReportPrinter Pro!

15

Tutorial

1
Introduction to ReportPrinter Pro
There are 3 different types of objects in ReportPrinter Pro, Output Components, Framework Components and Report Classes. The Output Components are responsible for sending the report to a variety of destinations. The Framework Components provide different frameworks to place your reports into but still require an output component in order to display their contents. The Report Classes are non-component classes that manage other reporting tasks.

Output Components TReportPrinterThe basic output component that sends output directly to the printer.

TReportFiler

Sends output to special report file for later use by a TFilePrinter or TFilePreview component.

TFilePrinter

Sends a report file generated from TReportFiler to the printer.

TFilePreview

Sends a report file generated from TReportFiler to a preview screen.

TReportSystem Incorporates the other four output components, TReportPrinter, TReportFiler, TFilePrinter and TFilePreview into a single, easy to use reporting system. 16

TDetailShell

Framework Components This component can be used for simple table listing type reports or can be combined with TMasterShell or TReportShell components.

TMasterShell

This component can be used for master-detail type reports when combined with other TReportShell or TDetailShell components.

TReportShell

This component can be used for master-detail type reports, complete with page headers and footers when combined with other TMasterShell or TDetailShell components.

TLabelShell

This component can be used for label type reports and includes many predefined label types.

TDBTablePrinter

This component, along with its component editor and the TDBTableColumn and TTableSection components, allows the creation of reports without any code at all.

TTablePrinter

This component, like TDBTablePrinter, allows the creation of reports using its component editor and the TTableColumn and TTableSection component. However, the data sources are provided by the programmer and do not require a database. This iconless component, which is managed by the TDBTablePrinter component editor, defines the table field and characteristics for each column in the report. This iconless component, which is managed by the TTablePrinter component editor, defines the data source and characteristics for each column in the report. This iconless component, which is managed by TDBTablePrinter or TTablePrinter component editors, defines the characteristics for each header or footer in the report.

TDBTableColumn

TTableColumn

TTableSection

17

Report Classes TMemoBuf This class is used with GetMemoLine, MemoLines and PrintMemo to handle the printing of large streams of text. It also has many methods and properties to manipulate text streams and is great for form letters. This class has all of the functionality of TMemoBuf plus the ability to load data from a TField component. This class manages the section settings. It is used heavily by the framework components and has a visual property editor. This component can be used for HTML type reports and is used similar to the TRTFFiler component.

TDBMemoBuf

TReportSection

THTMLFiler

TRTFFiler

This component can be used for RTF type reports and is used similar to the TRTFFiler component.

TTextFiler

This component can be used for Text type reports and is used similar to the TRTFFiler component.

18

Rave Classes Custom Connection This component is used to connect non-TDataSet data to reports created with the Rave visual designer.

DataSet Connection This component is used to connect TDataSet tables (e.g. TClientDataSet, 3rd party TDataSet descendents) to reports created with the Rave visual designer.

Table Connection

This component is used to connect TTable tables to reports created with the Rave visual designer.

Query Connection

This component is used to connect TQuery tables to reports created with the Rave visual designer.

RAVE Project

This component provides a connection to a report project that was created with the Rave visual designer. Use this component to get a listing of all available reports or to execute a specific report.

19

Tutorial

2
TReportPrinter component
The TReportPrinter component is the most basic output component in ReportPrinter Pro. With its methods, properties and events handlers you can code a report that will be sent directly to the printer. Properties Copies and Orientation control the options for the printer indicated by the property names, while FirstPage and LastPage determine which pages will actually be printed. LineHeightMethod and LinesPerInch will determine how the height of text lines are calculated. The margin settings, MarginBottom, MarginLeft, MarginRight and MarginTop are all measured from their respective side of the paper. ScaleX and ScaleY will expand or shrink the entire printout by a specific percentage. StatusFormat is the text that appears in the TLabel component StatusLabel. StatusText is used for user defined macros in StatusFormat. TabShade is the percentage of shading that will override any tab settings created by SetTab. TextBKMode along with BKColor will determine how text is drawn on the report. Title is the description for this report that will appear in the Print Manager. Units and UnitsFactor determine the units that all measurements are done in. Version displays the version number of your ReportPrinter Pro components.

20

Events The OnBeforePrint and OnAfterPrint events are called before and after the print job. These are useful for initializing or destroying any items used in the reports such as bitmaps, memo buffers or table components. The OnPrint and OnPrintPage events are where the main printing code should be placed. In an OnPrint event, the programmer is responsible for calling NewPage to begin a new page and finishes the report by exiting the event handler. Any reporting code in OnPrintPage is called once for each page as long as a true result is returned. The report is finished by returning a false result when exiting the event handler. If both the OnPrint and OnPrintPage events are defined, only the OnPrint event will be executed. OnNewPage and OnPrintHeader are called at the beginning of each page while OnPrintFooter is called at the end of each page. OnNewColumn is called at the top of each new column and can be useful for printing column headers on snaking column style reports. OnEndOfSection is called whenever the cursor goes below the section bottom. To print a report call the Execute method.

21

Example Listed below is a short sequence of steps to create a very simple Hello World print job using the TReportPrinter component: Step 1: Create a new project or load up the project TUTOR02 located in \RPPRO\TUTOR\02 or wherever your ReportPrinter Pro files are located. Step 2: Place a TReportPrinter, TLabel and TButton component on the form. Step 3: Initialize ReportPrinter1 as follows: Property LineHeightMethod MarginBottom MarginLeft MarginRight MarginTop StatusLabel OnPrint event Value lhmFont 0.5 0.5 0.5 0.5 Label1
WITH Sender as TBaseReport do begin SetFont('Arial',72); Home; Print('Hello World!'); end; { with }

NOTE: Make sure you set the margin properties or there may be no output on your report. This is because most inkjet and laserjet printers have areas around the edge of the paper that they cannot print on. These are called waste areas (see LeftWaste, RightWaste, TopWaste and BottomWaste) and if you attempt to print text starting in a waste area, the entire string will not show up on your printouts. Step 4: Initialize Button1 as follows: Property Caption OnClick event Value Print
ReportPrinter1.Execute; Label1.Caption := 'Report printed!';

That's it for your first ReportPrinter Pro report. It doesn't do much, but as you can see it doesn't take much to get some quick output.

22

Tutorial

3
TReportFiler component
The TReportFiler component is used in conjunction with TFilePrinter and TFilePreview to store a report in a special binary format until it is ready to be printed or previewed. TReportFiler is very similar to TReportPrinter which allows you to use the same report code with either TReportPrinter or TReportFiler. Properties and Events TReportFiler has all the same properties and events as TReportPrinter plus a few more to control file output. AccuracyMethod determines the way that strings are output for more accurate print preview. FileName is the file that will be created if StreamMode is anything other than smUser. Use smFile for large reports (>10 pages or lots of bitmaps) and smMemory for smaller reports (< 10 pages). To send a report to a file call the Execute method.

23

Example We'll convert our current project so that it uses a TReportFiler component as well as the TReportPrinter component. Step 1: Use the project from the previous tutorial topic or load up the project TUTOR03 located in \RPPRO\TUTOR\03. Step 2: Place a TReportFiler and TButton component on the form. Step 3: Initialize ReportFiler1 as follows: Property FileName LineHeightMethod MarginBottom MarginLeft MarginRight MarginTop StatusLabel StreamMode OnPrint event Value TUTOR.RPT lhmFont 0.5 0.5 0.5 0.5 Label1 smFile ReportPrinter1Print (do this by clicking the down arrow in the right column of the Object Inspector).

NOTE: You are using the same event handler for ReportPrinter1 and ReportFiler1 so any changes you make in the source code for one component will automatically be used by the other component. Step 4: Initialize Button2 as follows: Property Caption OnClick event Value Create File
ReportFiler1.Execute; Label1.Caption := 'Report filed!';

Now your project is generating a binary representation of your report when you press Button2. As you can see, it is not very useful without a TFilePrinter or TFilePreview component which well get to next. NOTE:The binary file that TReportFiler creates does not contain actual printer commands (such as PCL) but rather a custom tokenized version of the report. This format is not officially documented but the source code that writes the file is located in RPFBASE.PAS and RPFILER.PAS and the source code that reads the file is located in RPFPRINT.PAS. These files should be located in \RPPRO\SOURCE.

24

Tutorial

4
TFilePrinter component
The TFilePrinter component takes a file generated by a TReportFiler component and sends it to the current printer. TFilePrinter is often used to do a print from the preview screen. TFilePrinter is a simple component but does have methods and properties to customize the selection of what gets printed. Properties and Events FileName is the name of the report file generated by TReportFiler if StreamMode is smMemory or smFile. A stream mode of smUser is used when the programmer wants to provide their own stream object (any descendent of TStream will work) by assigning it to the Stream property of TReportFiler, TFilePrinter and/or TFilePreview. There are no events for TFilePrinter. To send a report file to the printer call the Execute or ExecuteCustom methods. Example Next well add to our current project the ability to output the file generated by ReportFiler1. Step 1: Use the project from the previous tutorial topic or load up the project TUTOR04 located in \RPPRO\TUTOR\04. Step 2: Place a TFilePrinter and TButton component on the form. Step 3: Initialize FilePrinter1 as follows: Property FileName StreamMode Step 4: Initialize Button3 as follows: Property Caption OnClick event Value Print File
ReportFiler1.Execute; FilePrinter1.Execute; Label1.Caption := 'File printed!'

Value TUTOR.RPT smFile

Now when you press Button3 your project is generating a binary representation of your report and then sending that file to the printer. Next well see how to preview the report file to the screen.

25

Tutorial

5
TFilePreview component
The TFilePreview component takes a file generated by a TReportFiler component and sends it to the screen for previewing. TFilePreview has many methods and events that allow the programmer to create a completely customized user interface. Properties ScrollBox defines the TScrollBox component that the report will be drawn in. FileName and StreamMode are used in the same manner as TReportFiler and TFilePreview. GridHoriz and GridVert define the horizontal and vertical spacing, in inches or metric, between each grid marking drawn with GridPen. RulerType along with the grid settings can be useful during report development for determining accurate placement of items without having to produce printed output. MarginMethod and MarginPercent determine the method and size of the blank margin around the page image. ShadowDepth defines the number of pixels for the page shadow. Monochrome defines whether the output is drawn on a monochrome or color bitmap. PageInc determines how many pages are skipped when calling NextPage or PrevPage. ZoomInc defines the amount that ZoomIn and ZoomOut will use to modify the current zoom percentage, ZoomFactor. Events OnPageChange is called whenever the current page is changed and allows the programmer to update the user interface with the new current page number. OnZoomChange is called whenever the current zoom factor, ZoomFactor, is changed and allows the programmer to update the user interface with the new zoom factor. Example Next well create a preview window and display the output generated from ReportFiler1 in it. 26

Step 1: Use the project from the previous tutorial topic or load up the project TUTOR05 located in \RPPRO\TUTOR\05. Step 2: Place a TFilePreview, TScrollBox and TButton component on the form Step 3: Initialize FilePreview1 as follows: Property FileName MarginPercent ScrollBox ShadowDepth StreamMode Step 4: Initialize Button4 as follows: Property Caption OnClick event Value Preview File
ReportFiler1.Execute; WITH FilePreview1 do begin Start; ZoomFactor := ZoomPageWidthFactor; Finish; end; { with } Label1.Caption := 'File previewed!';

Value TUTOR.RPT 1 ScrollBox1 5 smFile

Now when you press Button4 your project is generating a binary representation of your report and then sending that file to the scroll box. We also added some code to set the zoom factor so that we could see the entire page width in the scroll box. Go ahead and play around with the grid and ruler properties to see how you can enhance the preview screen for report development. For a more indepth example of a fully functional preview screen, look at the file RPPREFRM.PAS located in \RPPRO\SOURCE. This is actually the preview screen used by the TReportSystem component which well get to next.

27

Tutorial

6
TReportSystem component
The TReportSystem component is a very powerful component that integrates the functionality of the previous four components, TReportPrinter, TReportFiler, TFilePrinter and TFilePreview in one easy to use system. TReportSystem can send a report to the printer or a preview screen and can display a setup and status screen as well. Properties DefaultDest is where the report will be sent if no setup screen is used or is the default during setup. SystemFiler, which can be accessed by double-clicking on the left column in the Object Inspector, will display all of the filer type options from TReportFiler, TFilePreview and TFilePrinter. All SystemFiler options operate the same as the other components except for a stream mode of smMemory which does not require a filename and will use a TMemoryStream to contain the report. The SystemOptions properties control the configuration of the TReportSystem component. soUseFiler will always send the report to a report file. This can be very useful if the Macro method has been used in the report. soWaitForOK will determine whether the user has to press the OK button once the report has been generated for output. soShowStatus will determine whether or not the status screen is displayed when the report is being generated or printing. soAllowPrintFromPreview will determine whether the user can print from the preview screen. soPreviewModal determines the modal mode that the preview window is brought up in soNoGenerate will skip over the generation phase of the report and proceed straight to the screen. This options should only be used with a StreamMode of smFile where the report file has been previously generated and needs only to be viewed or printed. SystemPreview displays all of the preview type options found in TFilePreview. SystemPrinter displays all of the printer type options found in TReportPrinter and TReportFiler.

28

The SystemSetups properties control the configuration of the standard setup screen for TReportSystem. ssAllowSetup will determine whether or not the setup screen is displayed. ssAllowCopies, ssAllowCollate and ssAllowDuplex will enable those options in the setup screen. ssAllowDestPreview, ssAllowDestPrinter and ssAllowDestFile will determine which destination options the user has access to. ssAllowPrinterSetup will determine whether the user can select the printer setup dialog which allows the selection of alternate printers and other printer options. ssAllowPreviewSetup determines whether the user will be allowed to select the printer setup dialog after preview. Events All of the OnXxxx events for TReportSystem operate exactly like they do for TReportPrinter and TReportFiler. The override events, OverridePreview, OverrideSetup and OverrideStatus allow the programmer to replace the default screens provided with ReportPrinter Pro with their own. There is no printed documentation on how to do this but the TReportSystem component uses the same method as a user would have to. Reference the methods OverridePreviewProc, OverrideStatusProc and OverrideSetupProc for how to create an override event method. The units RPPREFRM, RPSTAFRM and RPSETFRM located in \RPPRO\SOURCE will also show how to interface with TReportSystem and can be used as starting points for customized versions of the different forms. Example To demonstrate the TReportSystem component well start with a new project and build a simple tabular style report using pure ReportPrinter code without any framework components. Step 1: Start a new project or load up the project TUTOR06 located in \RPPRO\TUTOR\06. Step 2: Place a TReportSystem, TTable and TButton component on the form. Step 3: Initialize Table1 as follows: Property DatabaseName TableName IndexFieldNames Active Value DBDEMOS CUSTOMER.DB CustNo true

29

Step 4: Initialize ReportSystem1 as follows: Property SystemPreview. MarginPercent SystemPreview. ShadowDepth SystemPrinter. MarginBottom SystemPrinter. MarginLeft SystemPrinter. MarginRight SystemPrinter. MarginTop OnBeforePrint OnPrint Value 2.5 5 0.5 0.5 0.5 0.5
Table1.First; WITH Sender as TBaseReport,Table1 do begin ClearTabs; SetTab(1.0,pjCenter,1.0,5,BOXLINEALL,0); SetTab(NA,pjLeft,4.0,5,BOXLINEALL,0); SetTab(NA,pjCenter,1.5,5,BOXLINEALL,0); SetFont('Arial',18); Home; PrintCenter('Customer List', PageWidth / 2.0); NewLine; NewLine; SetFont('Times New Roman',14); AdjustLine; WHILE not EOF do begin TabJustify := tjCenter; Println(#9'No'#9'Name'#9'Phone #'); TabJustify := tjNone; WHILE (LinesLeft > 0) and not EOF do begin PrintTab(FieldByName('CUSTNO').AsString); PrintTab(FieldByName('COMPANY').AsString); PrintTab(FieldByName('PHONE').AsString); NewLine; Next; end; { while } IF not EOF then begin NewPage; end; { if } end; { while } end; { with }

Step 5: Initialize Button1 as follows: Property Caption OnClick event Value Print
ReportSystem1.Execute;

Now when you press Button1 your project brings up a print setup dialog that lets the user choose between all type of options. After the options are selected, a status window is displayed and then the report comes out the printer or goes to a preview screen. Play around with SystemOptions and SystemSetups to see exactly how each one modifies the behavior of TReportSystem. TReportSystem will save you a lot of time with the user interface of reports but still doesnt offer much for the actual report code. For that, we will get into the framework components next.

30

Tutorial

7
TDetailShell component
The TDetailShell component is the simplest of the framework components, so we will start with that. TDetailShell is good for table listing style reports where you still want to code the report, but in a more structured and easier to maintain format. There are 2 main parts to the shell components, the sections and the events. Properties and Events To fully understand how a TDetailShell component works you must understand when the events and sections are used. This is the pseudo-code structure of a TDetailShell report. There are two parts of the report, the body and the rows. OnBodyBefore and OnBodyAfter are normally used for allocating or freeing resources to be used in the report. Before OnBodyHeader is called, the section is initialized by SectionBodyHeader. Then OnBodyHeader can be used for printing a header or title line.

The rows will continue to print while the Valid parameter of OnRowBefore, OnRowPrint or OnRowAfter return true. Typically, OnRowBefore is used for validation of the record that is about to be printed while OnRowAfter is used to go to the next record. The actual printing code for each row should go inside OnRowPrint which will be setup by SectionRow. After the rows are finished printing, the section is setup by SectionBodyFooter and OnBodyFooter is called to print any footer for the report. StartNewPage will determine if NewPage is called between rows. This can be useful for forms that have only one record per page. Note that there is no need to call NewPage if the report sections SectionBodyHeader, SectionBodyFooter and SectionRow have minimum heights defined. In the Object Inspector, doubleclicking on the left column of a report section property will bring up the list of properties while double-clicking on the right column will bring up the easy to use Section Editor. 31

Example For our example of TDetailShell, well go ahead and duplicate the report that was generated with the previous tutorial topic using TReportSystem. Well still use a TReportSystem component to output the report, but all of our report code will be contained and managed by TDetailShell. Step 1: Start a new project or load up the project TUTOR07 located in \RPPRO\TUTOR\07. Step 2: Place a TReportSystem, TDetailShell, TTable and TButton component on the form. Step 3: Initialize Table1 as follows:

Property DatabaseName TableName IndexFieldNames Active

Value DBDEMOS CUSTOMER.DB CustNo true

Step 4: Initialize ReportSystem1 as follows: Property SystemPreview. MarginPercent SystemPreview. ShadowDepth SystemPrinter. MarginBottom SystemPrinter. MarginLeft SystemPrinter. MarginRight SystemPrinter. MarginTop OnPrint Step 5: Initialize Button1 as follows: Property Value Caption Print ReportSystem1.Execute; OnClick event Step 6: Initialize DetailShell1 as follows (Remember: To use the Section Editor, double-click on the right column of a TReportSection property in the Object Inspector): Property SectionBodyHeader. FontIndex SectionRow. MinHeight SectionRow. TabIndex 32 1 1 line 1 Value (use Section Editor - see above) (use Section Editor - see above) (use Section Editor - see above) Value 2.5 5 0.5 0.5 0.5 0.5
DetailShell1.Execute(Sender as TBaseReport);

SectionRow. FontIndex OnBodyBefore

(use Section Editor - see above)

Table1.First; WITH ReportPrinter do begin ClearTabs; SetTab(1.0,pjCenter,1.0,5,BOXLINEALL,0); SetTab(NA,pjLeft,4.0,5,BOXLINEALL,0); SetTab(NA,pjCenter,1.5,5,BOXLINEALL,0); SaveTabs(1); SetFont('Arial',18); SaveFont(1); SetFont('Times New Roman',14); SaveFont(2); end; { with } WITH ReportPrinter do begin PrintCenter('Customer List', PageWidth / 2.0); NewLine; NewLine; end; { with } WITH ReportPrinter,Table1 do begin IF ReportShell. IsNewPage then begin TabJustify := tjCenter; Println(#9'No'#9'Name'#9'Phone #'); TabJustify := tjNone; end; { if } PrintTab(FieldByName('CUSTNO').AsString); PrintTab(FieldByName('COMPANY').AsString); PrintTab(FieldByName('PHONE').AsString); NewLine; end; { with } Table1.Next; Valid := not Table1.EOF;

OnBodyHeader

OnRowPrint

OnRowAfter

Thats it! Press Button1 and you should get exactly the same output as you did in the previous tutorial. There were a few more event handlers to initialize this time but the report is much more maintainable and easier to understand since we have split the functionality into separate groups. OnBodyBefore is responsible for setting up the items used in the report. OnBodyHeader only has to have code that prints the title of the report. OnRowPrint contains only printing statements to print the column headers (if this is the first row on a new page) and the current row of data. And finally, OnRowAfter only has to increment the table record and see if we are at the end of the table. One point to make is that since ReportPrinter Pro is a code based report writer, you have possibilities that you would not have with any other system. The code for OnBodyHeader and OnRowAfter would be very similar for most of the table listing reports in an application so you could create a single event handler that all of the framework components would reference. For example, in OnBodyBefore you could initialize a public string variable to the title of the report, then in OnBodyHeader you would print that variable instead of the actual title. Then if your customers all of a sudden change the report layouts (that never happens does it?) to include the current page number at the top right hand corner of each page, you would only have to change the code in one place and all reports using that event handler would be automatically updated! We didnt spend much time on the report sections, SectionBodyHeader, SectionBodyFooter and SectionRow. Theres a lot of power hidden in these classes so well look at the TReportSection class in more detail next.

33

Tutorial

8
TReportSection component
TReportSection is a class that helps to define the section properties, SectionLeft, SectionRight, SectionTop and SectionBottom. It also can be used to define the selected font and tab settings as well as force a new page if there is not enough room on the current page.

Shown above is the Section Editor which is displayed whenever you double-click in the Object Inspector on the right columns of a TReportSection property. The most noticeable feature is the page display which visually shows you (although not to scale) how the section is being calculated. The Distance edit boxes for the left, right, top and bottom sides all control how far, in units, the section side is from the landmark defined in the From combo boxes. All sides can be measured from the page or the margins. Also, the right and bottom sections can be measured from the left and top sections respectively and the top section can be measured from the current cursor position. Having the top section measured from the previous line (current cursor) is the method that should be used for sections that you want to follow the previous section, while having it measured from the margin 34

or page would be the setting to use for headers or footers that will always appear in the same location on the page. The bottom section should reference the lowest point that SectionBottom can be placed, while the minimum height defines what the minimum distance between SectionTop and SectionBottom is allowed to be before a new page is generated. The minimum height can be measured in lines of text (see LineHeight) or in units. The tab and font indexes, if non-zero, will load up the tabs or font that were previously saved with SaveTabs or SaveFont. A TReportSection component can be completely disabled by clicking the Enabled checkbox off. All of these options can also be edited directly by double-clicking, in the Object Inspector, on the left column of a TReportSection property. TReportSection allows you to define many aspects for a section of a report and is used heavily by the shell components, TDetailShell, TMasterShell, TReportShell and TLabelShell, as well as, by the table printer components, TDBTablePrinter and TTablePrinter. Well move on to the next shell component, TMasterShell, and show you how you can link two components together for a masterdetail relationship.

35

Tutorial

9
TMasterShell component
The TMasterShell component is the next shell component in ReportPrinter Pro well discuss and provides a good balance between simplicity and functionality. It adds the concept of groups and detail sections to the structure that was presented for TDetailShell. Properties As you can see from the diagram at the right, the body of the report is still the same but where the TDetailShell only printed rows, TMasterShell prints groups. A group is defined as a row plus an optional detail section. Each detail section is actually a complete body of another shell component that contains its own row and possibly other detail sections. DetailReport can point to any other TMasterShell or TDetailShell component and defines the report body that will be printed in the detail section of the report. Reprint defines whether or not the group header will be reprinted if the detail

section has to generate a new page. SectionGroupHeader and SectionGroupFooter define the section properties for the group header and footer while the remaining properties are the same as they are in TDetailShell. 36

Events The OnBodyXxxx and OnRowXxxx events are the same as they are in TDetailShell. OnGroupBeforeFirst is called before the first group and OnGroupAfterLast is called after the last group. OnGroupBefore and OnGroupAfter are called before and after each group. OnGroupHeader and OnGroupFooter are called before and after each group but only after Section-GroupHeader and SectionGroupFooter have set the page up. OnDetailBefore and OnDetailAfter are called before and after DetailReport is executed. Example For this example well create a master-detail report with a lookup using a TMasterShell and a TDetailShell component. Well be using this report as a detail section in the example for TReportShell later when we build a master-detail-detail report. Step 1: Start a new project or load up the project TUTOR09 located in \RPPRO\TUTOR\09. Step 2: Place a TReportSystem, TDetailShell, TMasterShell, three TTable components and a TButton component on the form.

Step 3: Initialize Table1 as follows: Property DatabaseName TableName IndexFieldNames Active Step 4: Initialize Table2 as follows: Property DatabaseName TableName IndexFieldNames Active Value DBDEMOS ITEMS.DB OrderNo true Value DBDEMOS ORDERS.DB OrderNo true

37

Step 5: Initialize Table3 as follows: Property DatabaseName TableName IndexFieldNames Active Value DBDEMOS PARTS.DB PartNo true

Step 6: Initialize ReportSystem1 as follows: Property SystemPreview. MarginPercent SystemPreview. ShadowDepth SystemPrinter. MarginBottom SystemPrinter. MarginLeft SystemPrinter. MarginRight SystemPrinter. MarginTop OnPrint Step 7: Initialize Button1 as follows: Property Caption OnClick event Value Print
ReportSystem1.Execute;

Value 2.5 5 0.5 0.5 0.5 0.5


MasterShell1.Execute(Sender as TBaseReport);

Step 8: Initialize MasterShell1 as follows: Property DetailReport SectionRow. MinHeight SectionRow. TabIndex SectionRow. FontIndex OnBodyBefore Value DetailShell1 1 line 1 1
Table1.First; WITH ReportPrinter do begin ClearTabs; SetTab(1.5,pjCenter,1.0,5,BOXLINEALL,10); SetTab(NA,pjCenter,2.0,5,BOXLINEALL,10); SetTab(NA,pjCenter,2.0,5,BOXLINEALL,10); SaveTabs(1); ClearTabs; SetTab(2.0,pjCenter,0.5,5,BOXLINELEFTRIGHT,0); SetTab(NA,pjLeft,2.5,5,BOXLINELEFTRIGHT,0); SaveTabs(2); SetFont('Arial',12); SaveFont(1); SetFont('Times New Roman',10); SaveFont(2); end; { with }

38

OnRowPrint

OnGroupAfter Step 9: Initialize DetailShell1 as follows: Property SectionRow. MinHeight SectionRow. TabIndex SectionRow. FontIndex OnBodyBefore

WITH ReportPrinter,Table1 do begin IF ReportShell. IsNewPage then begin TabJustify := tjCenter; Println(#9'Order #'#9'Sold'#9'Shipped'); TabJustify := tjNone; end; { if } PrintTab(FieldByName('ORDERNO').AsString); PrintTab(FieldByName('SALEDATE').AsString); PrintTab(FieldByName('SHIPDATE').AsString); NewLine; end; { with } Table1.Next; Valid := not Table1.EOF;

Value 1 line 2 2
WITH Table1 do begin Table2.SetRange( [FieldByName('ORDERNO').AsInteger], [FieldByName('ORDERNO').AsInteger]); Table2.First; end; { with } WITH ReportPrinter,Table2 do begin IF ReportShell. IsNewPage then begin TabJustify := tjCenter; Underline := true; Println(#9'Qty'#9'Description'); Underline := false; TabJustify := tjNone; end; { if } PrintTab(FieldByName('QTY').AsString); IF Table3.FindKey( [FieldByName('PARTNO').AsInteger]) then begin PrintTab(Table3. FieldByName('DESCRIPTION').AsString); end else begin PrintTab('(unknown)'); end; { else } NewLine; end; { with } Table2.Next; Valid := not Table2.EOF;

OnRowPrint

OnGroupAfter

This ends up being a fairly long report so you may only want to preview the report instead of printing. Our reports are getting more powerful, but we havent even begun to touch the power that ReportPrinter Pro has to offer. Whenever a new command is used, make sure to read the information found on it in the reference section to see all the different ways it can be used.

39

Tutorial

10
TReportShell component
The next shell component well look at is the TReportShell component. TReportShell is very similar to a TMasterShell component, but adds report and page headers and footers.

Properties The body of the report remains exactly the same as a TMasterShell component. DetailReport can point to other TMasterShell or TDetailShell components but not to other TReportShell components. SectionPageHeader and SectionPageFooter will normally be defined in a specific spot on the page by declaring the top distance to be from the margin or the page and not from the last cursor position which is the default. SectionReportHeader and SectionReportFooter are used to set up the printable section before and after the report. All remaining properties are the same as they are in TMasterShell.

40

Events The OnBodyXxxx, OnDetailXxxx, OnGroupXxxx and OnRowXxxx events are the same as they are in TMasterShell. OnReportBefore is called before OnReportHeader is called to print the report header. OnPageBefore is called before OnPageHeader is called to print the page header and both are called at the beginning of each page including the first page of the report. OnPageFooter is called to print the page footer followed by OnPageAfter at the end of each page including the last page of the report. OnReportFooter is called to print the footer of the report followed by OnReportAfter. Since you are presented with so many possible event handlers, its important to note that not every event handler will or should be used for most reports. Take advantage of the differences between each handler to organize your reporting code in an efficient and easy to maintain manner. Example Well start this example where we left off the previous example by adding a TReportSystem component to be a master to the TMasterShell and TDetailShell component. After were done well have a master-detail-detail report with a lookup.

Step 1: Use the project from the previous tutorial or load up the project TUTOR10 located in \RPPRO\TUTOR\10. Step 2: Add a TReportShell and TTable component on the form. Step 3: Alter Table1 as follows:

Property IndexFieldNames Step 4: Initialize Table4 as follows: Property DatabaseName TableName IndexFieldNames Active

Value CustNo

Value DBDEMOS CUSTOMER.DB CustNo true

41

Step 5: Alter ReportSystem1 as follows: Property OnPrint Value


ReportShell1.Execute(Sender as TBaseReport);

Step 6: Initialize ReportShell1 as follows: Property DetailReport SectionRow. MinHeight SectionRow. TabIndex SectionRow. FontIndex OnReportBefore Value MasterShell1 1 line 3 3
Table4.First; WITH ReportPrinter do begin ClearTabs; SetTab(1.5,pjCenter,1.0,5,BOXLINEALL,10); SetTab(NA,pjCenter,2.0,5,BOXLINEALL,10); SetTab(NA,pjCenter,2.0,5,BOXLINEALL,10); SaveTabs(1); ClearTabs; SetTab(2.0,pjCenter,0.5,5,BOXLINELEFTRIGHT,0); SetTab(NA,pjLeft,2.5,5,BOXLINELEFTRIGHT,0); SaveTabs(2); ClearTabs; SetTab(1.0,pjCenter,1.0,5,BOXLINEALL,100); SetTab(NA,pjLeft,4.0,5,BOXLINEALL,100); SetTab(NA,pjCenter,1.5,5,BOXLINEALL,100); SaveTabs(3); SetFont('Arial',12); SaveFont(1); SetFont('Times New Roman',10); SaveFont(2); SetFont('Arial',18); FontColor := clWhite; SaveFont(3); end; { with } WITH ReportPrinter,Table4 do begin IF ReportShell. IsNewPage then begin TabJustify := tjCenter; Println(#9'No'#9'Name'#9'Phone #'); TabJustify := tjNone; end; { if } PrintTab(FieldByName('CUSTNO').AsString); PrintTab(FieldByName('COMPANY').AsString); PrintTab(FieldByName('PHONE').AsString); NewLine; end; { with } Table4.Next; Valid := not Table4.EOF;

OnRowPrint

OnGroupAfter

42

Step 7: Alter MasterShell1 as follows: Property OnBodyBefore Value


WITH Table4 do begin Table1.SetRange( [FieldByName('CUSTNO').AsInteger], [FieldByName('CUSTNO').AsInteger]); Table1.First; end; { with }

There you go, your first master-detail-detail report with ReportPrinter Pro. In a later tutorial well reproduce this same report using the TablePrinter components without any code at all. You should have noticed that we moved the initialization code from MasterShell1 to ReportShell1. The initialization code that was in MasterShell1.OnBeforeBody could have stayed there (with the addition of the new code we added) but it would have been executed for each row in ReportShell1. There probably would not be any noticeable speed difference, but it is good programming practice to set up all items for the report in one place. You should also have noticed that we used SetRange and FindKey on some of the tables. These are methods of the TTable component and are documented in Delphis documentation or help files.

43

Tutorial

11
TLabelShell component
The last shell component is a specialized one that will help with label style reports. There are many predefined formats or you can create a completely custom one. TLabelShell gets it power from OriginX and OriginY. Using these properties to change the upper left hand corner of the page to the upper left hand corner of each label, your reporting code will use the exact same positions for each label on the page. Properties Border is the margin, in units, that will be around the edges of each label. DrawExtents will determine whether the edges of the label are drawn on the report with DrawPen. These label extents can be useful for aligning data on the labels without having to print on actual labels or holding printouts up to the light. DrawPreviewOnly will determine whether label extents appear on the preview screen only, or on both the preview screen and the printer. LabelBrand is the brand of Avery labels that you may be using. If you do not find your brand then you will need to define the label characteristics yourself. LabelWidth and LabelHeight are the width and height of the actual label and are used to draw the label extents. NumAcross and NumDown define how many labels are across and down the page. PrintByRow will determine whether TLabelShell processes labels by rows or by columns. SpacingHeight is the vertical spacing between the top edges of two adjoining labels. SpacingWidth is the horizontal spacing between the left edges of two adjoining labels. SpacingLeft defines the spacing between the left edge of the paper and the left-most label. SpacingTop defines the spacing between the top edge of the paper and the top-most label. Whenever LabelWidth, LabelHeight, NumAcross, NumDown or SpacingXxxx are modified LabelBrand will automatically change to lbCustom.

44

Events OnReportBefore and OnReportAfter are called before and after the entire report. OnPageBefore and OnPageAfter are called before and after each page. OnLabelBefore is called before OnLabelPrint which is followed by OnLabelAfter for each label on the page until a false Valid parameter is passed back. The report sections, SectionLeft, SectionRight, SectionTop and SectionBottom will be set to the printable area of the label before each call to OnLabelPrint and the origins, OriginX and OriginY, will be set to the top left hand corner of the label. Example Well do a simple mailing list from our customer database. Youll be able to see some of the power of ReportPrinter Pro when we can use Object Pascal to format our labels exactly the way that we want them. Step 1: Start a new project or load up the project TUTOR11 located in \RPPRO\TUTOR\11. Step 2: Place a TReportSystem, TLabelShell, TTable and TButton component on the form. Step 3: Initialize Table1 as follows: Property DatabaseName TableName IndexFieldNames Active Value DBDEMOS CUSTOMER.DB Company true

Step 4: Initialize ReportSystem1 as follows: Property SystemPreview. MarginPercent SystemPreview. ShadowDepth OnPrint Step 5: Initialize Button1 as follows: Property Caption OnClick event Value Print
ReportSystem1.Execute;

Value 2.5 5
LabelShell1.Execute(Sender as TBaseReport);

45

Step 6: Initialize LabelShell1 as follows: Property Border DrawExtents LabelBrand OnReportBefore OnLabelPrint Value 1.0 true lbAV5164

(Notice all the other values change)

Table1.First; ReportPrinter. SetFont('Arial',18); WITH ReportPrinter,Table1 do begin YPos := 1.0; Println(FieldByName('COMPANY').AsString); IF FieldByName('ADDR1').AsString <> '' then begin Println(FieldByName('ADDR1').AsString); end; { if } IF FieldByName('ADDR2').AsString <> '' then begin Println(FieldByName('ADDR2').AsString); end; { if } Print(FieldByName('CITY').AsString); IF FieldByName('STATE').AsString <> '' then begin Print(', ' + FieldByName('STATE').AsString); end; { if } IF FieldByName('ZIP').AsString <> '' then begin Print(' ' + FieldByName('ZIP').AsString); end; { if } NewLine; If FieldByName('COUNTRY').AsString <> 'US' then begin Println(UpperCase( FieldByName('COUNTRY').AsString)); end; { if } end; { with } Table1.Next; Valid := not Table1.EOF;

OnLabelAfter

Notice that when you preview these labels, you can see the label sides drawn on the screen as well but if you print them out there are no label sides (unless you set LabelShell1.DrawPreviewOnly to false). Hows that for quick, easy and powerful labels. Notice also that we are skipping blank address fields and changing the output depending on if it is a United States address or not. (Of course, if you werent in the U.S., you would want to do this a little differently). Now that youve got all of the shell components under your belt, well move on to the really powerful stuff. First well cover the memo buffer classes, TMemoBuf and TDBMemoBuf, then well go to the table printer components, TDBTablePrinter and TTablePrinter. You may wonder why there are two different types of these classes. The reason is that ReportPrinter Pro was designed so that it can be used with or without the Borland Database Engine (BDE). The Delphi VCL is designed in such a way that including a component that has database type properties, such as TField or TDataSet, in your project will have the effect of requiring the BDE to be loaded, whether you use those properties or not. For this reason, the non-database classes, TMemoBuf and TTablePrinter, have no such properties and can be used safely in non-BDE applications. 46

Tutorial

12
TMemoBuf/TDBMemoBuf component
TMemoBuf is a powerful class that is designed to store large amounts of text, that, along with PrintMemo, MemoLines and GetMemoLine, output text that is justified and word wrapped within a column. To use a TMemoBuf you must include RPMEMO in the uses statement. To use a TDBMemoBuf you must include RPMEMO and RPDBUTIL in the uses statement. Properties Field which is a property of only TDBMemoBuf will load the memo buffer with the contents of a TMemoField component. You can create a TMemoField component from a TTable component by double clicking on the TTable component and adding the memo field to the list of fields in the field editor. SetData, LoadFromStream, Memo and Text are other methods that can be used to initialize the memo buffer from a variety of sources. Once the memo buffer is loaded, it can be edited with Append, Insert, Delete and ReplaceAll. SearchFirst and SearchNext can be used to search for text in the memo buffer. SaveBuffer and RestoreBuffer can be used to save and restore the memo buffer to a secondary buffer which can be useful for mail-merge form letters. PrintStart and PrintEnd define the left and right sides that the memo buffer will be word-wrapped within. Justify defines the justification of the memo buffer between PrintStart and PrintEnd. NoCRLF will control whether or not a line feed is added to the end of the memo buffer when it is printed. Use the TReportPrinter and TReportFiler methods PrintMemo, MemoLines and GetMemoLine to output the contents of a memo buffer to the report. Example For this example well load a form letter from a text file, then use the customer database to print out a mail-merge letter to all of those customers. Step 1: Start a new project or load up the project TUTOR12 located in \RPPRO\TUTOR\12. Step 2: Place a TReportSystem, TDetailShell, TTable and TButton component on the form. Step 3: Place RPMemo in the Uses statement and add the line MemoBuf: TMemoBuf; to the form definition to create a memo buffer (in either the public or private section). Step 4: Initialize Table1 as follows: Property DatabaseName TableName IndexFieldNames Active Value DBDEMOS CUSTOMER.DB Company true

47

Step 5: Initialize Button1 as follows: Property Caption OnClick event Value Print
ReportSystem1.Execute;

Step 6: Initialize ReportSystem1 as follows: Property SystemPreview. MarginPercent SystemPreview. ShadowDepth SystemPrinter. MarginBottom SystemPrinter. MarginLeft SystemPrinter. MarginRight SystemPrinter. MarginTop OnPrint Value 2.5 5 1 1 1 1
var FileStream: TFileStream; begin MemoBuf := TMemoBuf. Create; TRY FileStream := TFileStream. Create('TUTOR12.TXT', fmOpenRead or fmShareDenyWrite); TRY MemoBuf. LoadFromStream(FileStream,0); finally FileStream. Free; end; { tryf } MemoBuf. SaveBuffer; Table1.First; DetailShell1.Execute(Sender as TBaseReport); finally MemoBuf. Free; end; { tryf } end;

NOTE: The filenameTUTOR12.TXT, which contains the form letter contents, should reside in the default directory for the above source code to work.

48

Step 7: Initialize DetailShell1 as follows: Property StartNewPage OnRowBefore OnRowPrint Value True
Valid := (Table1. FieldByName('LASTINVOICEDATE').AsDateTime < EncodeDate(1994,1,1)); WITH ReportPrinter do begin WITH MemoBuf,Table1 do begin PrintStart := SectionLeft; PrintEnd := SectionRight; RestoreBuffer; ReplaceAll('%COMPANY%', FieldByName('COMPANY').AsString, false); ReplaceAll('%CUSTNO%', FieldByName('CUSTNO').AsString, false); ReplaceAll('%LASTDATE%', DateToStr( FieldByName('LASTINVOICEDATE'). AsDateTime),false); ReplaceAll('%CONTACT%', FieldByName('CONTACT').AsString, false); Reset; SetFont('Times New Roman',14); Home; PrintMemo(MemoBuf, 0, false); end; { with } end; { with } Table1.Next; Valid := not Table1.EOF;

OnRowAfter

You should note several important items in this report. This first is that we are using a TDetailShell component to print a form type of report by having StartNewPage set to true. This means that we will have a new page generated for each row we print. We are also only printing the records that are older than 1/1/94. This is done by the code in OnRowBefore for DetailShell1. The same thing could have been accomplished by using a TQuery with an SQL statement, but for the database size this method is quite a bit easier and more than adequate. The last thing is that the memo buffer is created and initialized before DetailShell1 is executed, and then freed within the finally part of a try-finally exception handler. The text file TUTOR.TXT which is provided in \RPPRO\TUTOR\12 could have come from a database field or could have been created at runtime using a TMemo or other text component. Theres a lot of flexibility with ReportPrinter Pro. Next well look at the most powerful components in ReportPrinter Pro, the table printers TDBTablePrinter and TTablePrinter. Youll see that they use memo buffers quite heavily internally.

49

Tutorial

13
TDBTablePrinter component
The TDBTablePrinter component has the capability to generate table style listings with little to no code required. You can even link multiple table printers together for masterdetail relationships to multiple levels. The table printers get their flexibility from two other components, TDBTableColumn and TTableSection. TDBTableColumns are responsible for all the properties and events for a single column of data while the TTableSections are responsible for all headers and footers. Note: This tutorial does not generate any output and is intended as a preliminary step for Tutorials 14 and 15. Properties DataSet references the TTable or TQuery component that is to be printed. DetailKey along with MasterKey define the master and detail field names that will be used to build the set of detail records. DetailTablePrinter defines the TDBTablePrinter that will be printed in the detail section. For example, if there were 2 table printers TP1 and TP2 and TP1 was the master (or parent) of TP2 (the detail or child) then TP1.DetailTablePrinter would be set to TP2. Also TP2.MasterKey would be the field name in TP1.DataSet that would form the 1 to many relationship with the field named TP2.DetailKey in TP2.DataSet. Pen and Font are the default pen and font used by all TTableSection and TDBTableColumn components owned by this table printer. ReprintHeader will cause the group header to be reprinted if the detail section has to generate a new page. StartPos defines the starting left side position for the first column of the table printer. The structure for a TDBTablePrinter is very similar to a TReportShell component (see Tutorial 10). Events Normally you will not need to override any of these event handlers, but they are provided in case you want to provide extra functionality in your report. OnInitTable is called to initialize any items for the report. OnInitMaster is called for a detail table printer when its master (or parent) has changed to a different row and needs the detail table printer to re-initialize for the new key. OnValidateRow is called before each row is printed to validate that the row is valid for printing. 50

OnGetNextRow is called to get the next row of data and to check to see if the end of the table has been reached. Example For this example well create the same master-detail-detail report that we did for the TReportShell component (see Tutorial 10). We just start the report and finish it up with tutorials 14 and 15. Step 1: Start a new project or load up the project TUTOR13 located in \RPPRO\TUTOR\13. Step 2: Place a TReportSystem, three TDBTablePrinters, four TTables and a TButton component on the form. Step 3: Initialize Table1 as follows: Property DatabaseName TableName IndexFieldNames Step 4: Initialize Table2 as follows: Property DatabaseName TableName Step 5: Initialize Table3 as follows: Property DatabaseName TableName Step 6: Initialize Table4 as follows: Property DatabaseName TableName Step 7: Initialize Button1 as follows: Property Caption OnClick event Value Print
ReportSystem1.Execute;

Value DBDEMOS CUSTOMER.DB CustNo

Value DBDEMOS ORDERS.DB

Value DBDEMOS ITEMS.DB

Value DBDEMOS PARTS.DB

51

Step 8: Initialize ReportSystem1 as follows: Property SystemPreview. MarginPercent SystemPreview. ShadowDepth SystemPrinter. MarginBottom SystemPrinter. MarginLeft SystemPrinter. MarginRight SystemPrinter. MarginTop OnPrint Value 2.5 5 0.5 0.5 0.5 0.5
DBTablePrinter1.Execute(Sender as TBaseReport);

Step 9: Initialize DBTablePrinter1 as follows: Property DataSet DetailTablePrinter Font. Name Font. Size Font. Color StartPos Value Table1 DBTablePrinter2 Arial 18 ClWhite 1.0

Step 10: Initialize DBTablePrinter2 as follows: Property DataSet DetailKey DetailTablePrinter Font. Name Font. Size MasterKey StartPos Value Table2 CustNo DBTablePrinter3 Arial 12 CustNo 1.5

Step 11: Initialize DBTablePrinter3 as follows: Property DataSet DetailKey Font. Name Font. Size MasterKey StartPos Table3 OrderNo Times New Roman 10 OrderNo 2.0 Value

Thats all we can do for now until we get into the TDBTableColumns and TDBTableSections in the next tutorials. Since there are no columns defined, this report will not produce any output.

52

Tutorial

14
TDBTableColumn component
TDBTableColumn has no icon and can only be created through the Table Editor. Once created TDBTableColumn components can be selected using the Object Inspector selection combo box or by clicking on the appropriate column in the Table Editor. To access the Table Editor, double-click on a TDBTablePrinter component or right-click on a TDBTablePrinter component and select Table editor. Properties BoxLines determines which lines are drawn around each row box for this column and ShadeColor and ShadePercent determine the color to fill the row box. Description is a design time only field that will be the identifier displayed in the Table Editor for this column. FieldName is the field name that this column will get its data from using the TField. AsString property. Font and Pen are the font and pen that will be used if UseParentFont and UseParentPen are false. Heading is the text that will appear in any headings for this column. Justify and JustifyVert are the horizontal and vertical justifications of the data within the row box. The contents of the column can be retrieved from a lookup table and will be the field specified by LookupDisplay in the table LookupDataSet. The 1 to 1 relationship for a lookup is defined by FieldName and LookupKey. Margin100 is the distance in 1/100ths of an inch that the data will be from the sides of the row box. Margin will be always be equal to Margin100 / 100.0. OverflowMethod defines what the column will do if the entire contents of the column cannot fit into one line. MinFontSize is the minimum font size that the font will be set to when using and overflow method of omShrink. OverflowAppend is the string that will be appended to any data that is truncated because of overflow. OverflowReplace is the string that will replace the column data if an overflow takes place. SplitRow defines whether or not a row box can be split into individual lines if it will not all fit on one page. Totals, if true, will keep track of totals for each value in the column. Width is the width, in units, of the column.

53

Events As with TDBTablePrinter, these events should not normally need to be overridden, but are provided so that you can further enhance the functionality of each column. OnAddTotal is called whenever it is time to add the current row to the running totals PageTotal, SubTotal and GrandTotal. OnInitMaster is called whenever a new master record has been selected and is usually a good place to reinitialize SubTotal. OnInitPage is called at the beginning of each page and is usually a good place to reinitialize PageTotal. Before continuing with the rest of the event handlers it is important to understand a few things about how table column components work. TDBTablePrinter processes each row of columns in two phases. The first is to gather the data and determine how high the row needs to be. The second phase is to output the data for each column, splitting the rows if necessary across pages. There are three sections to each column, the header, the rows and the footers. There are also 3 different types of default footers, subtotals, page totals and grand totals. The headers and footers are handled by the TTableSection components which are explained in the next tutorial. The OnHeaderBefore and OnHeaderAfter events are called before and after each header. OnHeaderSetup is called to format the header data while OnHeaderPrint is called to print the header data. The OnFooterXxxx events operate the same as the OnHeaderXxxx events. OnRowBefore and OnRowAfter are called before and after each row. OnRowSetup is called after TDBTableColumn. MemoBuf has been filled with the default data and is a good place to format or replace MemoBufs contents. OnRowHeight is called if the programmer wants to override the default setting for the height of the row. OnRowPrint is called to output the contents of each row. The programmer can call PrintDefault to print the default contents of a row from within a OnRowPrint event. Example Continuing the example from the previous tutorial, well go ahead and add the table columns to each TDBTablePrinter component. Step 1: Double-click on DBTablePrinter1, select the Columns tab and add three columns, Customer Number, Company Name and Phone Number. Step 2: Initialize the Customer Number column as follows by selecting it in the Table Editor and changing the properties in the Object Inspector: Property FieldName Heading Justify 54 CustNo No pjCenter Value

ShadePercent

100

Step 3: Initialize the Company Name column as follows: Property FieldName Heading ShadePercent Width Value Company Name 100 4.0

Step 4: Initialize the Phone Number column as follows: Property FieldName Heading Justify ShadePercent Width Value Phone Phone # pjCenter 100 1.5

Step 5: Double-click on DBTablePrinter2, select the Columns tab and add three columns, Order Number, Sold Date and Shipped Date. Step 6: Initialize the Order Number column as follows: Property FieldName Heading Justify ShadePercent Value OrderNo Order pjCenter 10

Step 7:Initialize the Sold Date column as follows: Property FieldName Heading Justify ShadePercent Width Value SaleDate Sold pjCenter 10 2.0

Step 8: Initialize the Shipped Date column as follows: Property FieldName Heading Justify ShadePercent Width Value ShipDate Shipped pjCenter 10 2.0 55

Step 9: Double-click on DBTablePrinter3, select the Columns tab and add two columns, Quantity and Description. Step 10: Initialize the Quantity column as follows: roperty BoxLines FieldName Heading Justify Width Total blLeftRight Qty Qty pjCenter 0.5 True Value

Step 11: Initialize the Description column as follows: Property BoxLines FieldName Heading LookupDataSet LookupDisplay LookupKey Width Value blLeftRight PartNo Description Table4 Description PartNo 2.5

Go ahead and run it now. Youll see a nice looking master-detail-detail report very similar to the one that was built in with TReportShell only theres no headers for the rows. Well get to that in the next tutorial when we cover TTableSections.

56

Tutorial

15
TTableSection component
TTableSection, like TDBTableColumn, also has no icon and can only be created through the Table Editor. Once a TTableSection component is created, it can be selected by using the Object Inspector selection combo box or by clicking on the appropriate section in the Table Editor. Properties Most of the properties function in the same manner as they do for TDBTableColumn. SectionType is the type of table section that this TTableSection component is and cannot be changed. OutputType determines what type of information will be printed in this header or footer. Section is the TReportSection that will control the formatting for this table section. Events These events will not normally need to be overridden but are provided so that you can further enhance the functionality of TTableSection. OnBefore and OnAfter are called before and after the table section will print. OnSetup will be called after the section has been initialized to allow the programmer to customer the height or data that will be printed. OnPrint will be called to output the data for the table section. The programmer can call PrintDefault to print the information that would have normally been printed. Example To continue our project from the previous example, well go ahead and add headers to all of the tables as well as a total line for the quantity of items purchased.

57

Step 1: Double-click on DBTablePrinter1, select the Headers/Footers tab and activate the Group Header by selecting that line in the Available list box and clicking on the single left arrow speed button to move it to the Active list box. Step 2: Initialize the Group Header section as follows by selecting it in the Table Editor and changing the properties in the Object Inspector: Property OutputType ShadePercent Value otHeadings 100

Step 3: Double-click on DBTablePrinter2, select the Headers/Footers tab and activate the Group Header section by selecting that line in the available listbox and clicking on the single left arrow speed button. Step 4: Initialize the Group Header section as follows: Property OutputType ShadePercent Value otHeadings 10

Step 5: Double-click on DBTablePrinter3, select the Headers/Footers tab and activate the Group Header and Body Footer sections by selecting those lines in the available listbox and clicking on the single left arrow speed button. Step 6: Initialize the Body Header section as follows: Property OutputType Value otHeadings

Step 7: Initialize the Body Footer section as follows: Property OutputType Font. Name Font. Size Font. Style Value otSubTotals Times New Roman 12 Bold

Step 8:Set the Total property for the Quantity table column to true. Youre done. When you run this (hopefully to the preview screen since it takes many pages) you should see a master-detail-detail report with headings and totals on the quantity of items for each order, all with no code at all! Theres a lot you can do to customize this report by adding report headers or changing the output of the quantity subtotals to a different format. Play around with all of the different settings. We didnt touch upon it much here, but where TDBTablePrinter can really save you a lot of work is in printing multi-line rows of information. Theres a lot of power in the different value for OverflowMethod so try them out with some data that overflows the column and see what happens. 58

Tutorial

16
TTablePrinter/TTableColumn component
TTablePrinter and TTableColumn are the nondatabase counterparts to TDBTablePrinter and TDBTableColumn. One difference between the two sets of components is the obvious lack of database type properties in TTablePrinter and TTableColumn. The other difference is that the event handlers will be used quite a bit more extensively to provide the data to the table printer component from whatever data source it is coming from. The most common event handlers that will be overridden for TTablePrinter are OnInitTable and OnGetNextRow, and for TTableColumn they are OnAddTotal, OnRowSetup and OnRowHeight. For more information, look at the demo projects included with ReportPrinter Pro for a more detailed example of how to use TTablePrinter.

59

Tutorial

17
Fonts and the Text Line
Understanding how the text cursor and text works is central to creating great reports with ReportPrinter Pro. As you can see from the diagram on the right, there are several different parts to a text line. The text line itself can be positioned by assigning a value to LineTop, LineMiddle, LineBottom, FontTop, FontBaseline or FontBottom. The font settings FontTop, FontBaseline and FontBottom are all measured using the Line Font. The Line Font is defined as the font settings that were active the last time that the vertical cursor changed position (NewLine, Println, YPos := 3.5,) or when the line height is reset (ResetLineHeight or AdjustLine). The diagram at the right details the relationship between the heights of the different pieces of the text line. AscentHeight and DescentHeight are based on the current line font (described before). LineHeight, if set to lhmFont, will only change if the current line font changes (which only happens if the vertical cursor changes or ResetLineHeight is called). The default alignment for text is on the baseline but may be changed with FontAlign. After a text string is printed the cursor will be left at the right edge of the text. Use PrintCenter, PrintRight or PrintBlock to print text with different horizontal alignments. Fonts may be rotated to any degree from 0 to 360. Normal horizontal text has a rotation of 0. Vertical text with the top facing left has a rotation of 90. Upside-down text has a rotation of 180 and vertical text with the top facing right has a rotation of 270. The text cursor is always left at the end of the text that was printed. This allows a line of text to be printed in pieces but still appears as a continuous line. Line feeds (NewLine, Println), however, will not adjust the cursor by taking into account the current rotation.

60

Tutorial

18
Margins, Sections and Waste Areas
Margins, Sections and Waste may appear to be similar, but there are significant differences. The waste values (LeftWaste, RightWaste, TopWaste and BottomWaste) are retrieved from the printer driver to find out the margins of unprintable area for the page. Most dot matrix printers will not have any waste margins. Laserjet printers may have waste margins from 0.22 to 0.5 inches. And some inkjet printers may have waste margins up to 0.75 inches. Almost every printer is different so it is important to pay attention to the waste areas if you are printing close to the edges of the page. The Margin and Section values are a little closer in definition. Margins, MarginLeft, MarginRight, MarginTop and MarginBottom serve as a reference for where the sections reset to. Whenever any margin value is changed the corresponding section value is automatically reset to the new margin setting. Sections SectionLeft, SectionRight, SectionTop and SectionBottom control where the text cursor begins each new line, SectionLeft, and where line one begins, SectionTop. Sections are also used during SetColumns or SetColumnWidth to determine how wide or how many columns can fit between SectionLeft and SectionRight. So, as you can see, the section values determine the area on your page where you have told ReportPrinter that you are going to print. The section settings are reset to their corresponding margin references whenever the method ResetSection is called or a new page is begun. Note that sections are always measured from the top or left sides of the page while margins are measured from the closest side of the page.

61

Tutorial

19
Columns
In ReportPrinter, Columns are used to print a stream of text in evenly spaced columns across the page (often called snaking columns). Columns are defined by the methods SetColumns and SetColumnWidth and are undefined by the method ClearColumns. You can reference the properties ColumnStart, ColumnEnd, ColumnWidth, Columns and ColumnNum to find out more about the current column settings. To change the current column, set the desired value to the property ColumnNum (this will only change the horizontal cursor position and not the vertical). During a call to Println or NewLine, if the text cursor passes below the current SectionBottom, it will automatically be placed at the top of the next column. There are two methods, LinesLeft and ColumnLinesLeft that will return the number of lines left in the current column and the number of lines left in all remaining columns respectively. There is a special event handler to deal with new columns called OnNewColumn. This event handler will be called whenever SetColumns or SetColumnWidth is called as well as when the text cursor wraps over to a new column from a call to Println or NewLine. This event handler can be useful for printing column headers. Tabs and memos can be combined with columns, so that if the text cursor is on a column other than the first, the horizontal positions will be offset by the column width (plus the space between each column). Example (Tabs combined with Columns):

62

Tutorial

20
Printing Bitmaps and Graphics
Printing graphics is also one of the unique features of ReportPrinter Pro and can really bring otherwise boring data to life. Look at the Graphics category in the Categorical Reference for a complete listing of graphics related methods and properties. To print a bitmap use PrintBitmapRect. This will stretch or shrink the bitmap to insure that the bitmap appears the same size on the screen or any printers. If you want a bitmap to be merged with the background use the TransparentBitmaps property. You can draw lines with MoveTo and LineTo. Pie charts can be drawn using the Pie method and bar graphs can be drawn using the Rectangle method. Changing Canvas. Pen and Canvas. Brush or using SetPen and SetBrush will change the pen and brush used to draw graphics. Most shapes are filled with the current brush and all lines are drawn in the current brush.

63

Tutorial

21
Setting up the Printer
ReportPrinter gives you many methods to customize the way the printer prints your report. Lists of available items are returned by the Printer, Bins and Papers lists. You can also determine if a particular item is supported using the SupportXxxx methods. You can select an item other than the default with Collate, Duplex, SelectPrinter, SelectBin or SelectPaper. You can set other printing parameters with SetPaperSize, Orientation, Copies and DevMode. ReportPrinter Pro also adds the ability to change paper orientation or paper bins in the middle of a print job. To do this for a page simply call Orientation or SelectBin before NewPage is called. You can also find out information about the current printer with DeviceName, DriverName, Port, PaperWidth, PaperHeight, XDPI, YDPI, LeftWaste, RightWaste, TopWaste and BottomWaste. If you want to use the TPrinterSetupDialog or TPrintDialog components with a TReportPrinter or TReportFiler component, you should call ReleasePrinter before calling the dialogs and call RecoverPrinter after returning from the dialogs. To send printer codes directly to the printer without interpretation by the Windows Print Manager, use the PrintData or PrintDataStream methods. NOTE: Not all printers have the same features and functionality. This is a printer or printer driver limitation. Be careful about developing non-standard printer requirements (such as paper size or paper bins) if your application will be distributed on a wide variety of hardware systems.

64

Tutorial

22
Using Streams
Streams are used frequently throughout ReportPrinter Pro. Unfortunately, they are poorly documented and not understood by many. Streams are basically storage classes that allow the programmer to read from and write to in a random access fashion and can dynamically grow at runtime. There are two useful stream types, TMemoryStream and TFileStream. TMemoryStream is used to contain binary data completely in memory and is good for small, temporary storage. TFileStream is used to read from or write to a disk file and is good for more permanent or larger storage. Both streams have LoadFromStream and SaveToStream methods to transfer information between streams as well as LoadFromFile and SaveToFile methods to transfer information between disk files. Size will return the current size of the stream and Position will return or set the current position in the stream. Stream. ReadBuffer(Data, Len) will allow the programmer to read Len number of bytes from a stream into Data starting at Position. Stream. WriteBuffer(Data, Len) will transfer Len bytes of Data into the stream starting at Position. See Tutorial 12: The TMemoBuf/TDBMemoBuf classes for an example of TFileStream or look at the demo projects provided with ReportPrinter Pro for more examples.

65

Tutorial

23
Exporting to RTF
Using the TRTFFiler component to export reports to RTF In many ways, TRTFFiler is used in exactly the same manner as TReportFiler except that the output is in RTF instead of ReportPrinter's binary format. The StreamMode and FileName properties perform just like TReportFiler's. Also, define the events such as OnPrint, OnBeforePrint,... or attach them to events already defined for TReportFiler, TReportPrinter or TReportSystem components. Capabilities and Limitations of TRTFFiler Text Flow - For the most part, you should print your report from the top of the page to the bottom since in RTF files, there is a main text flow. If you need text to be located at a specific location that is not part of the main text flow, use the TextRect function which is supported. Graphics - The following graphics functions are supported: Ellipse, LineTo, MoveTo, Rectangle, RoundRect and TextRect. The other graphics functions are not supported and if your report contains calls to those functions, they will be ignored. PrintData - The PrintData function performs a valuable function for RTF export in that it allows you to insert any text in the RTF stream including RTF commands. Because of this, if your report will be used for both printer and RTF output, you must handle which component is currently printing. Use the code below as an Example (Delphi)
If Sender is TRTFFiler then begin PrintData(RTFCommands); end else begin PrintData(PrinterCommands); end; { else }

DBTablePrinter components - TRTFFiler is not compatible with these components. See "Printing Tables" below for an alternative. General Layout - Since RTF is a more limited and structured format compared to the flexibility you have with ReportPrinter, printed reports will not normally look the same as the RTF. Different RTF readers will also make a difference on what type of output they produce. The development and testing of the RTF output was done using Microsoft Word 7.0 according to RTF specification, version 1.5. However for the most part, very basic RTF commands were used for optimum compatibility. Also, some layout capabilities were sacrificed so that the resulting RTF could be easily edited by your users instead of producing an RTF file that while a more exact layout, was composed of so many separate fields that the result was impossible to modify. 66

Printing Tables with TRTFFiler Using the SetTab/PrintTab combination works very well with the TRTFFiler component. The output, however, is not a typical RTF table but rather the columns are set up using tabs with the correct position and justification. This will allow your tables to be read from a wider variety of RTF readers (since tabs are much more supported than tables). If you use tab boxes with lines (such as BOXLINESALL or BOXLINELEFTRIGHT) then lines will be drawn on the page, but they will be separate from the text flow. If your users will be modifying the RTF document, it is usually not a good idea to use lines and you should use the BOXLINENONE parameter for SetTab. Also, make sure that you are using the LineHeightMethod of lhmFont (the default) since that is similar to the method that most RTF reader use. The following source code will print a nice table through both TRTFFiler and the other printing components:
With Sender as TBaseReport do begin SetFont('Arial',12); Home; SetTab(0.5,pjCenter,1,5,BOXLINEALL,0); SetTab(NA,pjLeft,1,5,BOXLINEALL,0); SetTab(NA,pjLeft,2.5,5,BOXLINEALL,0); SetTab(NA,pjLeft,2,5,BOXLINEALL,0); SetTab(NA,pjRight,1,5,BOXLINEALL,0); With Table1 do begin First; While not EOF do begin If LinesLeft < 1 then begin NewPage; end; { if } PrintTab(FieldByName('CUSTNO').Text); PrintTab(FieldByName('COMPANY').Text); PrintTab(FieldByName('PHONE').Text); PrintTab(FieldByName('CONTACT').Text); PrintTab(FieldByName('TAXRATE').Text); NewLine; Next; end; { while } end; { with } end; { with }

67

Tutorial

24
Quick start with Rave
Welcome to RAVE! RAVE (Report Authoring Visual Environment) is the visual side of ReportPrinter Pro. This tutorial will quickly guide you through the minimum steps required to build your first visual report with the Rave visual designer and then give a brief overview of what makes up a Rave reporting project. Later tutorials will go into more detail on Rave so if youre ready, lets get started. 1) Start Delphi or C++Builder and create a new application. 2) Create a TTable, TQuery or some other database component and initialize it to a valid table. Set the components Active property to true to insure that all properties are set correctly. 3) Create a TRPDataSetConnection component (located on the Report component tab) and set the DataSet property to the database component you created in Step 2. Change the name of this new component to TutorialCXN. 4) Create a TRaveProject component (located on the Report component tab). Double-click on the new component or right click and select Rave Visual Designer to bring up the visual designer. 5) Once the Rave visual designer is finished loading, select Project | New Data View from the main menu to bring up the Data Connections dialog. Make sure that TutorialCXN is highlighted in the Active Data Connections listbox and press the OK button. 6) Locate the Project Tree (the treeview on the left side of the visual designer) and open up the Data View Dictionary. Select the new data view, DataView1, that was just created. Using the Property Panel (located below the Project Tree), change DataView1s Name property to TutorialDV. 7) Now were ready to create a report. Select Tools | Report Wizards | Simple Table from the main menu to bring up the Simple Table wizard. Make sure TutorialDV is selected and press Next to advance. Select 2 or 3 fields in the listbox and press Next to advance. Change the order of the fields if you wish and press Next to advance. Change the report title to describe the contents of this report and the press Next to advance. Change the font sizes if you wish and the press Generate to create the report. 8) To preview this report, select Project | Execute Report to bring up the Report Setup dialog. Make sure Preview is selected as the report destination and press the OK button. You should now see a preview of your report. Congratulations! You have now created your first Rave report. The following is a list of what typically makes up an application using Rave: 1) Data connection components If you noticed in the above example, Rave uses data from your application. The standard data connection components, TRPCustomConnection, TRPDataSetConnection, TRPTableConnection and TRPQueryConnection provide a bridge between 68

the data in your application and the Rave visual components. The TRPCustomConnection component can be used to access non-database data such as memory arrays or binary record files. TRPDataSetConnection can be used to provide access to TDataSet descendent components including 3rd party dataset components. TRPTableConnection and TRPQueryConnection are to be used specifically with TTable and TQuery components or their descendents respectively. More detailed usage of data connection components is explained in much more detail in a later tutorial. 2) TRaveProject component This component provides access to the reports and their components. The TRaveProject component contains many properties and methods that allow you to create, modify, print and design your reporting projects and will be explained in much more detail in a later tutorial. You will usually only require one TRaveProject component per application, but there is no limitation to having more. More detailed usage of the TRaveProject component is explained in much more detail in a later tutorial. 3) Report project file (.RAV file) The report project file is where the report definitions are stored by the Rave visual designer. This is a binary file, similar to Delphis .DFM files. All reports, global pages and data views for the reporting project are stored in this single file. You can export or import items from or to a report project file. Using methods of the TRaveProject component, you can also store the report project file in a database blob field or other location. 4) Reports Reports are stored in the Report Library of the reporting project. A Rave report is made up of report pages and the visual reporting components stored on those pages. You can create as many page definitions as you want and combine them in a wide variety of methods. 5) Global Pages Global pages are stored in the Global Page Catalog of the reporting project. Components contained on global pages, unlike those in report pages, are visible to all reports. global pages are a useful for storing templates that are mirrored on other report pages. 6) Data Views Data views are stored in the Data View Dictionary of the reporting project. Data views provide an interface to data connection components. When creating new data views, you must have the data connection component active in either a running application or on a loaded Delphi or C++Builder form. The data view will then query the data connection component to retrieve metadata information such as field names, data types, etc. Field components are contained within each data view allowing properties to be set for each data column.

69

Tutorial

25
Rave Data Connections
As was mentioned previously, data connections provide a bridge between the data in your Delphi or C++Builder application and a Rave report. The first thing you have to do is choose the type of Rave data connection that you will need. This is determined by the type of database components that you are using. Use the table below to help you decide the best data connection component to use: Data Connection Component TRPCustomConnection Best used with Memory arrays, non-database files or non-TDataSet database components 3rd Party TDataSet descendent database components TTable, replacement TTable or its descendents TQuery or its descendents How to connect Define events such as OnFirst, OnNext, OnEOF, OnGetCols and OnGetRow. Initialize the DataSet property to the TDataSet component Initialize the Table property to the TTable component Initialize the Query property to the TQuery component

TRPDataSetConnection TRPTableConnection TRPQueryConnection

The Name property of the data connection component is used as the name of the data connection itself. It is important to use unique names for your data connection components since there can be no duplication across your application. It is also good pratice to include a unique application identifier in your data connection names since data connections are visible from other applications. For example, if your application is called Wizbang Object Wizard you could prepend the letters WOW in front of each data connection name to help insure your data connection names are unique for your application. The Visible property of the data connection component is used to define whether the data connection is visible to other applications or the end-user version of the Rave visual designer. The default value of False means that the data connection will only be visible to a Rave report being printed from within the same application as the data connection component or from the programmer version of the Rave visual designer. A value of True for the Visible property means that the data connection will be visible to any Rave report being run from within any application or from the enduser or programmer version of the Rave visual designer. While data connections of this type are available to the end-user designer, they will not be displayed when then end-user attempts to create a new data view unless they belong to the application that started the Rave visual designer. If you want to make data connections from other applications available to your end-users it is best to create a report project with the programmer version of the Rave visual designer with the data views already defined for these external data connections. In the future, there will be other custom data connection components available written specifically for other database components. See the file CUSTOMDB.TXT in the source directory for more information on availability and installation.

70

Tutorial

26
Customizing data connections
Through the events in the data connection components, you can customize how the data is sent to your Rave reports. For non-database data using the TRPCustomConnection component, you will need to provide all access to your data through these events. For database data connection components such as TRPDataSetConnection, you will normally only want to override the OnValidateRow event. The data connection events are as follows: Event OnEOF Description Called when Rave wants to determine if it is at the end of the data. A true value should be returned only if there are no rows or if a call to the OnNext event has moved past the last row. Called when Rave wants the data cursor to be moved to the first row of the data. With Raves advanced buffering system, this will usually only be called once at the beginning of a data session. Called when Rave wants to retrieve the meta-data of the data. This includes the field name, type, character size, full name and description. See below for more details. Called when Rave wants to retrieve the data for the current row. See below for more details. Called when Rave wants to retrieve the available sorting methods. Called when Rave wants to move the data cursor to the next row. Called when Rave wants to initialize the data session. The current state should be saved for the later call to OnRestore. Called when Rave wants to restore the data session to its state before it was opened. Called when Rave wants to filter the data for items such as MasterDetail reports. Called when Rave wants to sort the data. See below for more details. Called for each row to allow custom filtering of the data. For a custom data connection, this event is normally not needed since filtering the data through the OnNext event is more efficient. However, this event can be very useful for other, more automated data connections such as TRPDataSetConnection. See below for more details.

OnFirst

OnGetCols

OnGetRow OnGetSorts OnNext OnOpen OnRestore OnSetFilter OnSetSort OnValidateRow

NOTE: The TRPCustomConnection component has a DataIndex and DataRows property of type integer. These are provided for use by custom connector events and if used, can allieviate the need to define the OnFirst, OnNext and OnEOF events. DataIndex is intended to be used as the data cursor position with 0 representing the first row. DataRows is intended to be used as the row count 71

of the data. For example, if you were defining a custom data connection for a memory array, you would only need to initialize the Connection.DataRows property to the number of elements in the memory array and then let Rave handle the OnFirst, OnNext and OnEOF events. In the OnGetRow event you would then access the Connection.DataIndex property to determine which array element to pass back (remember that DataIndex is 0 for the first row). OnGetCols Event The OnGetCols event is called when Rave want to retrieve the meta-data information of the data. Inside this event you will want to call the Connection.WriteField method for each field (column) of your data. The definition of WriteField is as follows:
procedure WriteField(Name: string; DataType: TRPDataType; Width: integer; FullName: string; Description: string);

Name is the short name of the field and should only contain alphanumeric characters. DataType is the type of data that this field represents and should be one of the following values: dtString, dtInteger, dtBoolean, dtFloat, dtCurrency, dtBCD, dtDate, dtTime, dtDateTime, dtBlob, dtMemo or dtGraphic. Width is the relative character width of the field. Full name is a more descriptive name of the field and can include spaces and other non-alphanumeric characters. If FullName is blank then the short name is used as the fields full name. Description is a full description of the field and is typically edited with memo component so it can contain multiple lines. Use the description property to define how the field is to be used and provide any other information about the fields data. Example:
procedure TDataForm.CustomCXNGetCols(Connection: TRPCustomConnection); begin With Connection do begin WriteField('Index',dtInteger,8,'Index Field','Description 1'); WriteField('Name',dtString,30,'Name Field','Description 2'); WriteField('Amount',dtFloat,20,'Amount Field','Description 3'); end; { with } end;

OnOpen event The OnOpen event is called to initialize a data session. In this event you can open up data files, initialize variables and save the current state of the data for the OnRestore event which will be called to terminate the data session. Example:
procedure TDataForm.CustomCXNOpen(Connection: TRPCustomConnection); begin AssignFile(DataFile,DATAFILE.DAT); Reset(DataFile,1); end;

OnFirst event 72

The OnFirst event is called to position the data cursor to the first row of the data. Example:
procedure TDataForm.CustomCXNFirst(Connection: TRPCustomConnection); begin Seek(DataFile,0); BlockRead(DataFile,DataRecord,SizeOf(DataRecord),DataRead); end;

OnNext event The OnNext event is called to move the data cursor to the next row of data. Example:
procedure TDataForm.CustomCXNNext(Connection: TRPCustomConnection); begin BlockRead(DataFile,DataRecord,SizeOf(DataRecord),DataRead); end;

OnEOF event The OnEOF event is called to return whether the data cursor is beyond the EOF or not. A true value should be returned only if there are no rows or if a call to the OnNext event has moved past the last row. Example:
procedure TMainForm.CustomCXNEOF(Connection: TRPCustomConnection; var EOF: Boolean); begin EOF := DataRead < SizeOf(DataRecord); end;

OnGetRow event The OnGetRow event is called to retrieve the data for the current row. There are several methods used to write the data to a special buffer used by Rave. The order and types of the fields written must match exactly the field definitions provided in the OnGetCols event. The following is a list of the methods provided by the Connection object for writing data out to the data buffer.
procedure WriteStrData(FormatData: string; NativeData: string); { dtString } procedure WriteIntData(FormatData: string; NativeData: integer); { dtInteger } procedure WriteBoolData(FormatData: string; NativeData: boolean); { dtBoolean } procedure WriteFloatData(FormatData: string; NativeData: extended); { dtFloat } procedure WriteCurrData(FormatData: string; NativeData: currency); { dtCurrency } procedure WriteBCDData(FormatData: string; NativeData: currency); { dtBCD }

73

procedure WriteDateTimeData(FormatData: string; NativeData: TDateTime); { dtDate, dtTime and dtDateTime } procedure WriteBlobData(var Buffer; Len: longint); { dtBlob, dtMemo and dtGraphic }

There is also a special method called WriteNullData (no parameters) that can be called for any field that contains uninitialized or null data. The FormatData parameter is used to pass a preformatted string of the data for this field. The NativeData parameter is intended to pass the unformatted or raw data of the field. If special formatting is defined in the Rave report then the formatting will be applied to NativeData. If no special formatting is defined in the Rave report then the FormatData value will be used for printing. Example:
procedure TDataForm.CustomCXNGetRow(Connection: TRPCustomConnection); begin With Connection do begin WriteIntData('',DataRecord.IntField); WriteStrData('',DataRecord.StrField); WriteFloatData('',DataRecord.FloatField); end; { with } end;

OnValidateRow event The OnValidateRow event is called for each row and allows you to control whether the current row will be included in the report or not. This is usually the only event that will be defined for noncustom data connections. Example:
procedure TDataForm.CustomCXNValidateRow(Connection: TRPCustomConnection; var ValidRow: Boolean); begin ValidRow := DataRecord.FloatField >= 0.0; end;

OnRestore event The OnRestore event is called to terminate and restore a data session to its previous state. In this event you can close data files, free resources and restore the state of the data to its state that it was before the OnOpen event was called. Example:
procedure TDataForm.CustomCXNRestore(Connection: TRPCustomConnection); begin CloseFile(DataFile); end;

74

Tutorial

27
Overview of TRaveProject component
The TRaveProject component is the key to providing access to the visual reports you create with Rave. Normally you will have a single TRaveProject component in your application, although you can have more if necessary. The ProjectFile property defines the report project file that your application uses to hold the report definitions. This file will have an extension of .RAV and even though it is a single file, it can contain as many report definitions as you need. When the Open method of TRaveReport is called, this report project file will be loaded into memory to prepare for printing or end-user design changes. You should make sure that the Close method is called when you no longer need the report project or before you close your application. If any changes are made to the report project you can save them by calling the Save method. TRaveProject also has several properties and methods, such as SelectReport, GetReportList, ReportDescToMemo, ReportDesc, ReportName and ReportFullName to make it easy to create an efficient interface for your users. See the RAVEDEMO project for a good example of how to define a Rave interface. The Engine property of TRaveProject allows you to define an alternate output engine to be used. This allows you to output Rave reports through the Text, RTF or HTML filer components or to define custom setup and preview screens through the TReportSystem component. The following is a basic sequence of steps that you would perform while using the TRaveProject component within your application: 1) Call RaveProject.Open; to open the report project defined in the ProjectFile property. 2) Call RaveProject.GetReportList(ListBox1.Items,true); to load a list of report names into ListBox1. 3) Whenever the user click on ListBox1 (ListBox1.OnClick), call RaveProject.SelectReport( ListBox1.Items[ListBox1.ItemIndex],true); and then RaveProject.ReportDescToMemo( Memo1); to select the current report and to copy the description of the report into Memo1. 4) Call RaveProject.Execute; to print the currently selected report. 5) Call RaveProject.Design; to start then end-user designer for the currently selected report (Corporate version only). 6) Call RaveProject.Close; to close the report project and free the memory used by it. This is just a basic overview of a typical application and how it would call the TRaveProject methods and properties. There are several other properties and methods defined in the main reference that give you even more capabilities. To conserve space in your application, Rave only preloads the Graphics, Standard and Reporting components. Barcode components as well as any other custom components must be registered and compiled into the application explicitly if they are used in any Rave reports. The following is a list of the steps to include the barcode components into an application: 75

1) On the form that contains the TRaveProject component for the application, add the uniy RVCsBars to the uses clause. 2) Define the TRaveProject.OnCreate event and call the RaveRegister method of the RVCsBars unit as follows:
procedure TReportForm.RaveProjectCreate(Sender: TObject); begin RVCsBars.RaveRegister; end;

The above two steps would be required of any custom component that is used in a Rave report. If you do not do the correct steps you will get an error such as Class TRavePostNetBarcode not found when opening the reporting project.

NOTE
If you are interested in creating custom components or wizards then you should examine a file called RANT.TXT. This file is located in the SOURCE directory and will explain the issues involved in creating your own custom components or wizards.

76

Tutorial

28
Providing End User design support
One of the more powerful features of ReportPrinter Pro is the ability to provide end-user report design capability in your appliction (Corporate version only). This will give your end-users the ability to modify or create new reports. There are a few more issues that you will need to deal with when distributing an application using the Rave designer. The first is the distribution of the visual designer itself. There are two DLL files located in the \RPPRO3\REDIST directory called RaveSolo.dll and RavePack.dll. RaveSolo.dll is a standalone file that has the advantage of fewer files and smaller overall size, but does not allow the addition of custom components, editors or wizards. RavePack.dll uses several package files that need to be distributed along with it and also allows the addition of custom components, editors and wizards to the end-users visual designer. The following is a list of the package files normally shipped with RavePack.dll (all are located in the \RPPRO3\REDIST directory): Main library files VCL40.BPL The main Delphi 4.0 VCL library file VCLX40.BPL The extra Delphi 4.0 VCL library file RVCL30.BPL The main Rave 3.0 library file Component, Editor and Wizard library files RVCLS30.BPL The Rave 3.0 standard components RVCLG30.BPL The Rave 3.0 graphics components RVCLR30.BPL The Rave 3.0 reporting components RVCLB30.BPL The Rave 3.0 barcode components RVCLLE30.BPL The Rave 3.0 Language Engine RVCLLD30.BPL The Rave 3.0 Delphi Syntax Compiler RVCLWZ30.BPL The Rave 3.0 standard wizards The Component, Editor and Wizard library files need to be registered in the Windows registry in order for Rave to load them. Under the key HKEY_CURRENT_USER\Software\Nevrona Designs\Rave\Packages, you should define a string value with the name of the value equal to the description of the package file and the data of the string value equal to the full path and filename of the package file. In order to make this process a little easier, the Rave designer will read package definitions from a file called RAVE.INC and store those in the Windows registry if the HKEY_CURRENT_USER\Software\Nevrona Designs\Rave\Packages key does not already exist. The structure of the RAVE.INC file is simply to list the filenames of the package files on separate lines as follows: Default RAVE.INC file contents
RVCLB30.bpl RVCLG30.bpl RVCLS30.bpl

77

RVCLR30.bpl RVCLLE30.bpl RVCLLD30.bpl RVCLWZ30.bpl

If you decide to include the end-user designer with your application, you will also need to initialize the TRaveProject components LoadDesigner property to true and DLLFile property to the name of the Rave Designer DLL file you are using. The DLLFile property also allows you to change the name of the RaveSolo.dll or RavePack.dll file to another name (although the library package filenames should remain the same).

78

Tutorial

29
Rave Files
Now that ReportPrinter Pro has added both a visual and an End User designer (in corporate version), you now have several options and may have to distribute some additional files. Nothing has changed if ALL of your reports are code based, in that case everything will be in the EXE file. Using Packages: Then add these files: RPRT30## (## indicates compiler type D3 for Delphi 3 etc.) RPRV30## (if you are including visually designed reports - .RAV file) End User designer: If the End User designer has no modifications, then add this file: RaveSolo.DLL (fully functional in corporate version only) Modified End User designer: A modified designer could be one where you have added your own custom wizards, custom component(s) or deleted something that is not used in your application, like Bar Codes or Drawing. If so, then add these files: RavePack.DLL (fully functional in corporate version only) VCL40.BPL VCLX40.BPL RVCL30 RVCL##30 (## indicates the Rave Components type B for Bar Code) Add-On Custom Component: Then add these files: optional - *.PAS required - *.DCU and *.BPL and *.DCP WARNING The RVINFO.OBJ and RPRAVE.DCU files contain your Serial Number and other pertinent information about the Rave system you purchased. As such, they are not to be distributed, released or shared by any other users.

79

Here are some of the normal distribution options. Distribute your .EXE and the following: 1) 2) If you are NOT using packages, and your report(s) are: All Code Based Nothing else required Visual .RAV custom DCU End User .RAV and RaveSolo.DLL custom DCU End User with .RAV and RavePack.DLL and custom DCU or BPL custom components VCL40.BPL VCLX40.BPL RVCL30 RVCL##30 If you are using packages, and your report(s) are: All Code Based RPRT30## Visual .RAV and RPRT30## and RPRV30## custom DCU End User .RAV and RPRT30## and RPRV30## Not Recommended End User with .RAV and RPRT30## and custom DCU or BPL custom components VCL40.BPL VCLX40.BPL RVCL30 RVCL##30

80

Appendix

R
Alphabetical Event/Method/Property Reference
Listed below is an alphabetical listing of all public and published properties, methods, events and types that make up the ReportPrinter Pro component suite. Methods are defined by their calling syntax, category, components they are members of, a short description and any other properties or methods they may be related to. Properties are defined by their data type, access type (read, write or published), category, components they are members of, a short description and any other properties or methods they may be related to. Defaults are added to read/write properties. Pertinent examples are also given for most properties and methods.

Abort method
Declaration: Category: Components: Description:

{Rave}

See Also:

procedure Abort; Control TReportFiler, TReportPrinter This method will abort the printing of the report and set the property Aborted to true. NOTE: Abort raises the silent exception Abort that will cease the current thread of execution. Make sure to use exception handling (try...finally) to restore any resources that you may allocate in your reporting code. Aborted, Execute

Example (Delphi)
procedure TRPStatusForm.CancelButtonClick(Sender:TObject); begin ReportPrinter1.Abort; end;

Example (C++ Builder)


void __fastcall TRPStatusForm::CancelButtonClick(TObject* Sender) { ReportPrinter1->Abort(); }

81

Aborted property
Declaration: Category: Components: Description: See Also:

(read only)

property Aborted: boolean; Control TReportFiler, TReportPrinter This property will be set to true after a call to Abort has been made. Abort

Example (Delphi)
ReportPrinter1.Execute; IF ReportPrinter1.Aborted then begin StatusFormat := #13 + 'Report Canceled!'; end else begin StatusFormat := #13 + 'Report Completed!'; end; { else } UpdateStatus;

Example (C++ Builder)


rp->Execute(); if (rp->Aborted) { rp->StatusFormat = \nReport Canceled!; } else { rp->StatusFormat = \nReport Completed!; } rp->UpdateStatus();

AbortPage method
Declaration: Category: Components: Description: See Also: procedure AbortPage; Control TReportFiler, TReportPrinter This method will abort the printing of the current page and start printing a new page. Abort

Example (Delphi)
ReportPrinter1.AbortPage;

Example (C++ Builder)


rp->AbortPage();

82

AccuracyMethod property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property AccuracyMethod: TAccuracyMethod; amAppearance {TReportFiler}, amPositioning {TReportSystem} Control TReportFiler This property controls how text is written to the report file. If AccuracyMethod is equal to amPositioning then the text is written out in a manner that will be reproduced as accurately as possible on the screen or any printers. If it is equal to amAppearance then the text string is written out as a complete string in the normal fashion. The problem with amAppearance is that screen fonts often do not size the same as printer fonts. Therefore, text strings may appear shorter or longer on the preview screen than they do on the printer.

Example (Delphi)
ReportFiler1.AccuracyMethod := amAppearance;

Example (C++ Builder)


ReportFiler1->AccuracyMethod = amAppearance;

Active property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property Active: Boolean; false Rave TRaveProject You can change or retrieve the active state of a report project with this property. Setting Active to true is the same as calling the Open method while setting Active to false is the same as calling the Close method. Close, OnAfterClose, OnAfterOpen, OnBeforeClose, OnBeforeOpen, Open

Example (Delphi)
RaveProject1.Active := True; { Same as RaveProject1.Open; }

Example (C++ Builder)


RaveProject1->Active = true; // Same as RaveProject1.Open();

AdjustLine method
Declaration: Category: Components: Description: procedure AdjustLine; Position TReportFiler, TReportPrinter This method will adjust the current text cursor so that the current line is placed correctly below the previous line after a change in font size. Use AdjustLine when you want to reset the line height and line font after the cursor is already on the next line. ResetLineHeight

See Also:

83

Example (Delphi)
SetFont(Arial,14); Println(This is the first line of text); SetFont(Arial,10); AdjustLine; Println(This is the second line of text);

Example (C++ Builder)


rp->SetFont(Arial,14); rp->Println(This is the first line of text); rp->SetFont(Arial,10); rp->AdjustLine(); rp->Println(This is the second line of text);

AllowAll method
Declaration: Category: Components: Description: See Also: procedure AllowAll; Control TReportFiler, TReportPrinter This method will reset the valid destinations to all after they have been modified by AllowPreviewOnly or AllowPrinterOnly. AllowPreviewOnly, AllowPrinterOnly

Example (Delphi)
{ Draw a line on the preview screen only } AllowPreviewOnly; MoveTo(1.5,1.5); LineTo(6.5,1.5); AllowAll;

Example (C++ Builder)


// Draw a line on the preview screen only rp->AllowPreviewOnly(); rp->MoveTo(1.5,1.5); rp->LineTo(6.5,1.5); rp->AllowAll();

AllowPreviewOnly method
Declaration: Category: Components: Description: procedure AllowPreviewOnly; Control TReportFiler, TReportPrinter This method will set the valid destinations to preview only. Any printing commands that follow will only be sent to the preview screen. The method can be very useful to print items that you want to appear on the preview screen but not the printer (Such as the label extents for the TLabelShell component). AllowAll, AllowPrinterOnly See AllowAll

See Also: Example:

84

AllowPrinterOnly method
Declaration: Category: Components: Description: See Also: Example: procedure AllowPrinterOnly; Control TReportFiler, TReportPrinter This method will set the valid destinations to printer only. Any printing commands that follow will only be sent to the printer. This method can be very useful to print items that you want to appear on the printer but not the preview screen. AllowAll, AllowPreviewOnly See AllowAll

Append method
Declaration: Category: Components: Description: See Also: procedure Append(Text: string); Memo TDBMemoBuf, TMemoBuf This method will append Text to the end of the memo buffer. Insert

Example (Delphi)
MemoBuf.Append(' This is a new sentence on the end.');

Example (C++ Builder)


MemoBuf->Append( This is a new sentence on the end.);

AppendMemoBuf method
Declaration: Category: Components: Description: See Also: procedure AppendMemoBuf(MemoBuf: TMemoBuf); Memo TDBMemoBuf, TMemoBuf Will append MemoBuf to the current memo buffer. InsertMemoBuf

Example (Delphi)
MemoBuf1.AppendMemoBuf(MemoBuf2);

Example (C++ Builder)


MemoBuf1->AppendMemoBuf(MemoBuf2);

Arc method
Declaration: Category: Components: Description: procedure Arc(X1,Y1,X2,Y2,X3,Y3,X4,Y4: double); Graphics TReportFiler, TReportPrinter This method draws an arc inside an ellipse bounded by the rectangle defined by (X1,Y1) and (X2,Y2). The arc starts at the intersection of the line drawn between the ellipse center ((X1+X2) / 2.0,(Y1+Y2) / 2.0) and the point (X3,Y3) and is drawn counterclockwise until it reaches the intersection of the line drawn between the ellipse center and the point (X4,Y4). Ellipse, Pie

See Also:

Example (Delphi)
ReportPrinter1.Arc(1.0,1.0,3.0,3.0,3.0,2.0,0.0,0.0);

85

Example (C++ Builder)


ReportPrinter1->Arc(1.0,1.0,3.0,3.0,3.0,2.0,0.0,0.0);

AscentHeight property
Declaration: Category: Components: Description: See Also:

(read only)

property AscentHeight: double; Position TReportFiler, TReportPrinter Returns the height of the line font above the baseline. NOTE: This applies to the line font only and not to the current textfont. DescentHeight, FontHeight, LineHeight

AsFloat property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property AsFloat: double; 0.0 TablePrinter TTableColumn, TDBTableColumn Returns or sets the current contents of a table column as a floating point value. If the contents cannot be converted to a floating point value, 0.0 will be returned. AsInteger

Example (Delphi)
WITH TableColumn do begin PageTotal := PageTotal + AsFloat; end; { with }

Example (C++ Builder)


TableColumn->PageTotal = TableColumn->PageTotal + TableColumn->AsFloat;

AsInteger property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property AsInteger: integer; 0 TablePrinter TTableColumn, TDBTableColumn Returns or sets the current contents of a table column as an integer value. If the contents cannot be converted to an integer value, 0 will be returned. AsFloat

Example (Delphi)
WITH TableColumn do begin GrandTotal := GrandTotal + AsInteger; end; { with }

Example (C++ Builder)


TableColumn->GrandTotal = TableColumn->GrandTotal + TableColumn->AsInteger;

86

AssignFont method
Declaration: Category: Components: Description: See Also: procedure AssignFont(Font: TFont); Font TReportFiler, TReportPrinter Selects current font to the TFont object from list. SetFont

Example (Delphi)
ReportPrinter1.AssignFont( FontDialog1.Font );

Example (C++ Builder)


ReportPrinter1->AssignFont( FontDialog1->Font );

BarBottom property
Declaration: Category: Components: Description: See Also: Example:

( read/write )

property BarBottom: double; Bar Code TRPBarsBase Sets or returns the location of the bottom of the bar portion of the bar code. The location of the readable text is controlled by PrintReadable and PrintTop properties. BarTop, Bottom, PrintReadable, PrintTop see Create { bar code }

BarCodeJustify property
Declaration: Default: Category: Components: Description:

( read/write )

See Also:

property BarCodeJustify: TPrintJustify pjLeft Bar Code TRPBarsBase This determines where the bar code is printed relative to the Position property. pjLeft Print the bar code left justified at Position pjCenter Print the bar code centered at Position pjRight Print the bar code right justified at Position Center, Left, Position, Right

Example (Delphi)
Position := 2.5; BarCodeJustify := pjCenter; { equivalent to Center := 2.5; }

Example (C++ Builder)


rp1->Position = 2.5; rp1->BarCodeJustify = pjCenter; // equivalent to rp1->Center = 2.5;

87

BarCodeRotation property
Declaration: Default: Category: Components: Description:

( read/write )

See Also:

property BarCodeRotation: TBarCodeRotation Rot0 Bar Code TRPBarsBase This property allows the bar code to be rotated to 4 different orientations. The pivot point for rotation is the top left corner of the bar code. Rot0 no rotation Rot90 rotate 90 degrees relative to page Rot180 rotate 180 degrees relative to page Rot270 rotate 270 degrees relative to page Left, Top

Example (Delphi)
BarCodeRotation := Rot180; {print Bar Code upside down}

Example (C++ Builder)


rp1->BarCodeRotation = Rot180; // print Bar Code upside down

BarHeight property
Declaration: Default: Category: Components: Description: See Also: property BarHeight: double 0.5 ( PostNet 0.125 ) Bar Code TRPBarsBase Sets or returns the value for the tallest bar. BarWidth

( read/write )

Example (Delphi)
BarHeight := 0.3; { Bars will be 3/10 inch tall }

Example (C++ Builder)


rp1->BarHeight = 0.3; // Bars will be 3/10 inch tall

BarTop property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property BarTop: double; 0 Bar Code TRPBarsBase Sets or returns the location of the top of the bar code. The location of the readable text is controlled by PrintReadable and PrintTop properties. BarBottom, PrintReadable, PrintTop, Top

Example (Delphi)
BarCode1.BarTop := 0.5;

Example (C++ Builder)


BarCode1->BarTop = 0.5;

88

BarWidth property
Declaration: Default: Category: Components: Description: See Also: property BarWidth: double 0.01 (PostNet 0.020) Bar Code TRPBarsBase Sets or returns the value of the narrow bar width. BarHeight, Width

(read/write)

Example (Delphi)
BarWidth := 0.02; {set narrow bar width to 2/100 ths}

Example (C++ Builder)


rp1->BarWidth = 0.02; // set narrow bar width to 2/100 ths

BaseReport property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property BaseReport: TBaseReport nil Control TReportSystem Provides access to the TBaseReport object that is created by ReportSystem, the base class of all output classes. This property will be nil until the Execute method is called. It is normally not necessary to access this property since the TBaseReport object is passed as the Sender parameter for all printing events. Execute

Example (Delphi)
ReportSystem1.BaseReport.Print(This is a test); or With Sender as TBaseReport do begin Print(This is a test); { Equivalent code inside OnPrint event } end; { with }

Example (C++ Builder)


rp1->BaseReport->Print(This is a test);

BaseReport property
Declaration: Default: Category: Components: Description: See Also:

{ Bar Code }

(read/write)

property BaseReport: TBaseReport nil Bar Code TRPBarsBase Sets or returns the reporting object that the bar code will be printed through. This property is normally set through the constructor, Create. Create { bar code }

Example (Delphi)
Barcode1.BaseReport := ( Sender as TBaseReport );

Example (C++ Builder)


Barcode1->BaseReport = dynamic_cast<TBaseReport*>(Sender);

89

BaseReport property
Declaration: Default: Category: Components: Description: See Also:

{ MemoBuf }

(read/write)

property BaseReport: TBaseReport nil Memo TMemoBuf Sets or returns the reporting object that the memo will be printed through. There are certain methods that require this property to be initialized before the will print. MemoHeightLeft, MemoLinesLeft, PrintHeight, PrintLines

Example (Delphi)
MemoBuf.BaseReport := Sender as TBaseReport;

Example (C++ Builder)


MemoBuf->BaseReport = dynamic_cast<TBaseReport*>(Sender);

Bins property
Declaration: Default: Category: Components: Description: See Also:

(read only)

property Bins: TStrings; (the list of bins for the default printer) Printer TReportFiler, TReportPrinter This property will return a TStringList containing all of the valid printer bins for the current printer. SelectBin, SupportBin, TStrings

Example (Delphi)
{ Display the printer bins in a list box } ListBox1.Items := ReportPrinter1.Bins;

Example (C++ Builder)


// Display the printer bins in a list box ListBox1->Items = ReportPrinter1->Bins;

BKColor property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property BKColor: TColor; clWhite Graphics TReportFiler, TReportPrinter This property returns or sets the current background color for text output. TextBKMode, TColor

Example (Delphi)
ReportPrinter1.BKColor := clWhite;

Example (C++ Builder)


ReportPrinter1->BKColor = clWhite;

90

Bold property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property Bold: boolean; false Font TReportFiler, TReportPrinter This property returns or sets the bold attribute for the current font. Italic, Underline, Strikeout

Example (Delphi)
With ReportPrinter1 do begin Bold := true; Print( Bold Text ); Bold := false; end; { with }

Example (C++ Builder)


rp1->Bold = true; rp1->Print( Bold Text ); rp1->Bold = false;

Border property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Border: double; 0.0 Label TLabelShell This property defines the border, in units, around the edges of each label that the section will be initialized to before entering the OnLabelPrint event. SectionLeft, SectionRight, SectionTop, SectionBottom

Example (Delphi)
{ Make sure there is a 0.1 border around the label } LabelShell1.Border := 0.1;

Example (C++ Builder)


// Make sure there is a 0.1 border around the label LabelShell1->Border = 0.1;

Bottom property
Declaration: Category: Components: Description: See Also:

{Bar Code}

( read/write )

property Bottom: double; Bar Code TRPBarsBase Sets or returns the position for the bottom of the bar code. The value for this property includes the readable text if it is printed. BarBottom, PrintReadable, PrintTop

91

Bottom property
Declaration: Default: Category: Components: Description: See Also:

{ReportSection}

(read/write/pub)

property Bottom: double; 0.0 ReportSection TReportSection This property defines the placement for the bottom of the section. All values are in units and are relative to a specific position on the page, such as the page or margin edge, which is defined by the relative XxxxMethod property (such as LeftMethod). Left, Right, Top, BottomMethod

Example (Delphi)
ReportSection.Bottom := 0.5;

Example (C++ Builder)


ReportSection->Bottom = 0.5;

BottomMethod property
Declaration: Default: Category: Components: Description:

{ReportSection}

(read/write/pub)

See Also:

property BottomMethod: TDistanceMethod; dmMargin (except TopMethod is dmSpecial) ReportSection TReportSection These properties will define where each side of the section will be measured. dmPage will measure from the closest page edge dmMargin will measure from the closest margin edge dmSpecial for the SectionTop will measure from the current cursor position dmSpecial for SectionRight and SectionBottom will measure from the left and top section positions respectively. Left, LeftMethod, RightMethod, TopMethod

Example (Delphi)
ReportSection.LeftMethod := pjMargin;

Example (C++ Builder)


ReportSection->LeftMethod = pjMargin;

BottomWaste property
Declaration: Category: Components: Description: See Also: Example:

(read only)

property BottomWaste: double; Printer TReportFiler, TReportPrinter This property returns the waste area on the bottom side of the page that the printer cannot print into. It is a good idea to make sure that the reports margins are greater than or equal to its waste areas. LeftWaste , MarginBottom , RightWaste , TopWaste See LeftWaste

92

BoxLineXxxx
Declaration: Category: Components: Description: const BOXLINEXxxx; Tabs TReportFiler, TReportPrinter BOXLINENONE: No lines drawn. BOXLINELEFT: Line drawn on left only. BOXLINERIGHT: Line drawn on right only. BOXLINETOP: Line drawn on top only. BOXLINEBOTTOM: Line drawn on bottom only. BOXLINEALL: Lines drawn on all sides. BOXLINELEFTRIGHT: Lines drawn on left and right. BOXLINETOPBOTTOM: Lines drawn on top and bottom. BOXLINENOTOP: All lines except indicated are drawn. BOXLINENOBOTTOM BOXLINENOLEFT BOXLINENORIGHT SetTab See SetTab

constants

See Also: Example:

BoxLineColor property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property BoxLineColor: TColor; clBlack Tabs TReportFiler, TReportPrinter This property will define the color used to draw the sides of tab boxes defined with SetTab. Tab, SetTab, TabColor, TColor

Example (Delphi)
ReportPrinter1.BoxLineColor := clGreen;

Example (C++ Builder)


ReportPrinter1->BoxLineColor = clGreen;

93

BoxLines property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property BoxLines: TBoxLines; blAll TablePrinter TDBTableColumn, TTableColumn, TTableSection This property returns or sets the row box settings for each table column or table section component. These constants are listed below. blAll blNone blBottom blLeft blLeftBottom blLeftRight blLeftTop blRight blRightBottom blRightTop blTop blTopBottom blNoTop blNoBottom blNoLeft blNoRight TBoxLines Lines drawn on all sides No lines drawn Line drawn on bottom only Line drawn on left side only and bottom and right and top Line drawn on right side only and bottom and top Line drawn on top only Lines drawn on top and bottom All lines except indicated are drawn

See Also:

Example (Delphi)
With TableColumn do begin BoxLines := blNoLeft; end; { with }

Example (C++ Builder)


TableColumn->BoxLines = blNoLeft;

94

BrushCopy method
Declaration: procedure BrushCopy(const Dest: TRect; Bitmap: TBitmap; const Source: TRect; Color: TColor); Graphics TReportFiler, TReportPrinter Copies a portion of Bitmap specified by the rectangle Source to the printer canvas. Color of Bitmap is replaced by the brush color of the destination canvas. The rectangle Dest defines the region to copy the bitmap to. CreateRect, TBitmap, TRect, TColor

Category: Components: Description: See Also:

Example (Delphi)
ReportPrinter1.BrushCopy(DestRect, UserBMP, SrcRect, clBlack);

Example (C++ Builder)


ReportPrinter1->BrushCopy(DestRect, UserBMP, SrcRect, clBlack);

Buffer property
Declaration: Category: Components: Description: See Also:

(read only)

property Buffer: ^Array[ 0..MaxBufSize ] of Char; Memo TMemoBuf This property is a pointer to memory buffer used by TMemoBuf. NOTE: Not normally necessary to access this property. LoadFromFile, SetData, Text

BufferInc property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property BufferInc: longint; 256 Memo TDBMemoBuf, TMemoBuf This property controls the granularity of the memo buffer when its size changes. Setting this property to 1 will keep the buffer size exactly equal to the size of the text but will be inefficient when the buffer grows or shrinks. Setting this property to a larger value will make editing the memo buffer more efficient. MaxSize

Example (Delphi)
MemoBuf.BufferInc := 128;

Example (C++ Builder)


MemoBuf->BufferInc = 128;

95

CalcGraphicHeight method
Declaration: Category: Components: Description: function CalcGraphicHeight(Width: double; Graphic: TGraphic): double; Graphics TReportFiler, TReportPrinter This method will calculate and return the value for the new Height of the Graphic based on the Width value while maintaining the original ratio of the Graphic. This could be used to see if there is enough room left on the page before attempting to print the graphic. This can be used for both bitmaps and metafiles. CalcGraphicWidth, PrintBitmap, PrintBitmapRect, StretchDraw, TBitmap

See Also:

Example (Delphi)
Bitmap := TBitmap.Create; Bitmap.LoadFromFile('RPDEMO.BMP'); PrintBitmapRect(X1, Y1, X1 + 3.0, CalcGraphicHeight(3.0,Bitmap),Bitmap); Bitmap.Free;

Example (C++ Builder)


Graphics::TBitmap* Bitmap; Bitmap = new Graphics::TBitmap(); Bitmap->LoadFromFile("RPDEMO.BMP"); rp->PrintBitmapRect(X1, Y1, X1 + 3.0, rp->CalcGraphicHeight(3.0,Bitmap),Bitmap); delete Bitmap;

CalcGraphicWidth method
Declaration: Category: Components: Description: See Also: function CalcGraphicWidth(Height: double; Graphic: TGraphic): double; Graphics TReportFiler, TReportPrinter This method will calculate and return the value for the new Width of the Graphic based on the Height value while maintaining the original ratio of the Graphic. This can be used for both bitmaps and metafiles. CalcGraphicHeight, PrintBitmap, PrintBitmapRect, StretchDraw, Tbitmap

Example (Delphi)
Bitmap := TBitmap.Create; Bitmap.LoadFromFile('RPDEMO.BMP'); PrintBitmapRect(X1, Y1, CalcGraphicWidth(3.0,Bitmap), Y1 + 3.0,Bitmap); Bitmap.Free;

Example (C++ Builder)


Graphics::TBitmap* Bitmap; Bitmap = new Graphics::TBitmap(); Bitmap->LoadFromFile("RPDEMO.BMP"); rp->PrintBitmapRect(X1, Y1, rp->CalcGraphicHeight(3.0,Bitmap),3.0,Bitmap); delete Bitmap;

96

Canvas property
Declaration: Category: Components: Description: See Also:

(read only)

property Canvas: TCanvas; Printer TReportFiler, TReportPrinter This method returns the TCanvas object that is being printed on. NOTE: Direct manipulation of the canvas is not supported or captured by TReportFiler (and thus TFilePrinter and TFilePreview). RPDev, TCanvas

Example (Delphi)
{ Save the current canvas } ReportPrinter1.Canvas.Pen := SavePen;

Example (C++ Builder)


// Save the current canvas ReportPrinter1->Canvas->Pen = SavePen;

Center property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property Center: double; relative to Left and Right properties Bar Code TRPBarsBase Sets or returns the position for the horizontal center of the bar code. When a value is assigned to Center the BarCodeJustify property is set to pjCenter as well. BarCodeJustify, Left, Position, Right

Example (Delphi)
Barcode1.Center := (SectionLeft + SectionRight) / 2.0;

Example (C++ Builder)


Barcode1->Center = (rp1->SectionLeft + rp1->SectionRight)/2.0;

CheckSum property
Declaration: Category: Components: Description: See Also:

( read only )

property CheckSum: boolean; Bar Code TRPBarsBase This property returns the checksum character(s) that is/are calculated using the current value of the Text property. If UseChecksum is true, this value will be automatically included in the bar code. UseChecksum

97

Chord method
Declaration: Category: Components: Description: procedure Chord(X1,Y1,X2,Y2,X3,Y3,X4,Y4: double); Graphics TReportFiler, TReportPrinter This method draws a chord inside an ellipse bounded by the rectangle defined by (X1,Y1) and (X2,Y2). The chord starts at the intersection of the line drawn between the ellipse center ((X1+X2)/2.0,(Y1+Y2)/2.0) and the point (X3,Y3) and is drawn to the line drawn between the ellipse center and the point (X4,Y4). Ellipse

See Also:

Example (Delphi)
ReportPrinter1.Chord(1.0,1.0,3.0,3.0,0.0,0.8,3.0,2.0);

Example (C++ Builder)


ReportPrinter1->Chord(1.0,1.0,3.0,3.0,0.0,0.8,3.0,2.0);

Clear method
Declaration: Category: Components: Description: See Also: procedure Clear; Preview TFilePreview This method will remove the TImage from the preview TScrollBox and refresh the display. This method can be useful for clearing the preview screen without having to destroy the preview form. ScrollBox

Example (Delphi)
FilePreview1.Clear; { Clear the preview screen }

Example (C++ Builder)


FilePreview1->Clear(); // Clear the preview screen

ClearAllTabs method
Declaration: Category: Components: Description: See Also: procedure ClearAllTabs; Tabs TReportFiler, TReportPrinter This method will clear the current tab settings as well as all saved tab settings. This call is normally not needed since the tabs are cleared once the report is finished. SaveTabs, ClearTabs

Example (Delphi)
ClearAllTabs; { Clear all tabs, including saved tabs }

Example (C++ Builder)


rp1->ClearAllTabs(); // Clear all tabs, including saved tabs

98

ClearColumns method
Declaration: Category: Components: Description: See Also: procedure ClearColumns; Column TReportFiler, TReportPrinter This method removes all current column settings. SetColumns, SetColumnWidth

Example (Delphi)
ReportPrinter1.ClearColumns;

Example (C++ Builder)


ReportPrinter1->ClearColumns();

ClearRaveBlob method
Declaration: Category: Components: Description: See Also:

{Rave}

procedure ClearRaveBlob; Rave TRaveProject This method will clear the currently loaded report project from the application form. You should not need to call this function since the normal method of clearing the loaded report project is through the TRaveProject.StoreRAV property editor. LoadRaveBlob, RaveBlobDateTime, SaveRaveBlob, StoreRAV

Example (Delphi)
RaveProject1.ClearRaveBlob;

Example (C++ Builder)


RaveProject1->ClearRaveBlob();

ClearTabs method
Declaration: Category: Components: Description: See Also: procedure ClearTabs; Tabs TReportFiler, TReportPrinter This method removes all current tab settings but will leave saved tab settings as they were. SetTab, ResetTabs

Example (Delphi)
ReportPrinter1.ClearTabs;

Example (C++ Builder)


ReportPrinter1->ClearTabs();

99

Close method
Declaration: Category: Components: Description: See Also:

{Rave}

procedure Close; Rave TRaveProject This method will close the report project and unload it from memory. If you call the Open method of TRaveProject, you should insure that this method is called before the application terminates. Active, OnAfterClose, OnAfterOpen, OnBeforeClose, OnBeforeOpen, Open

Example (Delphi)
RaveProject1.Close;

Example (C++ Builder)


RaveProject1->Close();

CodePage property
Declaration: Default: Category: Components: Description: property CodePage: TCodePage128; cpCodeA Bar Code TRPBarsCode128 Specifies whether Code A, Code B or Code C is being used. cpCodeA sets 128 output to Code A cpCodeB sets 128 output to Code B cpCodeC sets 128 output to Code C

( read/write )

Example (Delphi)
CodePage := cpCodeC; { set 128 code output to C } Text := 125692;

Example (C++ Builder)


Barcode1->CodePage = cpCodeC; { set 128 code output to C } Barcode1->Text = 125692;

Col property
Declaration: Default: Category: Components: Description: See Also:

(read only)

property Col: integer; none Label TLabelShell This property will return the current label column that is being printed. This property will only return valid values while the TLabelShell component is executing. Row

Example (Delphi)
Print(On Column + IntToStr(Col));

Example (C++ Builder)


rp1->Print(On Column + IntToStr(Col));

100

Collate property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property Collate: boolean; (will be equal to the collation setting for the default printer) Printer TReportFiler, TReportPrinter This property will enable or disable collation. NOTE: This property is only supported in Delphi 2.0 and will always return false in Delphi 1.0. Not all printer drivers support collation, use SupportCollate to determine availability. SupportCollate

Example (Delphi)
If SupportCollate then begin Collate := true; end; { if }

Example (C++ Builder)


if (rp1->SupportCollate()) { rp1->Collate = true; }

ColumnEnd property
Declaration: Category: Components: Description: See Also:

(read only)

property ColumnEnd: double; Column TReportFiler, TReportPrinter This property will return the horizontal ending position of the current column. This can be useful for printing memo buffers inside of a column. ColumnNum, SetColumns, SetColumnWidth

Example (Delphi)
{ Print memo buffer } SetColumns(3,0.25); MemoBuf.PrintStart := ColumnStart; MemoBuf.PrintEnd := ColumnEnd; PrintMemo(MemoBuf, ColumnLinesLeft, false);

Example (C++ Builder)


// Print memo buffer rp->SetColumns(3,0.25); MemoBuf->PrintStart = rp->ColumnStart; MemoBuf->PrintEnd = rp->ColumnEnd; rp->PrintMemo(MemoBuf, rp->ColumnLinesLeft(), false);

101

ColumnLinesLeft method
Declaration: Category: Components: Description: See Also: function ColumnLinesLeft: integer; Column TReportFiler, TReportPrinter This method returns the number of lines that can be printed above the current SectionBottom for the current column plus all lines that are in remaining columns. This count includes the current line. LinesLeft, all column methods, SectionBottom

Example (Delphi)
SetColumns(4, 0.5); While ColumnLinesLeft > 0 do begin Println(IntToStr( LinesLeft) + '/' + IntToStr(ColumnLinesLeft) + '/' + IntToStr(LineNum) + '/' + IntToStr(ColumnNum) ); end; { while }

Example (C++ Builder)


rp->SetColumns(4, 0.5); while (rp->ColumnLinesLeft() > 0) { rp->Println(IntToStr(rp->LinesLeft()) + AnsiString("/") + IntToStr( rp->ColumnLinesLeft()) + AnsiString("/") + IntToStr( rp->LineNum) + AnsiString("/") + IntToStr( rp->ColumnNum) ); }// while

ColumnNum property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property ColumnNum: integer; 1 Column TReportFiler, TReportPrinter This property will return or set the current column number that the text cursor is on. SetColumns, SetColumnWidth, Columns

Example (Delphi)
CurrColNum := ReportPrinter1.ColumnNum;

Example (C++ Builder)


CurrColNum = ReportPrinter1->ColumnNum;

102

Columns property
Declaration: Category: Components: Description: See Also:

(read only)

property Columns: integer; Column TReportFiler, TReportPrinter This property returns the number of columns that are available from the last call to SetColumns or SetColumnWidth. SetColumns, SetColumnWidth, ColumnNum

Example (Delphi)
CurrColumns := ReportPrinter1.Columns;

Example (C++ Builder)


CurrColumns = ReportPrinter1->Columns;

ColumnStart property
Declaration: Category: Components: Description: See Also:

(read only)

property ColumnStart: double; Column TReportFiler, TReportPrinter This property will return the horizontal starting position of the current column. This can be useful for printing memo buffers inside of a column. ColumnNum, SetColumns, SetColumnWidth

Example (Delphi)
CurrColStart := ReportPrinter1.ColumnStart;

Example (C++ Builder)


CurrColStart := ReportPrinter1->ColumnStart;

ColumnWidth property
Declaration: Category: Components: Description: See Also: property ColumnWidth: double; Column TReportFiler, TReportPrinter This property returns the width of the current column. SetColumns, SetColumnWidth

(read only)

Example (Delphi)
CurrColWidth := ReportPrinter1.ColumnWidth;

Example (C++ Builder)


CurrColWidth := ReportPrinter1->ColumnWidth;

103

ConstraintHeightLeft method
Declaration: Category: Components: Description: NOTE: See Also: function ConstraintHeightLeft(Constraint: double): double; Memo TMemoBuf This method will return the height necessary to print the memo buffer for the current font between PrintStart and PrintEnd. However, for speed purposes, this method will stop processing when the height exceeds the Constraint parameter. You must initialize the TMemoBuf.BaseReport before calling this method. MemoHeightLeft , PrintEnd , PrintMemo , PrintStart , TMemoBuf

Example (Delphi)
MemoBuf.BaseReport := Sender as TBaseReport; HeightLeft := MemoBuf.ConstraintHeightLeft(5.0);

Example (C++ Builder)


MemoBuf->BaseReport = rp; HeightLeft = MemoBuf->ConstraintHeightLeft(5.0);

Copies property
Declaration: Default: Category: Components: Description: NOTE:

(read/write/pub)

See Also:

property Copies: integer; 1 Printer TReportFiler, TReportPrinter This property returns or sets the current number of copies of the report that will be printed by the printer. Not all printers support this function, especially non-laserjet printers. Use MaxCopies to determine availability. For these printers, just call the report multiple times or use TReportFiler and TFilePrinter to speed up report generation. Use a value of 0 to retain the setting defined by TPrinterSetupDialog. MaxCopies

Example (Delphi)
{ Print three copies } ReportPrinter1.Copies := 3;

Example (C++ Builder)


// Print three copies ReportPrinter1->Copies = 3;

104

CopyRect method
Declaration: Category: Components: Description: See Also: procedure CopyRect(const Dest: TRect; Canvas: TCanvas; const Source: TRect); Graphics TReportFiler, TReportPrinter This method copies part of an image defined by the rectangle Source from another canvas to the area on the printer canvas defined by the rectangle Dest. CreateRect, TCanvas, TRect

Example (Delphi)
ReportPrinter1.CopyRect( DstRect, DstCanvas, SrcRect);

Example (C++ Builder)


ReportPrinter1->CopyRect( DstRect, DstCanvas, SrcRect);

CPI property
Declaration: Default: Category: Components: Description: See Also:

( read/write/pub )

property CPI: Double; 10 Misc TTextFiler Sets the Characters per inch for translation from horizontal units to text columns. LeftBorder, LPI, NewPage

Example (Delphi)
TextFiler1.CPI := 17; {Format for printer set to 17cpi}

Example (C++ Builder)


TextFiler1->CPI = 17; // Format for printer set to 17cpi

CR method
Declaration: Category: Components: Description: procedure CR; Position TReportFiler, TReportPrinter This method performs a carriage return which moves the horizontal text cursor position to the beginning of the current line. The beginning of the current line is defined by either the current SectionLeft setting or the setting of ColumnStart if columns are in use. LF, ColumnStart, NewLine, SectionLeft

See Also:

Example (Delphi)
With ReportPrinter1 do begin SectionLeft := 3.0; Println(This text is 3 inches from left); SectionLeft := 1.0; CR; end; { with }

105

Example (C++ Builder)


rp->SectionLeft = 3.0; rp->Println(This text is 3 inches from left); rp->SectionLeft = 1.0; rp->CR();

Create method
Declaration: Category: Components: Description: See Also:

{Bar Code}

constructor Create( BaseRpt: TBaseReport ); Bar Code TRPBarsBase This constructor is called to create an instance of the Bar Code Class. The current reporting object should be passed into the BaseRpt parameter. BaseReport (bar code)

Example (Delphi)
BarCode1 := TRPBarsPostNet.Create(Sender as TBaseReport); With BarCode1 do begin BarHeight := 0.125; BarWidth := 0.020; UseChecksum := True; Text := 85283-3558; {- will be stripped} Left := MarginLeft + 1.0; Print; end; {if} BarCode1.Free;

Example (C++ Builder)


TBaseReport* rp = dynamic_cast<TBaseReport*>(Sender); TRPBarsPostNet* bc1 = new TRPBarsPostNet(rp); bc1->BarHeight = 0.125; bc1->BarWidth = 0.020; bc1->UseChecksum = true; bc1->Text = "85283-3558"; // "-" will be stripped bc1->Left = rp->MarginLeft + 1.0; bc1->Print(); delete bc1;

106

Create method
Declaration: Category: Components: Description: See Also: constructor Create(AOwner: TComponent); Misc TReportFiler, TReportPrinter, TFilePrinter, TFilePreview This constructor should be called to create an instance of a component. This constructor should not normally be called if the component is placed visually on a form. Destroy

Example (Delphi)
{ Dynamically create a ReportPrinter component } var MyReportPrinter: TReportPrinter; begin MyReportPrinter := TReportPrinter.Create(self); With MyReportPrinter do try MarginTop := 1.0; MarginBottom := 1.5; MarginRight := 1.0; MarginLeft := 1.0; OnPrint := MyOnPrintMethod; Execute; finally Free; { This will call the Destroy method } end; { with } end;

Example (C++ Builder)


TReportPrinter* rp1; rp1 = new TReportPrinter(this); try { rp1->MarginTop = 1.0; rp1->MarginBottom = 1.5; rp1->MarginRight = 1.0; rp1->MarginLeft = 1.0; rp1->OnPrint = MyOnPrintMethod; rp1->Execute(); } __finally { delete rp1; }// tryf

107

CreateBrush method
Declaration: Category: Components: Description: function CreateBrush(NewColor: TColor; NewStyle: TBrushStyle; NewBitmap: TBitmap): TBrush; Graphics TReportFiler, TReportPrinter This method will create a TBrush object for the given parameters. If a bitmap is not desired, pass in the value of nil. You can assign this brush to the canvas to change the current brush. NOTE: The brush object returned must be released by calling the free method of TBrush. SetBrush, TBrush, TBrushStyle, TColor, TBitmap

See Also:

Example (Delphi)
var MyBrush: TBrush; begin MyBrush := CreateBrush(clRed, bsSolid, nil); end;

Example (C++ Builder)


TBrush* MyBrush; MyBrush = rp->CreateBrush(clRed, bsSolid, NULL); MyBrush->Free();

108

CreateColumn method
Declaration: Category: Components: Description: function CreateColumn(Description: TComponentName): TTableColumn; TablePrinter Column, TTableColumn, TDBTableColumn Creates a table column. Useful for creating columns at run time when using the DBTablePrinter component.

Example (Delphi)
{ Add columns to DBTablePrinter1 } CurrentWidth := 0.0; FOR I1 := 0 to (ListBox1.Items.Count - 1) do begin IF ListBox1.Selected[I1] then begin WITH CreateColumn(ListBox1.Items[I1]) as TDBTableColumn do begin FieldName := ListBox1.Items[I1]; Heading := ListBox1.Items[I1]; Field := Table1.FindField(ListBox1.Items[I1]); IF Field <> nil then begin Width := Field.DisplayWidth / 10.0; CurrentWidth := CurrentWidth + Width; end; { if } {!! code here to modify other TDBTableColumn properties !!} { Justify := pjCenter; } { OverflowMethod := omWrap; } { Totals := true; } end; { with } end; { if } end; { for }

Example (C++ Builder)


// Add columns to DBTablePrinter1 TDBTablePrinter* tp = new TDBTablePrinter(rp); double CurrentWidth = 0.0; for (int I1 = 0; I1 < ListBox1->Items->Count; I1++) { if (ListBox1->Selected[I1]) { TDBTableColumn* tc = dynamic_cast<TDBTableColumn*> (tp->CreateColumn(ListBox1->Items->Strings[I1])); tc->FieldName = ListBox1->Items->Strings[I1]; tc->Heading = ListBox1->Items->Strings[I1]; TField* Field = Table1->FindField(ListBox1->Items->Strings[I1]); if (Field != NULL) { Width = Field->DisplayWidth / 10.0; CurrentWidth = CurrentWidth + Width; }// if //!! code here to modify other TDBTableColumn properties !! // Justify = pjCenter; // OverflowMethod = omWrap; // Totals = true; }// if }// for

109

CreateFont method
Declaration: Category: Components: Description: function CreateFont(NewName: string; NewSize: integer): TFont; Font TReportFiler, TReportPrinter This method will create a TFont object for the given parameters. NewSize is the point size of the font (1/72nds of an inch). You can assign this font to the canvas to change the current font. NOTE: The font object returned must be released by calling the free method of TFont. Also, it is preferable to use SaveFont and RestoreFont. SetFont, SaveFont, RestoreFont, TFont

See Also:

Example (Delphi)
var MyFont: TFont; begin MyFont := CreateFont(Times New Roman,8.00); end;

Example (C++ Builder)


TFont* MyFont; MyFont = rp->CreateFont(Times New Roman,8.00);

CreatePen method
Declaration: function CreatePen(NewColor: TColor; NewStyle: TPenStyle; NewWidth: integer; NewMode: TPenMode): TPen; Graphics TReportFiler, TReportPrinter This method will create a TPen object for the given parameters. The NewWidth parameter, if positive, is the width of the pen in printer units (dots) and if negative, is the width of the pen in 1/100ths of an inch. You can assign this pen to the canvas to change the current pen. NOTE: The pen object returned must be released by calling the free method of TPen. SetPen, TPen, TPenStyle, TColor, TPenMode

Category: Components: Description:

See Also:

Example (Delphi)
MyPen := CreatePen(clBlack,psSolid,1,pmBlack);

Example (C++ Builder)


MyPen = rp->CreatePen(clBlack,psSolid,1,pmBlack);

110

CreatePoint method
Declaration: Category: Components: Description: See Also: function CreatePoint(X,Y: double): TPoint; Graphics TReportFiler, TReportPrinter This method will return a TPoint record initialized to the point (X,Y). TPoint

Example (Delphi)
MyPoint := CreatePoint(1.00,6.00);

Example (C++ Builder)


MyPoint = rp->CreatePoint(1.00,6.00);

CreateRect method
Declaration: Category: Components: Description: See Also: function CreateRect(X1,Y1,X2,Y2: double): TRect; Graphics TReportFiler, TReportPrinter This method will return a TRect record initialized to the rectangle defined by the points (X1,Y1) and (X2,Y2). CopyRect, TextRect, TRect

Example (Delphi)
MyRect := CreateRect(1.00,6.00,3.00,8.00);

Example (C++ Builder)


MyRect = rp->CreateRect(1.00,6.00,3.00,8.00);

CurrentPage property
Declaration: Category: Components: Description: property CurrentPage: integer; Control TReportFiler, TFilePreview, TReportPrinter This property returns the current page number.

(read only)

Example (Delphi)
WITH FilePreview1 do begin PageEdit.Text := IntToStr(CurrentPage); PageLabel.Caption := 'Page ' + IntToStr(CurrentPage-FirstPage+1) + ' of ' + IntToStr(Pages); end; { with }

Example (C++ Builder)


PageEdit->Text = IntToStr( FilePreview1->CurrentPage); PageLabel->Caption = AnsiString("Page ") + IntToStr(FilePreview1->CurrentPage FilePreview1->FirstPage+1) + AnsiString(" of ") + IntToStr( FilePreview1->Pages);

111

CurrentPass property
Declaration: Category: Components: Description: See Also:

(read/write)

property CurrentPass: Integer; Misc TReportFiler, TReportPrinter This is the value that will be returned when a %c is encountered in a StatusFormat string. Normally set by ReportPrinter and used when printing multiple copies on a printer that does not support that option. StatusFormat, StatusLabel, StatusText, TotalPasses, UpdateStatus

Example (Delphi)
ReportPrinter1.StatusFormat := 'Printing page %p (Pass %c of %s)';

Example (C++ Builder)


ReportPrinter1->StatusFormat = Printing page %p (Pass %c of %s);

CursorXPos property CursorYPos property


Declaration: Category: Components: Description: See Also:

(read only) (read only)

property CursorXPos: longint; property CursorYPos: longint; Position TReportFiler, TReportPrinter These properties return the horizontal and vertical text cursor position in printer units (dots). XPos, YPos

Example (Delphi)
CurrentXDots := ReportPrinter1.CursorXPos;

Example (C++ Builder)


CurrentXDots = ReportPrinter1->CursorXPos;

DataSet property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property DataSet: TDataSet; nil TablePrinter TDBTablePrinter Specifies the dataset to use with the current DBTablePrinter component.

Example (Delphi)
DBTablePrinter1.DataSet := Table2;

Example (C++ Builder)


DBTablePrinter1->DataSet = Table2;

112

DataSet property
Declaration: Default: Category: Components: Description:

{Rave}

(read/write/pub)

property DataSet: TDataSet; nil Rave TRPDataSetConnection Specifies the dataset to use with the current TRPDataSetConnection component.

Example (Delphi)
CustomerCXN.DataSet := CustomerTable;

Example (C++ Builder)


CustomerCXN->DataSet = CustomerTable;

Default method
Declaration: Category: Components: Description: See Also: procedure Default(var Valid: boolean); TablePrinter TTablePrinter, TDBTablePrinter This method will call the original code that would have executed if the OnGetNextRow, OnInitMaster, OnInitTable and OnValidateRow events are not overridden. OnGetNextRow, OnInitMaster, OnInitTable, OnValidateRow

DefaultDest property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property DefaultDest: TReportDest; rdPreview ReportSystem TReportSystem This property will determine the default report destination that appears in the setup dialog. If the setup dialog is disabled then DefaultDest will determine where the report is sent. Valid values are rdFile, rdPreview and rdPrinter. ReportDest, TReportDest

Example (Delphi)
ReportSystem1.DefaultDest := rdPrinter;

Example (C++ Builder)


ReportSystem1->DefaultDest = rdPrinter;

Delete method
Declaration: Category: Components: Description: See Also: procedure Delete(BufPos: longint; DelLen: longint); Memo TDBMemoBuf, TMemoBuf This method will delete DelLen characters starting at BufPos in the memo buffer. Insert

Example (Delphi)
{ Delete 5 characters at current position } MemoBuf.Delete(MemoBuf.Pos,5);

113

Example (C++ Builder)


// Delete 5 characters at current position MemoBuf->Delete(MemoBuf->Pos,5);

DescentHeight property
Declaration: Category: Components: Description: See Also:

(read only)

property DescentHeight: double; Position TReportFiler, TReportPrinter Returns the height of the line font below the baseline. NOTE: This applies to the line font only and not to the current text font. AscentHeight, FontHeight, LineHeight

Description property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property Description: TComponentName; none TablePrinter TTableColumn, TDBTableColumn, TTableSection This property returns or sets the description of a table section or table column component. This property is normally only used at design time to identify an item.

Example (Delphi)
Description := Customer Name;

Example (C++ Builder)


Description = Customer Name;

Design method
Declaration: Category: Components: Description: See Also:

{Rave}

procedure Design; Rave TRaveProject This method will start the execution of the Rave visual designer for the currently selected report. DesignReport, Execute, ExecuteReport, SelectReport

Example (Delphi)
RaveProject1.Design;

Example (C++ Builder)


RaveProject1->Design();

114

DesignReport method
Declaration: Category: Components: Description:

{Rave}

See Also:

procedure DesignReport(ReportName: string); Rave TRaveProject This method will start the execution of the Rave visual designer for the specified report. ReportName is the short name of the report as defined in the report project. If you want to design the report by its full name you will need to call the SelectReport and Design methods. Design, Execute, ExecuteReport

Example (Delphi)
RaveProject1.DesignReport(CustomerListing);

Example (C++ Builder)


RaveProject1->DesignReport(Customer Listing);

Destroy method
Declaration: Category: Components: Description: See Also:
Example:

destructor Destroy; Misc TReportFiler, TReportPrinter, TFilePrinter, TFilePreview The Destroy destructor should never be called directly. To destroy a component created with Create, call the Free method. Create
see Create

DetailKey property
Declaration: Default: Category: Components: Description: See Also: property DetailKey: TFieldName; (empty) TablePrinter TDBTablePrinter Specifies the detail key field in a master-detail report. MasterKey

(read/write/pub)

Example (Delphi)
MasterDBTablePrinter.DataSet := MasterTable; MasterDBTablePrinter.DetailTablePrinter := DetailDBTablePrinter; DetailDBTablePrinter.DataSet := DetailTable; {Key Fields in Master Table} DetailDBTablePrinter.MasterKey := CustNo,InvoiceNo; {Key Fields in Detail Table} DetailDBTablePrinter.DetailKey := CustNo,InvoiceNo;

Example (C++ Builder)


MasterDBTablePrinter->DataSet = MasterTable; MasterDBTablePrinter->DetailTablePrinter = DetailDBTablePrinter; DetailDBTablePrinter->DataSet = DetailTable; // Key Fields in Master Table DetailDBTablePrinter->MasterKey = "CustNo,InvoiceNo"; // Key Fields in Detail Table DetailDBTablePrinter->DetailKey = "CustNo,InvoiceNo";

115

DetailReport property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property DetailReport: TDetailShell; nil Shell TMasterShell, TReportShell This property defines the shell component that will be called to print the detail section of the report. TReportShell components cannot be used as a detail report of another shell component. The Execute method of DetailReport will be called between the OnDetailBefore and OnDetailAfter events. PrintDetail

Example (Delphi)
MasterShell1.DetailReport := DetailShell1;

Example (C++ Builder)


MasterShell1->DetailReport = DetailShell1;

DetailTablePrinter property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property DetailTablePrinter: TBaseShell; nil TablePrinter TTablePrinter, TDBTablePrinter This property defines the table printer component that will be called to print the detail section.

Example (Delphi)
DBTablePrinter1.DetailTablePrinter := DBTablePrinter2;

Example (C++ Builder)


DBTablePrinter1->DetailTablePrinter = DBTablePrinter2;

DeviceName property
Declaration: Category: Components: Description: See Also:

(read only)

property DeviceName: string; Printer TReportFiler, TReportPrinter This property will return the device name for the currently selected printer. PrinterIndex

Example (Delphi)
{ Save current device name } CurrDeviceName := ReportPrinter1.DeviceName;

Example (C++ Builder)


// Save current device name CurrDeviceName = ReportPrinter1->DeviceName;

116

DevMode property
Declaration: Category: Components: Description: See Also:

(read/write)

property DevMode: PDevMode; Printer TReportFiler, TReportPrinter This property provides access to the TDevMode structure for the current printer. After any changes to DevMode are made, ResetPrinter should be called. TDevMode structure in Windows API help.

Example (Delphi)
{ Save current printer device mode} CurrDevMode := ReportPrinter1.DevMode; { Set the print resolution to low } ReportPrinter1.DevMode^.dmPrintQuality := DMRES_LOW;

Example (C++ Builder)


// Save current printer device mode PDevMode CurrDevMode = ReportPrinter1->DevMode; // Set the print resolution to low ReportPrinter1->DevMode->dmPrintQuality = DMRES_LOW;

DisplayFormat property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property DisplayFormat: string; (empty) TablePrinter TTableColumn, TDBTableColumn This property defines the formatting string that will be used when converting numeric or date/time data to text. If this property is blank then default formatting will occur. FormatFloat, FormatDateTime
{Rave}

DLLFile property
Declaration: Default: Category: Components: Description:

(read/write/pub)

Tutorial: NOTE: See Also:

property DLLFile: string; (empty) Rave TRaveProject This property sets the filename that will used if the LoadDesigner property is True. The end user files are either RavePack or RaveSolo DLL depending upon whether or not you are using packages. The end user DLL file can be renamed to better fit your project naming conventions. see Tutorial 28 and 29 for more information about providing end user design. This ONLY is available in the Corporate version of Rave. LoadDesigner

Example (Delphi)
RaveProject.DLLFile := 'MyName.DLL';

Example (C++ Builder)


RaveProject->DLLFile = "MyName.DLL";

117

Draw method
Declaration: Category: Components: Description: See Also: procedure Draw(X,Y: double; Graphic: TGraphic); Graphics TReportFiler, TReportPrinter This method draws Graphic to the printer canvas at the location (X,Y). NOTE: Do not use Draw for bitmaps. Use PrintBitmap or PrintBitmapRect instead. PrintBitmap, PrintBitmapRect, StretchDraw, TGraphic

Example (Delphi)
var MyLogo: TGraphic; begin MyLogo := TMetafile.Create; TRY MyLogo.LoadFromFile(MYLOGO.WMF); ReportPrinter1.Draw(1.0,2.0,MyLogo); finally MyLogo.Free; end; { tryf } end;

Example (C++ Builder)


TGraphic* MyLogo; MyLogo = new TMetafile(); try { MyLogo->LoadFromFile("MYLOGO.WMF"); ReportPrinter1->Draw(1.0,2.0,MyLogo); } __finally { delete MyLogo; }// tryf

DrawExtents property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property DrawExtents: boolean; false Label TLabelShell This property determines whether the sides of the label are drawn. This can be useful for determining the placement of text without having to actually print on labels. DrawPen, DrawPreviewOnly

Example (Delphi)
LabelShell1.DrawExtents := true;

Example (C++ Builder)


LabelShell1->DrawExtents = true;

118

DrawFocusRect method
Declaration: Category: Components: Description: See Also: procedure DrawFocusRect(const Rect: TRect); Graphics TReportFiler, TReportPrinter This method will draw a rectangle, defined by Rect, in the style used to indicate that the rectangle has focus. CreateRect, TRect

Example (Delphi)
ReportPrinter1.DrawFocusRect(CreateRect(1.0,1.0,2.0,3.0));

Example (C++ Builder) ReportPrinter1->DrawFocusRect(rp->CreateRect(1.0,1.0,2.0,3.0));

DrawPen property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property DrawPen: TPen; stock pen Label TLabelShell This property defines the pen used to draw the sides of the label. DrawExtents, DrawPreviewOnly, TPen

Example (Delphi)
LabelShell1.DrawPen.Color := clBlue;

Example (C++ Builder) LabelShell1->DrawPen->Color = clBlue;

DrawPreviewOnly property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property DrawPreviewOnly: boolean; true Label TLabelShell This property will determine whether the label sides drawn by DrawPen appear in the print preview screen only or on both the printer and preview screen. DrawExtents, DrawPen

Example (Delphi)
LabelShell1.DrawPreviewOnly := false;

Example (C++ Builder)


LabelShell1->DrawPreviewOnly = false;

119

DriverName property
Declaration: Category: Components: Description:

(read only)

property DriverName: string; Printer TReportFiler, TReportPrinter This property will return the driver name for the currently selected printer.

Example (Delphi)
{ Save current driver name } CurrPrintDriver := ReportPrinter1.DriverName;

Example (C++ Builder)


// Save current driver name CurrPrintDriver = ReportPrinter1->DriverName;

Duplex property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property Duplex: TDuplex; (will be equal to the duplex setting for the default printer) Printer TReportFiler, TReportPrinter This property will set the duplex mode for the current printer. Not all printers or drivers support duplex printing, use SupportDuplex to determine availability. dupSimplex Simplex mode (Duplex mode NOT initialized) dupHorizontal Duplex mode initialized - print Head to Toe dupVertical Duplex mode initialized - print Head to Head SupportDuplex, TDuplex

Example (Delphi)
If SupportDuplex then begin Duplex := dupVertical; end; { if }

Example (C++ Builder)


if (rp->SupportDuplex()) { rp->Duplex = dupVertical; }// if

Ellipse method
Declaration: Category: Components: Description: See Also: procedure Ellipse(X1,Y1,X2,Y2: double); Graphics TReportFiler, TReportPrinter This method draws an ellipse bounded by the rectangle defined by (X1,Y1) and (X2,Y2). Arc, Pie

Example (Delphi)
Ellipse(5.375,1.25,7.375,2.75);

Example (C++ Builder)


rp->Ellipse(5.375,1.25,7.375,2.75);

120

Empty method
Declaration: Category: Components: Description: See Also: function Empty: boolean; Memo TDBMemoBuf, TMemoBuf This method will return true if the memo buffer does not have anything in it or if the current position, Pos, is beyond the end of the buffer. Pos, Size

Example (Delphi)
If not MemoBuf1.Empty then begin PrintMemo(MemoBuf1,0,false); end; { if }

Example (C++ Builder)


if (!MemoBuf1->Empty()) { rp->PrintMemo(MemoBuf1,0,false); }// if

Enabled property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Enabled: boolean; true ReportSection TReportSection This property will enable or disable the section settings during a call to SetupSection. If this property is set to false then no settings for the section will be used. SetupSection

Example (Delphi)
ReportShell1.SectionGroupFooter.Enabled := false;

Example (C++ Builder) ReportShell1->SectionGroupFooter->Enabled = false;

Engine property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property Engine: TRPComponent; nil Control TDetailShell, TLabelShell, TMasterShell, TReportShell, TDBTablePrinter, TTablePrinter When specified to a ReportPrinter, ReportFiler or ReportSystem component, this property will cause a TXxxShell or an TXxxTablePrinter component to use that component as the "engine" that runs the report, thus precluding the need for an explicit TXxxShell.Execute (or TXxxTablePrinter.Execute) call from the OnPrint event of a ReportSystem (or ReportPrinter) component. You would then only need a call like in the OnClick event for a button, for example, to run the report.

Example (Delphi)
DBTablePrinter1.Execute(nil);

121

Example (C++ Builder)


DBTablePrinter1->Execute(NULL);

Engine property
Declaration: Default: Category: Components: Description:

{Rave}

(read/write/pub)

See Also:

property Engine: TRPComponent; nil Rave TRaveProject This property allows you to define a reporting engine to be used when printing Rave reports through the TRaveProject component. If this property is not defined, a default TReportSystem component will be used. TReportPrinter, TReportFiler, TReportSystem, TRTFFiler, TTextFiler and TRPHTMLFiler are all valid component classes that can be assigned to this property. Execute, ExecuteReport

Example (Delphi)
RaveProject1.Engine := ReportSystem1;

Example (C++ Builder)


RaveProject1->Engine = ReportSystem1;

Execute method
Declaration: Category: Components: Description:

{ Output components }

See Also:

procedure Execute; Control TFilePreview, TFilePrinter, TReportFiler, TReportPrinter, TReportSystem This method will begin the printing task assigned to the component. For report generation components (TReportSystem, TReportFiler, TReportPrinter) the event handlers OnBeforePrint, OnPrint, OnPrintPage, OnNewPage, OnNewColumn, OnPrintHeader, OnPrintFooter and OnAfterPrint will be called at their appropriate times. For TFilePrinter or TFilePreview the contents of the report stream from a TReportFiler will be sent to either the printer or the preview screen. See Start for printing the report for a TFilePreview component. Abort, Printing, All printing event handlers

Example (Delphi)
ReportPrinter1.Execute;

Example (C++ Builder)


ReportPrinter1->Execute();

122

Execute method
Declaration: Category: Components: Description: See Also:

{ Framework components }

procedure Execute(Report: TBaseReport); Control TDetailShell, TLabelShell, TMasterShell, TReportShell, TDBTablePrinter. TTablePrinter This method will start the execution of the report component. This method should only be called while a printing job is in progress from a TReportFiler or TReportPrinter component (typically inside of the OnPrint event). OnPrint

Example (Delphi)
{ Run the report defined by MasterShell2 } MasterShell2.Execute(Sender as TBaseReport);

Example (C++ Builder)


// Run the report defined by MasterShell2 MasterShell2->Execute(dynamic_cast<TBaseReport*>(Sender));

Execute method
Declaration: Category: Components: Description:

{Rave}

See Also:

procedure Execute; Rave TRaveProject This method will start the printing of the currently selected Rave report. This method can be called while a printing job is in progress from a TReportFiler or TReportPrinter component (typically inside of the OnPrint event) to add in the Rave report to the current code generated report. ExecuteReport, SelectReport

Example (Delphi)
RaveProject1.Execute;

Example (C++ Builder)


RaveProject1->Execute();

ExecuteCustom method
Declaration: Category: Components: Description: See Also: procedure ExecuteCustom(NewFirstPage: integer; NewLastPage: integer; NewCopies: integer); Control TFilePrinter This method will print the report but only for the specified parameters. NewCopies, if non-zero, will override the copies setting in the report file. NewFirstPage and NewLast page, if non-zero, will only print the report file for that page range. Execute, Copies

Example (Delphi)
{ Print 2 copies of only the first four pages } FilePrinter1.ExecuteCustom( 1, 4, 2);

123

Example (C++ Builder)


// Print 2 copies of only the first four pages FilePrinter1->ExecuteCustom( 1, 4, 2); {Rave}

ExecuteReport method
Declaration: Category: Components: Description:

See Also:

procedure ExecuteReport(ReportName: string); Rave TRaveProject This method will start the execution of the named Rave report. This method can be called while a printing job is in progress from a TReportFiler or TReportPrinter component (typically inside of the OnPrint event) to add in the Rave report to the current code generated report. Execute

Example (Delphi)
RaveProject1.ExecuteReport(CustomerListing);

Example (C++ Builder)


RaveProject1->ExecuteReport(CustomerListing);

Extended property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property Extended: boolean; false Bar Code TRPBarsCode39 If this property is true then it will output Extended Code 39 format. ExtendedText

Example (Delphi)
Extended := True; Text := Test Data;

Example (C++ Builder)


Extended = true; Text = Test Data;

ExtendedText property
Declaration: Category: Components: Description: See Also:

( read only )

property ExtendedText: string; Bar Code TRPBarsCode39 When Extended is true, this property will contain the converted Code39 text that will be printed in the bar code. Extended, Text

Example (Delphi)
ShowMessage(The raw data of this Code 39 BarCode is + Code39Bar.ExtendedText);

124

Example (C++ Builder)


ShowMessage(The raw data of this Code 39 BarCode is + Code39Bar->ExtendedText);

Field property
Declaration: Category: Components: Description: See Also:

(write only)

property Field: TMemoField; Memo TDBMemoBuf This property will assign the contents of a TMemoField component to the memo buffer. Pos, Size, TMemoField

Example (Delphi)
MemoBuf1.Field := MyMemoField;

Example (C++ Builder)


MemoBuf->Field = MyMemoField;

FieldAliasList property
Declaration: Default: Components: Description:

{Rave}

(read/write/pub)

property FieldAliasList: TStrings; (blank) All TRaveDataConnection components With this property you can provide aliases or remove fields entirely in your application as far as the Rave designer is concerned. This can be used to provide easier to understand field names, remove unnecessary fields or to remove the need to read large blob fields out of reports that don't use them. The property is a simple string list and each line takes the form of "FieldName=FieldAlias". To remove a field from the list of fields that are sent to Rave, leave the FieldAlias blank. Fields that are not listed in the FieldAliasList will be passed to Rave as is (the default behavior). Field aliases can include blanks or other non-alphanumeric characters, but by doing so, the characters < and > will be automatically added around the field names for all field name references within Rave.

FieldName property
Declaration: Default: Category: Components: Description: See Also: Example:

(read/write/pub)

property FieldName: TFieldName; (empty) TablePrinter TDBTableColumn Specifies the field name that the current column will get its data from DBTable.DataSet. DataSet, LookupDataSet, LookupDisplay, LookupKey See Tutorial 14.

125

FileName property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property FileName: String; (empty) Control TFilePrinter, TRPHTMLFiler, TRTFFiler, TTextFiler Specifies the file name to create when the execute method is called. For the TextFiler component, if you want to go directly out to a printer in text mode (much faster for dot-matrix printers than going through the Windows printer driver), then define FileName as PRN, LPT1 or LPT2.

Example (Delphi)
RTFFiler1.FileName := DOC1.RTF;

Example (C++ Builder)


RTFFiler1->FileName = DOC1.RTF;

FillRect method
Declaration: Category: Components: Description: See Also: procedure FillRect(const Rect: TRect); Graphics TReportFiler, TReportPrinter This method fills the rectangle defined by Rect with the current brush. CreateRect, TRect

Example (Delphi)
FillRect( CreateRect( 1.0, 1.0, 2.0, 3.0 ) );

Example (C++ Builder)


rp->FillRect(rp->CreateRect(1.0, 1.0, 2.0, 3.0));

Finish method
Declaration: Category: Components: Description: See Also: procedure Finish; Control TFilePreview, TReportFiler, TReportPrinter This method finishes a preview session for the TFilePreview component or finishes a print job for TReportPrinter and TReportFiler. Start must have been called first before Finish will be a valid call. Start

Example (Delphi)
FilePreview1.Finish;

Example (C++ Builder)


FilePreview1->Finish();

126

FinishTabBox method
Declaration: Category: Components: Description: procedure FinishTabBox(Width: integer); Tabs TReportFiler, TReportPrinter Draws the top line for the current set of tabs using a line width of Width. Useful when printing a table drawn with the setting of BOXLINELEFTRIGHT to finish the bottom of each tab box. This function can also be called at the beginning to draw the top line of the table. SetTab

See Also:

Example (Delphi)
ClearTabs; SetTab(0.5,pjLeft,1.5,5,BOXLINELEFTRIGHT,0); SetTab(NA, pjLeft,1.5,5,BOXLINELEFTRIGHT,0); SetTab(NA, pjLeft,4.5,5,BOXLINELEFTRIGHT,0); FinishTabBox(1); PrintTab('Name'); PrintTab('Picture'); PrintTab('Description'); NewLine; FinishTabBox(1);

Example (C++ Builder)


rp->ClearTabs(); rp->SetTab(0.5,pjLeft,1.5,5,BOXLINELEFTRIGHT,0); rp->SetTab(NA, pjLeft,1.5,5,BOXLINELEFTRIGHT,0); rp->SetTab(NA, pjLeft,4.5,5,BOXLINELEFTRIGHT,0); rp->FinishTabBox(1); rp->PrintTab("Name"); rp->PrintTab("Picture"); rp->PrintTab("Description"); rp->NewLine(); rp->FinishTabBox(1);

FirstPage property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property FirstPage: integer; 1 Control TReportFiler, TReportPrinter This property defines the first page of a range of pages to send to the printer. If the current page is outside this range, the property PageInvalid will be true. PageInvalid

Example (Delphi)
{ print only pages 3 through 5} ReportPrinter1.FirstPage := 3; ReportPrinter1.LastPage := 5;

127

Example (C++ Builder)


// print only pages 3 through 5 ReportPrinter1->FirstPage = 3; ReportPrinter1->LastPage = 5;

FloodFill method
Declaration: Category: Components: Description: procedure FloodFill(X,Y: double; Color: TColor; FillStyle: TFillStyle); Graphics TReportFiler, TReportPrinter This method fills an area of the printer canvas using the current brush. FloodFill begins at the point (X,Y) and fills until the boundary specified by the color, Color, is encountered. FillStyle defines the method of fill used. (fsBorder will fill until the color, Color, is encountered and fsSurface will fill while the color, Color, is still encountered.) PageInvalid, TColor

See Also:

Example (Delphi)
FloodFill(2.0,3.0,clRed,fsBorder);

Example (C++ Builder)


FloodFill(2.0,3.0,clRed,fsBorder);

Font property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Font: TFont; System font TablePrinter TTableColumn, TDBTableColumn, TTableSection, TTablePrinter This property defines or returns the font that will be used to draw the contents of a table section or table column. UseParentFont, Other FontXxxx properties

Example (Delphi)
TableColumn.Font.Color := clRed;

Example (C++ Builder)


TableColumn->Font->Color = clRed;

128

FontAlign property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property FontAlign: TFontAlign; faBaseline Font TReportFiler, TReportPrinter Returns or sets the current font alignment. faTop will align text at the top of the font located at FontTop. faBaseline will align text at the baseline of the font located at FontBaseline. faBottom will align text at the bottom of the font located at FontBottom. Other FontXxxx properties, SetFont, FontTop, FontBaseline, FontBottom, ResetLineHeightshould link to font category

Example (Delphi)
FontAlign := faTop; Print('This text is aligned at the top'); FontAlign := faBaseline;

Example (C++ Builder)


rp->FontAlign = faTop; rp->Print(This text is aligned at the top); rp->FontAlign = faBaseline;

FontBaseline property
Declaration: Default: Category: Component: Description: See Also: property FontBaseline: double; see ResetLineHeight Position TReportFiler, TReportPrinter Returns or sets the baseline of the line font FontBottom, FontTop, LineBottom, LineMiddle, LineTop

(read/write)

Example (Delphi)
FontBaseline := 1.8;

Example (C++ Builder)


rp->FontBaseline = 1.8;

FontBottom property
Declaration: Default: Category: Components: Description: See Also: property FontBottom: double; see ResetLineHeight Position TReportFiler, TReportPrinter Returns or sets the bottom of the line font FontBaseline, FontTop, LineBottom, LineMiddle, LineTop

(read/write)

Example (Delphi)
FontBottom := 2.0;

Example (C++ Builder)


rp->FontBottom = 2.0;

129

FontCharset property
Declaration: Default: Category: Components: Description:

(read/write)

property FontCharset: byte; DEFAULT_CHARSET Font TReportFiler, TReportPrinter Allows you to change the character set of the current font. Other values can be found in the Windows API help under LOGFONT.

Example (Delphi)
FontCharSet := GREEK_CHARSET;

Example (C++ Builder)


rp->FontCharset = GREEK_CHARSET;

FontColor property
Declaration: Default: Category: Components: Description: See Also: property FontColor: TColor;
clBlack

(read/write)

Font TReportFiler, TReportPrinter Returns or sets the font color. Other FontXxxx properties, SetFont, TColor

Example (Delphi)
FontColor := clRed; Print('This text is in red.');

Example (C++ Builder)


rp->FontColor = clRed; rp->Print(This text is in red.);

FontHandle property
Declaration: Category: Components: Description:

(read only)

property FontHandle: HFont; Font TReportFiler, TReportPrinter This property will return the windows handle for the current ReportPrinter font. This property will not normally be used but is provided for situations that require access to the ReportPrinter font. NOTE: Canvas.Font.Handle will not equal FontHandle.

130

FontHeight property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property FontHeight: double; see ResetLineHeight Font TReportFiler, TReportPrinter Returns or sets the height of the line font. NOTE: This applies to the line font only and not the current text font. Other FontXxxx properties, AscentHeight, DescentHeight, LineHeight

Example (Delphi)
FontHeight := 0.25;

Example (C++ Builder)


rp->FontHeight = 0.25;

FontIndex property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property FontIndex: integer; 0 ReportSection TReportSection This property defines the saved font position that will be initialized when the report section is initialized during the call to SetupSection. A value of 0 will not cause any font settings to be changed. SaveFont, RestoreFont

Example (Delphi)
ReportShell1.SectionGroupFooter.FontIndex := 1;

Example (C++ Builder)


ReportShell1->SectionGroupFooter->FontIndex = 1;

FontName property
Declaration: Default: Category: Components: Description: See Also: property FontName: string; 'System' Font TReportFiler, TReportPrinter Returns or sets the current font name. Other FontXxxx properties, SetFont

(read/write)

Example (Delphi)
FontName := 'Times New Roman';

Example (C++ Builder)


rp->FontName = Times New Roman;

131

FontPitch property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property FontPitch: TFontPitch; fpDefault Font TReportFiler, TReportPrinter Returns or sets the pitch setting for the current font. The normal setting of fpDefault will use the font's normal pitch. fpFixed will attempt to convert the font to a fixedwidth font and fpVariable will attempt to convert the font to a variable-width font. Setting a font to a pitch other than what it was designed for may have no effect or may cause another font to be substituted in its place. Other FontXxxx properties, SetFont

Example (Delphi)
FontPitch := fpVariable;

Example (C++ Builder)


rp->FontPitch = fpVariable;

FontRotation property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property FontRotation: integer; 0 Font TReportFiler, TReportPrinter Returns or sets the font rotation in degrees from 0 to 359. 0 is for normal text and the angles increase counter-clockwise. The text cursor will be updated according to the FontRotation. Other FontXxxx properties

Example (Delphi)
FontRotation := 45; Print('This text is at 45 degrees'); FontRotation := 0; Print('This is normal text');

Example (C++ Builder)


rp->FontRotation = 45; rp->Print("This text is at 45 degrees"); rp->FontRotation = 0; rp->Print("This is normal text");

132

Fonts property
Declaration: Default: Category: Components: Description: See Also:

(read only)

property Fonts: TStrings; (list of fonts supported by the default printer) Printer TReportFiler, TReportPrinter This property will return a TStringList containing all of the fonts supported by the current printer. FontName, SetFont, TStrings

Example (Delphi)
{ Display the supported fonts in a TComboBox } Combobox1.Items := ReportPrinter1.Fonts;

Example (C++ Builder)


ComboBox1->Items = ReportPrinter1->Fonts;

FontSize property
Declaration: Default: Category: Components: Description: See Also: property FontSize: double; 10 Font TReportFiler, TReportPrinter Returns or sets the point size of the current font. Other FontXxxx properties OR SetFont

(read/write)

Example (Delphi)
FontSize := 8; Print('Small'); FontSize := 36; Print('Large');

Example (C++ Builder)


rp->FontSize = 8; rp->Print(Small); rp->FontSize = 36; rp->Print(Large);

FontTop property
Declaration: Default: Category: Component: Description: See Also: property FontTop: double; see ResetLineHeight Position TReportFiler, TReportPrinter Returns or sets the top of the line font Other FontXxxx properties, LineBottom, LineMiddle, LineTop

(read/write)

Example (Delphi)
{ Place the top of the text at 2.25" } FontTop := 2.25;

Example (C++ Builder)


// Place the top of the text at 2.25" rp->FontTop = 2.25;

133

FontWidth property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property FontWidth: double; 0 Font TReportFiler, TReportPrinter This is used to override the average character width for a font in units. To use normal character sizes, specify a value of 0. FontSize

Example (Delphi)
FontWidth := 0.25; {set average character width to inch}

Example (C++ Builder)


rp->FontWidth = 0.25; // set average character width to inch

FormFeed property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property FormFeed: boolean; True Position TTextFiler Determines whether TTextFiler prints the text contained in FormFeedStr at the end of each page. FormFeedStr, NewPage

Example (Delphi)
{Dont insert the formfeed character into the text file} TTextFiler1.FormFeed := False;

Example (C++ Builder)


//Dont insert the formfeed character into the text file TTextFiler1->FormFeed = false;

FormFeedStr property
Declaration: Default: Category: Components: Description: See Also: property FormFeedStr: string; Chr( 12 ) Position TTextFiler Sets the string that will be used to print out for a form feed. FormFeed, NewPage

(read/write)

Example (Delphi)
{Reset Epson Printer back to 6 lpi and 12 cpi (Elite)} TTextFiler.FormFeedStr := #12 + #27 + 2 + #27 + M;

Example (C++ Builder)


char PrinterStr[] = {12,27,2,27,'M',0}; TextFiler1->FormFeedStr = PrinterStr;

134

FrameMode property
Declaration: Default: Category: Components: Description:

(read/write)

property FrameMode: TFrameMode; fmInside Graphics TReportFiler, TReportPrinter This property determines the technique used to draw the frames (borders) around graphical shapes such as rectangles and ellipses. This property will only have a noticeable effect with large pen widths.

fmInside

The frame will be drawn inside the dimensions of the shape

fmSplit

The frame will be drawn centered over the dimensions of the shape

fmOutside

The frame will be drawn outside the dimensions of the shape

See Also:

NOTE: If you are converting a report from RP 1.1 or 2.0 that uses thick pens, you should set the frame mode to fmSplit which was the mode used by those older versions. Ellipse, Rectangle

Example (Delphi)
FrameMode := fmOutside;

Example (C++ Builder)


rp->FrameMode = fmOutside;

FrameRect method
Declaration: Category: Components: Description: See Also: procedure FrameRect(const Rect: TRect); Graphics TReportFiler, TReportPrinter This method draws the rectangle Rect using the current brush to draw the border of the rectangle. FrameRect does not fill the rectangle with the current brush. CreateRect, TRect

Example (Delphi)
ReportPrinter1.FrameRect( CreateRect( 1.0,1.0, 2.0,3.0 ) );

135

Example (C++ Builder)


ReportPrinter1->FrameRect( rp->CreateRect(1.0,1.0,2.0,3.0) );

FreeSaved method
Declaration: Category: Components: Description: See Also: procedure FreeSaved; Memo TDBMemoBuf, TMemoBuf This method will free the memory allocated by a previous call to SaveBuffer. This method is normally not needed as the saved buffer is freed when the memo buffer is freed. SaveBuffer, RestoreBuffer

Example (Delphi)
MemoBuf1.FreeSaved;

Example (C++ Builder)


MemoBuf1->FreeSaved();

GetMemoLine method
Declaration: Category: Components: Description: function GetMemoLine( MemoBuf: TMemoBuf; var EOL: boolean): string; Memo TReportFiler, TReportPrinter This method will return a single line from the memo buffer each time it is called. You can print the memo buffer line by line by placing this function inside a Println statement. EOL returns true when it encounters a carriage return or the end of the memo buffer. PrintMemo, MemoLines, TMemoBuf

See Also:

Example (Delphi)
Println(GetMemoLine(MemoBuf, EOL));

Example (C++ Builder)


rp->Println(rp->GetMemoLine(MemoBuf, EOL));

GetNextLine method
Declaration: Category: Components: Description: function GetNextLine(var EOL: boolean): string; Memo TReportFiler, TReportPrinter This method will return a single line from the memo buffer each time it is called. You can print the memo buffer line by line by placing this function inside a Println statement. EOL returns true when it encounters a carriage return or the end of the memo buffer. You must initialize the TMemoBuf.BaseReport before calling this method. PrintMemo, MemoLines, TMemoBuf

NOTE: See Also:

Example (Delphi)
Println(GetNextLine(EOL));

136

Example (C++ Builder)


rp->Println(rp->GetNextLine(EOL));

GetReportCategoryList method
Declaration: Category: Components: Description:

{Rave}

Note: See Also:

procedure GetReportCategoryList(ReportList: TStrings; Categories: string); FullName: boolean); Rave TRaveProject This method will allow you to get all of the reports matching specific categories. If you had categories called Accounting, General, Status and System. Now if you want to get a list of all reports except System, then you would call RaveProject1.GetReportCategoryList(ReportList, 'Accounting; Status; General; ;). If FullName is true, this will return the full names of all reports in the current report project and if it is false, it will return the short names of the reports. The double "; ;" at the end of the category list is to include all reports where the category is not defined (the default value). SelectReport
{Rave}

GetReportList method
Declaration: Category: Components: Description:

See Also:

procedure GetReportList(ReportList: TStrings; FullName: boolean); Rave TRaveProject This method will fill ReportList with a list of Rave defined reports that could then be used in a list box or other TStrings compatible object. ReportList must be an already created TStrings object. If FullName is true, this will return the full names of all reports in the current report project and if it is false it will return the short names of the reports. SelectReport

GetTab method
Declaration: Category: Components: Description: function GetTab(Index: integer): PTab; Tabs TReportFiler, TReportPrinter This method will return the tab setting specified by Index. If Index is 0 then GetTab will return the current tab setting and if Index is greater than the number of defined tabs then a value of nil will be returned. See RPDEFINE.PAS for information on the PTab structure. TabIndex

See Also:

137

GotoFooter method
Declaration: Category: Components: Description: See Also: procedure GotoFooter; Position TReportFiler, TReportPrinter This method will position the text cursor just above the current SectionBottom. PrintFooter, MarginBottom, SectionBottom

Example (Delphi)
GotoFooter; Print(Line just above SectionBottom);

Example (C++ Builder)


rp->GotoFooter(); rp->Print(Line just above SectionBottom);

GotoHeader method
Declaration: Category: Components: Description: See Also: procedure GotoHeader; Position TReportFiler, TReportPrinter This method will position the text cursor just below the current SectionTop. PrintHeader, MarginTop, SectionTop

Example (Delphi)
ReportPrinter1.GotoHeader; ReportPrinter1.Print(Line just below SectionTop);

Example (C++ Builder)


ReportPrinter1->GotoHeader(); ReportPrinter1->Print(Line just below SectionTop);

GotoXY method
Declaration: Category: Components: Description: See Also: procedure GotoXY(NewXPos: double; NewYPos: double); Position TReportFiler, TReportPrinter This method will move the text cursor to the position NewXPos, NewYPos. XPos, YPos

Example (Delphi) { This code shows how to position the output at specific coordinates. }
GotoXY(1.0,8.5); Print('Text at 1.0,8.5');

Example (C++ Builder)


// This code shows how to position the output at specific coordinates. rp->GotoXY(1.0,8.5); rp->Print(Text at 1.0,8.5);

138

GrandTotal property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property GrandTotal: double; 0.0 TablePrinter TTableColumn, TDBTableColumn This property returns or sets the current grand total for a table column. This value is used by a table section with an OutputType of otGrandTotals. PageTotal, SubTotal, OutputType

Example (Delphi)
TableColumn.GrandTotal := 0.0;

Example (C++ Builder)


TableColumn->GrandTotal = 0.0;

GraphicFieldToBitmap method
Declaration: Category: Components: Description:
procedure GraphicFieldToBitmap(GraphicField: TGraphicField; Bitmap: TBitmap);

See Also:

Graphics TReportFiler, TReportPrinter This method will convert a TGraphicField (graphical data from a database) to a bitmap. NOTE: You must include RPDBUTIL in your Uses statement to access this procedure. PrintBitmap, PrintBitmapRect, TBitmap, TGraphicField

Example (Delphi)
{ Convert and print a TGraphicField } Bitmap := TBitmap.Create; GraphicFieldToBitmap(Table1Graphic,Bitmap); PrintBitmapRect(5.375,3.5,7.375,5.5,Bitmap); Bitmap.Free;

Example (C++ Builder)


// Convert and print a TGraphicField Bitmap := new Graphic::TBitmap(); rp->GraphicFieldToBitmap(Table1Graphic,Bitmap); rp->PrintBitmapRect(5.375,3.5,7.375,5.5,Bitmap); delete Bitmap;

139

GridHoriz property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property GridHoriz: double; 0.0 Preview TFilePreview, TReportSystem This property will define the horizontal spacing, in units for a grid that will appear on the preview screen. A value of 0.0 will turn off the horizontal grid. GridPen, GridVert

Example (Delphi)
GridHoriz := 0.25;

Example (C++ Builder)


GridHoriz = 0.25;

GridPen property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property GridPen: TPen; (Standard Pen) Preview TFilePreview, TReportSystem This property defines the pen used to draw the grid defined by GridVert and GridHoriz. GridVert, GridHoriz, RulerType, TPen

Example (Delphi)
GridPen.Color := clAqua;

Example (C++ Builder)


GridPen->Color = clAqua;

GridVert property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property GridVert: double; 0.0 Preview TFilePreview, TReportSystem This property will define the vertical spacing, in units for a grid that will appear on the preview screen. A value of 0.0 will turn off the vertical grid. GridPen, GridHoriz

Example (Delphi)
GridVert := 0.5;

Example (C++ Builder)


GridVert = 0.5;

140

Heading property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Heading: TFormatString; (empty) TablePrinter TTableColumn, TDBTableColumn This property returns or sets the default heading for a table column. This value will be printed by any table sections with an OutputType of otHeadings. OutputType

Example (Delphi)
TableColumn.Heading := Name;

Example (C++ Builder)


TableColumn->Heading = Name;

Height property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Height: double 0.0 ReportSection TReportSection This property defines the minimum height for a section. If the value is 0 then no minimum height will be required. If the value is greater than zero and there is not enough room in the section a new page will be generated. HeightMethod, Reprint

Example (Delphi)
ReportSection.HeightMethod := hmUnits; ReportSection.Height := 0.5;

Example (C++ Builder)


ReportSection->HeightMethod = hmUnits; ReportSection->Height = 0.5;

Height property
Declaration: Category: Components: Description: See Also:

{Bar Code}

( read only )

property Height: double; Bar Code TRPBarsBase This is a read only property which contains the height of the entire bar code. If the PrintReadable property is set to true, then the Height property contains the bar code height plus the line height of the current font. BarHeight, PrintReadable

Example (Delphi)
TotalBarHeight := Height; IF TotalBarHeight > 1.0 then begin BarHeight := 1.0; {set total height to 1.0 inches} end; { if}

141

Example (C++ Builder)


TotalBarHeight = rp->Height; if (TotalBarHeight > 1.0) { BarHeight = 1.0; // set total height to 1.0 inches }// if

HeightMethod property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property HeightMethod: THeightMethod; hmLines ReportSection TReportSection This property defines the units that MinHeight is measured in. hmUnits will define the height in terms of units while hmLines will define the height in terms of a number of lines (defined by LineHeight). MinHeight

Home method
Declaration: Category: Components: Description: procedure Home; Position TReportFiler, TReportPrinter This method will move the text cursor to the beginning of line 1.

Example (Delphi)
SetFont(Arial,10); Home; Print(Text in the Home position);

Example (C++ Builder)


rp->SetFont(Arial,10); rp->Home(); Print(Text in the Home position);

IgnoreFileSettings property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property IgnoreFileSettings: boolean False Misc TFilePrinter When this is set to true it will ignore the printer setup values (Paper Bin, Duplex, Collate, Copies) stored in the report file and will use whatever is currently set by the user. This allows a PrinterSetupDialog to be called before the Execute method. ShowPrinterSetupDialog, ShowPrintDialog

Example (Delphi)
If FilePrinter1.ShowPrinterSetupDialog then begin FilePrinter1.IgnoreFileSettings := True; FilePrinter1.Execute; end; {if}

142

Example (C++ Builder)


if (FilePrinter1->ShowPrinterSetupDialog()) { FilePrinter1->IgnoreFileSettings = true; FilePrinter1->Execute(); }// if

Insert method
Declaration: Category: Components: Description: See Also: procedure Insert(BufPos: longint; Text: string); Memo TDBMemoBuf, TMemoBuf This method will insert Text into the memo buffer at BufPos. BufPos should be 0 to insert before the entire buffer. Append

Example (Delphi)
MemoBuf.Insert(0,'This text will now be first');

Example (C++ Builder)


MemoBuf->Insert(0,This text will now be first);

InsertMemoBuf method
Declaration: Category: Components: Description: See Also: procedure InsertMemoBuf(BufPos: longint; MemoBuf: TMemoBuf); Memo TDBMemoBuf, TMemoBuf Will insert a MemoBuf at BufPos into the current memo buffer. AppendMemoBuf

Example (Delphi)
MemoBuf1.InsertMemoBuf(10,MemoBuf2);

Example (C++ Builder)


MemoBuf1->InsertMemoBuf(10,MemoBuf2);

IsNewPage property
Declaration: Category: Components: Description:

(read only)

property IsNewPage: boolean; Shell TDetailShell, TMasterShell, TReportShell This property will be true immediately after a new page is generated and will remain true until after the first row is printed. This can be useful for determining if a title bar for a table needs to be printed.

Example (Delphi)
If IsNewPage then begin ReprintTitleBar; end; { if } PrintNormalData;

143

Example (C++ Builder)


if (ReportShell->IsNewPage) { ReprintTitleBar(); }// if PrintNormalData();

IsReprint property
Declaration: Category: Components: Description: See Also:

(read only)

property IsReprint: boolean; Shell TDetailShell, TMasterShell, TReportShell This property will be true inside the printing events if they were called to print again. This can happen as a result of the Reprint property or by a call to any of the Shell PrintXxxx methods (such as PrintBodyHeader). Reprint, all Shell PrintXxxx methods

Example (Delphi)
ReportPrinter.Print('Normal Data'); IF IsReprint then begin ReportPrinter.Print(' - continued...'); end; { if } ReportPrinter.NewLine;

Example (C++ Builder)


ReportPrinter->Print("Normal Data"); if (ReportShell->IsReprint) { ReportPrinter->Print(" - continued..."); }// if ReportPrinter->NewLine();

IsValidChar method
Declaration: Category: Components: Description: See Also: function IsValidChar( Ch: char ): boolean; Bar Code RPBars, (each one of the RPBars Classes) Is used to determine whether a character is a valid character for the particular bar code being printed. na

Example (Delphi)
Code2of5.IsValidCar(A) { will return false because 2of5 only support numbers }

Example (C++ Builder)


Code2of5->IsValidCar(A) // will return false because 2of5 only support numbers

144

Italic property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property Italic: boolean; false Font TReportFiler, TReportPrinter This property returns or sets the italic attribute for the current font. Bold, Underline, Strikeout

Example (Delphi)
Italic := true; Print(Italic Text); Italic := false;

Example (C++ Builder)


rp->Italic = true; rp->Print("Italic Text"); rp->Italic = false;

Justify property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Justify: TPrintJustify; pjLeft TablePrinter TTableColumn, TDBTableColumn, TTableSection This property returns or sets the horizontal justification of the column data in the row box. TPrintJustify

Example (Delphi)
TableColumn.Justify := pjRight;

Example (C++ Builder)


TableColumn->Justify = pjRight;

Justify property
Declaration: Default: Category: Components: Description:

{MemoBuf}

(read/write)

See Also:

property Justify: TPrintJustify; pjLeft Memo TDBMemoBuf, TMemoBuf This property sets the justification that PrintMemo will use when printing the memo buffer. Valid values are pjBlock pjCenter pjLeft pjRight PrintMemo

Example (Delphi)
MemoBuf.Justify := pjBlock; { Set block justification }

145

Example (C++ Builder)


MemoBuf->Justify = pjBlock; // Set block justification

JustifyVert property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property JustifyVert: TPrintJustifyVert; pjTop TablePrinter TTableColumn, TDBTableColumn, TTableSection This property returns or set the vertical justification of the column data in the row box. TPrintJustifyVert

Example (Delphi)
TableColumn.JustifyVert := pjMiddle;

Example (C++ Builder)


TableColumn->JustifyVert = pjMiddle;

LabelBrand property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property LabelBrand: TLabelBrand; lbAV5160 Label TLabelShell This property can be used to define the brand of labels that you are using. There are many model numbers for the Avery label line already supported or you can type in your own selections using the lbCustom value.

Example (Delphi)
LabelShell1.LabelBrand := lbAV5267;

Example (C++ Builder)


LabelShell1->LabelBrand = lbAV5267;

LabelHeight property
Declaration: Default: Category: Components: Description: See Also: property LabelHeight: double; 1.0 Label TLabelShell This property defines the height of the label in units. LabelWidth, NumAcross, NumDown, SpacingXXX properties

(read/write/pub)

Example (Delphi)
LabelShell1.LabelHeight := 0.75;

Example (C++ Builder)


LabelShell1->LabelHeight = 0.75;

146

LabelShape property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property LabelShape: TLabelShape; lsRoundRect Label TLabelShell Specifies the shape of the label extents that appear in the preview screen. lsRoundRect represents a rectangle with the corners rounded off lsRect represents a rectangle with square corners lsRound represents an elliptical or circular shape

LabelWidth property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property LabelWidth: double; 2.63 Label TLabelShell This property defines the width of the label in units. LabelHeight, NumAcross, NumDown, SpacingXXX properties

Example (Delphi)
LabelShell1.LabelWidth := 2.5;

Example (C++ Builder)


LabelShell1->LabelWidth = 2.5;

LastPage property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property LastPage: integer; 9999 Control TReportFiler, TReportPrinter This property defines the last page for a range of pages to send to the printer. If the current page is outside of this range, the property PageInvalid will be true. PageInvalid

Example (Delphi)
{ Print only pages 3 through 5 } ReportPrinter1.FirstPage := 3; ReportPrinter1.LastPage := 5;

Example (C++ Builder)


// Print only pages 3 through 5 ReportPrinter1->FirstPage = 3; ReportPrinter1->LastPage = 5;

147

Left property
Declaration: Default: Category: Components: Description: See Also:

{Bar Code}

( read/write )

property Left: double; XPos Bar Code TRPBarsBase Sets or returns the position for the left edge of the bar code. When a value is assigned to Left, the BarCodeJustify property is set to pjLeft as well. BarCodeJustify, Center, Position, Right

Example (Delphi)
Left := 4.5; {start at 4.5 inches from left side}

Example (C++ Builder)


Left = 4.5; //start at 4.5 inches from left side

Left property
Declaration: Default: Category: Components: Description: See:

{ReportSection}

(read/write/pub)

property Left: double; 0.0 ReportSection TReportSection These properties define the placement for each side of the section. All values are in units and are relative to a specific position on the page, such as the page or margin edge, which is defined by the relative XxxxMethod property (such as LeftMethod). Bottom (for description and example), Left, LeftMethod, Right, Top

LeftBorder property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property LeftBorder: Double; 0 Position TTextFiler Sets the waste area for the left edge of the page. For dot-matrix printers, this value should normally be 0 and for laser or inkjet printers, the value should equal the left waste width. CPI, TopBorder

Example (Delphi)
TextFiler1.LeftBorder := 0.25;

Example (C++ Builder)


TextFiler1->LeftBorder = 0.25;

LeftMethod property
Declaration: Default: Category: Components: See Also: 148 property LeftMethod: TDistanceMethod; dmMargin (except TopMethod is dmSpecial) ReportSection TReportSection BottomMethod (for description and example), Left

(read/write/pub)

LeftWaste property
Declaration: Category: Components: Description: See Also:

(read only)

property LeftWaste: double; Printer TReportFiler, TReportPrinter This property returns the waste area on the left side of the page that the printer cannot print into. It is a good idea to make sure that the reports margins are greater than or equal to its waste areas. BottomWaste , MarginLeft , RightWaste , TopWaste

Example (Delphi)
{ Dont output in the printer waste regions } IF MarginLeft < LeftWaste then begin MarginLeft := LeftWaste; end; { if } IF MarginRight < RightWaste then begin MarginRight := RightWaste; end; { if } IF MarginTop < TopWaste then begin MarginTop := TopWaste; end; { if } IF MarginBottom < BottomWaste then begin MarginBottom := BottomWaste; end; { if }

Example (C++ Builder)


// Don't output in the printer waste regions if (rp->MarginLeft < rp->LeftWaste) { rp->MarginLeft = rp->LeftWaste; }// if if (rp->MarginRight < rp->RightWaste) { rp->MarginRight = rp->RightWaste; }// if if (rp->MarginTop < rp->TopWaste) { rp->MarginTop = rp->TopWaste; }// if if (rp->MarginBottom < rp->BottomWaste) { rp->MarginBottom = rp->BottomWaste; }// if

149

LF method
Declaration: Category: Components: Description: procedure LF; Position TReportFiler, TReportPrinter This method performs a line feed which moves the vertical text cursor position down by the distance specified by the property LineHeight. It also increments the property LineNum. If Columns are in use, and the text cursor is moved below the current SectionBottom, the text cursor is placed at the top of the next column. The top of the next column is defined by the setting of SectionTop. CR, LineHeight, LineNum, NewLine, SectionBottom, SectionTop

See Also:

Example (Delphi)
ReportPrinter.LF;

Example (C++ Builder)


ReportPrinter->LF();

LineBottom property
Declaration: Default: Category: Components: Description: See Also: property LineBottom: double; (Bottom of the current line) Position TReportFiler, TReportPrinter Returns or sets the bottom of the text line LineTop, LineMiddle, FontBaseline, FontBottom, FontTop

(read/write)

Example (Delphi)
{ Place the text right on the bottom of the section } LineBottom := SectionBottom;

Example (C++ Builder)


// Place the text right on the bottom of the section rp->LineBottom = rp->SectionBottom;

LineHeight property
Declaration: Category: Components: Description: See Also:

(read/write)

property LineHeight: double; Position TReportFiler, TReportPrinter This property returns or sets the current height of a line. If a value is assigned to LineHeight then LineHeightMethod will be set to lhmUser. LineHeightMethod

Example (Delphi)
{Save current line height to a temporary variable} CurrHeight := ReportPrinter1.LineHeight

Example (C++ Builder)


//Save current line height to a temporary variable CurrHeight = ReportPrinter1->LineHeight

150

LineHeightMethod property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property LineHeightMethod: TLineHeightMethod; lhmLinesPerInch, lhmFont for TReportSystem Position TReportFiler, TReportPrinter, TReportSystem This property returns or sets the current method for calculating line heights. If equal to lhmLinesPerInch, then the LinesPerInch property determines the line height. If equal to lhmFont, then the current font determines the line height when a new line is generated. If equal to lhmUser the line height will not change unless the user changes LineHeight directly. LinesPerInch

Example (Delphi)
ReportPrinter1.LineHeightMethod := lhmFont;

Example (C++ Builder)


ReportPrinter1->LineHeightMethod = lhmFont;

LineMiddle property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property LineMiddle: double; (Middle of current line) Position TReportFiler, TReportPrinter This property returns or sets the middle of the current text line. It is useful for aligning the middle of the current line with graphics that might be placed around the text (e.g., bullets, etc.) LineTop, LineBottom, FontBaseline, FontBottom, FontTop

Example (Delphi)
LineMiddle := 2.0;

Example (C++ Builder)


rp->LineMiddle = 2.0;

151

LineNum property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property LineNum: integer; 1 Position TReportFiler, TReportPrinter This property returns or sets the current line number. This property is highly dependent upon the current LineHeightMethod as well as the size of the current font if LineHeightMethod is equal to lhmFont. LineNum may not represent the actual line number if the report is jumping around the page instead of calling Prints and Printlns. LineHeightMethod, LineHeight

Example (Delphi)
WITH ReportPrinter1 do IF Odd(LineNum) then TabShade := 0; else TabShade := 15; end; { with }

Example (C++ Builder)


if ((rp->LineNum % 2) == 1) { rp->TabShade = 0; } else { rp->TabShade = 15; }// else

LinesLeft method
Declaration: Category: Components: Description: See Also: function LinesLeft: integer; Position TReportFiler, TReportPrinter This method will return the number of lines that can be printed above the current SectionBottom including the current line. ColumnLinesLeft, SectionBottom

Example (Delphi)
If ReportPrinter1.LinesLeft < 3 then begin ReportPrinter1.NewPage; end; { if }

Example (C++ Builder)


if (ReportPrinter1->LinesLeft() < 3) { ReportPrinter1->NewPage(); }// if

152

LinesPerInch property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property LinesPerInch: integer; 6 Position TReportFiler, TReportPrinter This property will return or set the number of lines per inch if the LineHeightMethod property is equal to lhmLinesPerInch. LineHeightMethod

Example (Delphi)
ReportPrinter1.LineHeightMethod := lhmLinesPerInch;

Example (C++ Builder)


ReportPrinter1->LineHeightMethod = lhmLinesPerInch;

LineTo method
Declaration: Category: Components: Description: See Also: procedure LineTo(X,Y: double); Graphics TReportFiler, TReportPrinter This method will draw a line using the current pen from the previous graphic cursor position to the point specified by (X,Y). MoveTo

Example (Delphi)
WITH ReportPrinter1 do begin MoveTo( 1.0, 1.0 ); LineTo( 3.0, 3.0 ); MoveTo( 1.0, 3.0 ); LineTo( 3.0, 1.0 ); end; { with}

Example (C++ Builder)


rp->MoveTo( rp->LineTo( rp->MoveTo( rp->LineTo( 1.0, 3.0, 1.0, 3.0, 1.0 3.0 3.0 1.0 ); ); ); );

LineTop property
Declaration: Default: Category: Components: Description: See Also: property LineTop: double; (Top of the current line) Position TReportFiler, TReportPrinter Returns or sets the top of the text line LineBottom, LineMiddle, FontBaseline, FontMiddle, FontTop

(read/write)

Example (Delphi)
{ Place the top of the line at 4.0" } LineTop := 4.0;

153

Example (C++ Builder)


// Place the top of the line at 4.0" LineTop = 4.0;

LoadDesigner property
Declaration: Default: Category: Components: Description:

{Rave}

(read/write)

Tutorial: NOTE: See Also:

property LoadDesigner: boolean; False Rave TRaveProject This property determines if the end user designer will be loaded or not. If the LoadDesigner property is True then the filename in the DLLFile property will be loaded. The end user files are either RavePack or RaveSolo DLL depending upon whether you are using packages or not. see Tutorial 28 and 29 for more information about providing end user design This ONLY is available in the Corporate version of Rave. DLLFile, Open

LoadFromFile method
Declaration: Category: Components: Description: See Also:

Memo

function LoadFromFile( FileName: String); Memo TDBMemoBuf, TMemoBuf This method will load a memo buffer with the contents of a text file. To load RTF text, use RTFLoadFile. LoadFromStream, RTFLoadFromFile, SaveToStream

Example (Delphi)
MemoBuf1.LoadFromFile(Letter.Txt);

Example (C++ Builder)


MemoBuf1->LoadFromFile(Letter.Txt);

LoadFromFile method
Declaration: Category: Components: Description: See Also:

{Rave}

procedure LoadFromFile(FileName: string); Rave TRaveProject This method will load the report project file specified by the FileName parameter as the current Rave project. LoadFromStream, SaveToFile, SaveToStream

Example (Delphi)
RaveProject1.LoadFromFile(Project1.Rav);

Example (C++ Builder)


RaveProject1->LoadFromFile(Project1.Rav);

154

LoadFromStream method
Declaration: Category: Components: Description: See Also: procedure LoadFromStream(Stream: TStream; BufSize: longint); Memo TDBMemoBuf, TMemoBuf This method will load the memo buffer from the stream for BufSize number of bytes. SaveToStream

Example (Delphi)
MemoBuf1.LoadFromStream( MyStream, StreamSize );

Example (C++ Builder)


MemoBuf1->LoadFromStream( MyStream, StreamSize );

LoadFromStream method
Declaration: Category: Components: Description: See Also:

{Rave}

procedure LoadFromStream(Stream: TStream); Rave TRaveProject This method will load the report project store in Stream as the current report project. LoadFromFile, SaveToFile, SaveToStream

Example (Delphi)
RaveProject1.LoadFromStream(BlobStream);

Example (C++ Builder)


RaveProject1->LoadFromStream(BlobStream);

LoadRaveBlob method
Declaration: Category: Components: Description: See Also:

{Rave}

procedure LoadRaveBlob(Stream: TStream); Rave TRaveProject This method will load the report project stored in Stream into the application form. You should not need to call this function since the normal method of loading a report project is through the TRaveProject.StoreRAV property editor. ClearRaveBlob, RaveBlobDateTime, SaveRaveBlob, StoreRAV

Example (Delphi)
RaveProject1.LoadRaveBlob( MyStream );

Example (C++ Builder)


RaveProject1->LoadRaveBlob( MyStream );

155

LocalFilter property
Declaration: Default: Category: Components: Description:

{Rave}

(read/write/pub)

property LocalFilter: Boolean; False TRPQueryConnection and TRPTableConnection True TRPCustomConnection and TRPDataSetConnection Rave TRPCustomConnection This property will determine whether filtering is done locally inside of the data connection component or whether it will rely on the filtering capabilites of the database. Local is provided to support filtering on fields that do not allw exact representation in string form (floating point / date-time fields).

Example (Delphi)
RPCustomConnection1.LocalFilter := True;

Example (C++ Builder)


RPCustomConnection1->LocalFilter + True;

LookupDataSet property
Declaration: Default: Category: Components: Description: See Also: Example:

(read/write/pub)

property LookupDataSet: TDBDataSet; ( empty) TablePrinter TDBTableColumn Specifies the dataset that you want to perform the lookup on. LookupDisplay, LookupKey, FieldName See Tutorial 14

LookupDisplay property
Declaration: Default: Category: Components: Description: See Also: Example:

(read/write/pub)

property LookupDisplay: TFieldName; ( empty ) TablePrinter TDBTableColumn Specifies the field in LookupDataSet that will actually be displayed in the report after the lookup is performed. LookupDataSet, LookupKey, FieldName See Tutorial 14

LookupKey property
Declaration: Default: Category: Components: Description: See Also: Example:

(read/write/pub)

property LookupKey: TFieldName; ( empty ) TablePrinter TDBTableColumn Specifies the key field in LookupDataSet that matches the value of the field FieldName. LookupDataSet, LookupDisplay, FieldName See Tutorial 14

156

LPI property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property LPI: Double; 6 Misc TTextFiler Sets the Lines per inch for the translation from vertical units to text lines. CPI, NewLine, TopBorder

Example (Delphi)
WITH TextFiler1 do begin CPI := 16; LPI := 8; PrintLn(This text is 16 characters per inch); PrintLn(With 8 Lines per inch); end; { with }

Example (C++ Builder)


TextFiler1->CPI = 16; TextFiler1->LPI = 8; TextFiler1->Println("This text is 16 characters per inch"); TextFiler1->Println("With 8 Lines per inch");

Macro method
Declaration: Category: Components: Description: function Macro(MacroID: TMacroID): string; Printing TReportFiler, TReportPrinter This function inserts a macro into your report. The macro will be inserted at the time of report output (to preview or printer) and not at report generation time. Use this method with all printing methods. For a list of MacroIDs see the type definition of TMacroID. TMacroID, MacroData

See Also:

Example (Delphi)
{ Print the current page and total pages } PrintRight(Macro(midCurrentPage) + of + Macro(midTotalPages), 8.0);

Example (C++ Builder)


// Print the current page and total pages rp->PrintRight(rp->Macro(midCurrentPage) + " of " + rp->Macro(midTotalPages), 8.0);

157

MacroData property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property MacroData: TStrings; empty list Printing TReportFiler, TReportPrinter This property sets or returns the user-defined macro string in a list of strings for midUser01 to midUser20 TMacroID, Macro, TStrings

Example (Delphi)
{ Add current user name for Macro(midUser01) } MacroData.Add(UserName); FilePrinter1.Execute;

Example (C++ Builder)


// Add current user name for Macro(midUser01) rp->MacroData->Add(UserName); FilePrinter1->Execute();

Margin property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Margin: double; 0.05 TablePrinter TTableColumn, TDBTableColumn, TTableSection This property returns or sets the spacing, in units, between the table column or table section contents and the sides of the row box. Margin100

Example (Delphi)
TableColumn.Margin := 0.1;

Example (C++ Builder)


TableColumn->Margin = 0.1;

Margin100 property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Margin100: double; 5 TablePrinter TTableColumn, TDBTableColumn, TTableSection This property returns or sets the spacing, in 1/100ths of an inch, between the table column or table section contents and the sides of the row box. Margin

Example (Delphi)
TableSection.Margin100 := 10;

Example (C++ Builder)


TableSection->Margin100 = 10;

158

MarginBottom property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property MarginBottom: double; 0.0 Position TReportFiler, TReportPrinter These properties return or set the current margin settings. Margins have no direct effect on printing other than providing values to reset the current section when a new page is generated or when ResetSection is called. Changing a margin setting will change the same section setting to the same measurement. MarginLeft, MarginRight, MarginTop, section properties, ResetSection

Example (Delphi) This code shows how to set these properties. Also see PrintFooter
MarginLeft MarginRight MarginTop MarginBottom := := := := 0.5; 0.5; 0.5; 1.0; := := := := 0.5; 0.5; 0.5; 1.0;

Example (C++ Builder)


rp->MarginLeft rp->MarginRight rp->MarginTop rp->MarginBottom

MarginLeft
Declaration: Default: Category: Components: See Also:

(read/write/pub)

property MarginLeft: double; 0.0 Position TReportFiler, TReportPrinter MarginBottom ( for description and example), section properties, ResetSection

MarginMethod property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property MarginMethod: TMarginMethod; mmFixed Preview TFilePreview This property returns or sets the method used to draw the blank margin around the preview page. The setting mmFixed will keep the border the same size no matter what the value of ZoomFactor. The setting mmScaled will grow and shrink the border so that it maintains the same ratio as the rest of the page. MarginPercent

Example (Delphi)
FilePreview1.MarginMethod := mmScaled;

Example (C++ Builder)


FilePreview1->MarginMethod = mmScaled;

159

MarginPercent property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property MarginPercent: double; 0.0 Preview TFilePreview This property defines the percent of the page width that will appear as blank space around the preview page. A value of 0.0 would have no border. A value of 2.5 would create a border that is equal to 2.5% of the page width. MarginMethod

Example (Delphi)
FilePreview1.MarginPercent := 1.0; { 1% border }

Example (C++ Builder)


FilePreview1->MarginPercent = 1.0; // 1% border

MarginRight property
Declaration: Default: Category: Components: See Also:

(read/write/pub)

property MarginRight: double; 0.0 Position TReportFiler, TReportPrinter MarginBottom ( for description and example), section properties, ResetSection

MarginTop property
Declaration: Default: Category: Components: See Also:

(read/write/pub)

property MarginTop: double; 0.0 Position TReportFiler, TReportPrinter MarginBottom ( for description and example), section properties, ResetSection

MasterKey property
Declaration: Default: Category: Components: Description: See Also: Example: property MasterKey: TFieldName; (empty) TablePrinter TDBTablePrinter Specifies the master key field in a master-detail report. DetailKey See DetailKey example

(read/write/pub)

160

MasterTablePrinter property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property MasterTablePrinter: TTablePrinter; nil TablePrinter TTablePrinter, TDBTablePrinter This property returns or sets the table printer component that is acting as the master to the current table printer. This property is initialized by the master table printer when the detail (or child) table printer is called. DetailTablePrinter

Example (Delphi)
KeyField := MasterTablePrinter.DataSet.FieldByName(ID);

Example (C++ Builder)


KeyField = MasterTablePrinter->DataSet->FieldByName(ID);

MaxCopies property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property MaxCopies: longint; (maximum number of copies supported by the default printer) Printer TReportFiler, TReportPrinter This property returns the maximum number of copies supported by the current printer. Copies

Example (Delphi)
If MaxCopies = 1 then begin Copies := 1; end; { if }

Example (C++ Builder)


if (rp->MaxCopies == 1) { rp->Copies = 1; }// if

MaxSize property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property MaxSize: longint; 0 Memo TDBMemoBuf, TMemoBuf This property returns or sets the current size of the memo buffer. This is the size of available space and not the size of valid data (see Size). If a new value is assigned to MaxSize, the buffer will be adjusted to the smallest multiple of BufferInc that is greater than or equal to the desired new size. BufferInc, Size

Example (Delphi)
MemoBuf.MaxSize := 1000; { Allocate at least 1000 characters }

161

Example (C++ Builder)


MemoBuf->MaxSize = 1000; // Allocate at least 1000 characters

Memo property
Declaration: Category: Components: Description: See Also:

(read/write)

property Memo: TMemo; Memo TDBMemoBuf, TMemoBuf This property will assign the contents of a TMemo component to a memo buffer. TMemo component in Delphi help, Field, Text

Example (Delphi)
MemoBuf.Memo := Memo1; { Copy Memo1 into MemoBuf }

Example (C++ Builder)


MemoBuf->Memo = Memo1; // Copy Memo1 into MemoBuf

MemoBuf property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property MemoBuf: TMemoBuf; Empty memo buffer TablePrinter TTableColumn, TDBTableColumn This property returns or sets the contents of the current table column. PrintStart, PrintEnd, TMemoBuf, Categorical Reference, see Tutorial 12

Example (Delphi)
TableColumn.MemoBuf.Text := (unknown);

Example (C++ Builder)


TableColumn->MemoBuf->Text = (unknown);

MemoHeightLeft method
Declaration: Category: Components: Description: NOTE: See Also: function MemoHeightLeft: double; Memo TMemoBuf This method will return the height necessary to print the memo buffer for the current font between PrintStart and PrintEnd. You must initialize the TMemoBuf.BaseReport before calling this method. ConstraintHeightLeft , MemoLinesLeft PrintEnd , PrintMemo , PrintStart , TMemoBuf

Example (Delphi)
MemoBuf.BaseReport := Sender as TBaseReport; HeightLeft := MemoBuf.MemoHeightLeft;

Example (C++ Builder)


MemoBuf->BaseReport = rp; HeightLeft = MemoBuf->MemoHeightLeft();

162

MemoLines method
Declaration: Category: Components: Description: See Also: function MemoLines(MemoBuf: TMemoBuf): longint; Memo TReportFiler, TReportPrinter This method will return the number of lines necessary to print the memo buffer MemoBuf for the current font between PrintStart and PrintEnd. PrintEnd, PrintMemo, PrintStart, TMemoBuf

Example (Delphi)
{ Save number of lines needed to print memo } LinesLeft := ReportPrinter1.MemoLines(MyMemo);

Example (C++ Builder)


// Save number of lines needed to print memo LinesLeft = ReportPrinter1->MemoLines(MyMemo);

MemoLinesLeft method
Declaration: Category: Components: Description: NOTE: See Also: function MemoLinesLeft: longint; Memo TMemoBuf This method will return the number of lines necessary to print the memo buffer for the current font between PrintStart and PrintEnd. You must initialize the TMemoBuf.BaseReport before calling this method. PrintEnd, PrintMemo, PrintStart, TMemoBuf, MemoHeightLeft

Example (Delphi)
MemoBuf.BaseReport := Sender as TBaseReport; LinesLeft := MemoBuf.MemoLinesLeft;

Example (C++ Builder)


MemoBuf->BaseReport = rp; LinesLeft = MemoBuf->MemoLinesLeft();

MinFontSize property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property MinFontSize: byte; 6 TablePrinter TTableColumn, TDBTableColumn, TTableSection This property returns or sets the minimum font size that a table columns contents will be set to if OverflowMethod is set to omShrink. Font, OverflowMethod

Example (Delphi)
TableColumn.MinFontSize := 8;

Example (C++ Builder)


TableColumn->MinFontSize = 8;

163

MinHeight property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property MinHeight: double; 0.0 ReportSection TReportSection This property defines the minimum height for a section. If the value is 0 then no minimum height will be required. If the value is greater than zero and there is not enough room in the section a new page will be generated. HeightMethod, Reprint

Example (Delphi)
ReportSection.HeightMethod := hmUnits; ReportSection.MinHeight := 0.5;

Example (C++ Builder)


ReportSection->HeightMethod = hmUnits; ReportSection->MinHeight = 0.5;

Monochrome property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Monochrome: boolean; false Preview TFilePreview This property defines whether the preview page is drawn in color or monochrome. A setting of true can drastically save memory, especially if the system is running in 8bit or 24-bit color. Shadows will be disabled if Monochrome is true. ShadowDepth

Example (Delphi)
FilePreview1.Monochrome := true;

Example (C++ Builder)


FilePreview1->Monochrome = true;

MoveTo method
Declaration: Category: Components: Description: See Also: procedure MoveTo(X,Y: double); Graphics TReportFiler, TReportPrinter This method will move the current graphic cursor position to the point specified by (X,Y). LineTo

Example (Delphi)
ReportPrinter1.MoveTo( NewX, NewY );

Example (C++ Builder)


ReportPrinter1->MoveTo( NewX, NewY );

164

NewColumn method
Declaration: Category: Components: Description: See Also: procedure NewColumn; Control TReportFiler, TReportPrinter Creates a new column in addition to the columns that already exist (that were set using the SetColumns or SetColumnWidth methods). If there is not enough space on the current page, it will create one with the current settings on the next page. SetColumns, SetColumnWidth

Example (Delphi)
ReportPrinter1.NewColumn;

Example (C++ Builder)


ReportPrinter1->NewColumn();

NewLine method
Declaration: Category: Components: Description: See Also: procedure NewLine; Position TReportFiler, TReportPrinter This method performs a carriage return (CR) followed by a line feed (LF), then resets the tabs. ColumnStart, CR, LF, ResetTabs

Example (Delphi)
ReportPrinter1.NewLine;

Example (C++ Builder)


ReportPrinter1->NewLine();

NewPage method
Declaration: Category: Components: Description: procedure NewPage; Control TReportFiler, TReportPrinter This method will end the current page and start printing on a new page. The OnPrintFooter event handler will be called before the current page is finished. The OnPrintHeader and OnNewPage event handlers will be called after the new page has been created. AbortPage, OnNewPage, OnPrintHeader, OnPrintFooter

See Also:

Example (Delphi)
ReportPrinter1.NewPage;

Example (C++ Builder)


ReportPrinter1->NewPage();

165

NewPara method
Declaration: Category: Components: Description: procedure NewPara; Control TRPHTMLFiler, TRTFFiler Starts a new paragraph when exporting to HTML or RTF. This differs from NewLine method in that it inserts a physical carriage return in the RTF or HTML document. NOTE: This is a method of all TBaseReport components but does nothing except for TRTFFiler and TRPHTMLFiler. NewLine

See Also:

Example (Delphi)
RTFFiler1.NewPara;

Example (C++ Builder)


RTFFiler1->NewPara();

NextPage method
Declaration: Category: Components: Description: See Also: procedure NextPage; Preview TFilePreview This method will go to and print the next page to the preview window. The OnPageChange event handler will be called if the current page number changes. PrevPage, CurrentPage, OnPageChange

Example (Delphi)
FilePreview1.NextPage;

Example (C++ Builder)


FilePreview1->NextPage();

NoBufferLine property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property NoBufferLine: boolean; false Graphics TReportFiler, TReportPrinter By default ReportPrinter buffers lines until the end of each page so that it can optimize the output for faster printing. Turn this option off if you need to have lines printed before other objects on a page. MoveTo, LineTo

Example (Delphi)
{ turn off line buffering } ReportPrinter1.NoBufferLine := true;

Example (C++ Builder)


// turn off line buffering ReportPrinter1->NoBufferLine = true;

166

NoCRLF property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property NoCRLF: boolean; false Memo TDBMemoBuf, TMemoBuf This property will control whether PrintMemo finishes with a carriage-return linefeed (if false) or not (if true). PrintMemo { Don't do a NewLine after PrintMemo() }

Example (Delphi)
MemoBuf.NoCRLF := true;

Example (C++ Builder)


MemoBuf->NoCRLF = true;

NoNewLine property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property NoNewLine: boolean; false Memo TDBMemoBuf, TMemoBuf Prevents the writing of an extra new line after the memo has been printed. PrintMemo

Example (Delphi)
MemoBuf.NowNewLine := true;

Example (C++ Builder)


MemoBuf->NowNewLine = true;

NoNTColorFix property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property NoNTColorFix: boolean; false Printer TReportFiler , TReportPrinter , TReportSystem Monochrome printers in Windows NT cannot print colors as shades of gray. Instead, any color other than black is printed as if it was white. Since this behaviour is often not desired when printing text, ReportPrinter Pro will convert all text colors, except white, as black if the output is being sent to a monochrome printer on Windows NT. The NoNTColorFix property, if set to true, allows you to disable this color conversion but is generally not needed. FontColor { Disable NT color conversion }

Example (Delphi)
NoNTColorFix := true;

Example (C++ Builder)


NoNTColorFix = true;

167

NoPrinterPageHeight property NoPrinterPageWidth


Declaration: Default: Category: Components: Description: See Also:
Example:

(read/write) (read/write)

property NoPrinterPageHeight: double; property NoPrinterPageWidth: double; 11.0 and 8.5 Printer TReportFiler These properties define the page width and height for the print preview screen if no printers are defined for the current Windows system. NoPrinters
See NoPrinters

NoPrinters method
Declaration: Category: Components: Description: function NoPrinters: boolean; Printer TReportFiler, TReportPrinter This function will return true if there are no printers defined in the current Windows system and false if there are. TReportPrinter and TFilePrinter will not function without an installed printer driver; however, TReportFiler and TFilePreview will still work. NoPrinterPageHeight, NoPrinterPageWidth { Set up for landscape paper }

See Also:

Example (Delphi)
IF NoPrinters then begin NoPrinterPageHeight := 8.5; NoPrinterPageWidth := 11.0; end; { if }

Example (C++ Builder)


if (rp->NoPrinters()) { rp->NoPrinterPageHeight = 8.5; rp->NoPrinterPageWidth = 11.0; }// if

NumAcross property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property NumAcross: integer; 3 Label TLabelShell This property defines the number of labels across each page. LabelWidth, LabelHeight, NumDown, SpacingXXX properties

Example (Delphi)
LabelShell1.NumAcross := 2;

Example (C++ Builder)


LabelShell1->NumAcross = 2;

168

NumDown property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property NumDown: integer; 10 Label TLabelShell This property defined the number of labels down each page. LabelWidth, LabelHeight, NumAcross, SpacingXXX properties

Example (Delphi)
LabelShell1.NumDown := 7;

Example (C++ Builder)


LabelShell1->NumDown = 7;

OnAddTotal event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnAddTotal(TableColumn: TTableColumn); TablePrinter TTableColumn, TDBTableColumn This event is called to update the totals, GrandTotal, PageTotal and SubTotal for a table column. GrandTotal, PageTotal, SubTotal

OnAfter event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnAfter(TableSection: TTableSection); TablePrinter TTableSection This event is after a table section prints. OnBefore, OnPrint
{Rave}

OnAfterClose event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnAfterClose( Sender: Tobject ); Rave TRaveProject This event will be called immediately after the Rave project is closed. Active, Close, OnAfterOpen, OnBeforeClose, OnBeforeOpen, Open
{Rave}

OnAfterOpen event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnAfterOpen( Sender: Tobject ); Rave TRaveProject This event will be called immediately after the Rave project is opened. Active, Close, OnAfterClose, OnBeforeClose, OnBeforeOpen, Open

169

OnAfterPrint event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnAfterPrint(Sender: TObject) Control TReportFiler, TReportPrinter, TReportSystem This event will be called after each print job has finished printing, even if the print job was aborted or an exception has been generated. This can be useful for cleaning up resources that were allocated in OnBeforePrint. OnBeforePrint, Execute

Example (Delphi)
procedure TReportForm.AfterPrintReport5(Sender: TObject); begin { AfterPrintReport5 } CustomerTable.Close; end; { AfterPrintReport5 }

Example (C++ Builder)


void __fastcall TReportForm:: AfterPrintReport5 (TObject *Sender) { CustomerTable->Close(); }

OnBefore event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnBefore(TableSection: TTableSection); TablePrinter TTableSection This event is before a table section prints. OnAfter, OnPrint
{Rave}

OnBeforeClose event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnBeforeClose( Sender: Tobject ); Rave TRaveProject This event will be called immediately before the Rave project is closed. Active, Close, OnAfterClose, OnAfterOpen, OnBeforeOpen, Open
{Rave}

OnBeforeOpen event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnBeforeOpen( Sender: Tobject ); Rave TRaveProject This event will be called immediately before the Rave project is opened. Active, Close, OnAfterClose, OnAfterOpen, OnBeforeClose, Open

170

OnBeforePrint event
Declaration: Category: Components: Description:

(read/write/pub)

See Also:

procedure OnBeforePrint(Sender: TObject); Control TReportFiler, TReportPrinter, TReportSystem This event is called before the print job has begun. This can be useful to initialize non-report items such as table record pointers. This event can also be useful to set report items that must be set before the print job begins (such as paper size and orientation). OnAfterPrint, Execute

Example (Delphi)
procedure TReportForm.BeforePrintReport5(Sender: TObject); begin { BeforePrintReport5 } With Sender as TBaseReport do begin StatusFormat := 'Printing Page %p'#13'%0'#13'%1'; StatusText.Add(''); StatusText.Add(''); MarginLeft := 0.5; MarginRight := 0.5; MarginTop := 0.5; MarginBottom := 1.0; end; { with } CustomerTable.First; end; { BeforePrintReport5 }

Example (C++ Builder)


void __fastcall TReportForm:: BeforePrintReport5 (TObject *Sender) { TBaseReport* rp = dynamic_cast<TBaseReport*>(Sender); rp->StatusFormat = "Printing Page %p\n%0\n%1"; rp->StatusText->Add(""); rp->StatusText->Add(""); rp->MarginLeft = 0.5; rp->MarginRight = 0.5; rp->MarginTop = 0.5; rp->MarginBottom = 1.0; CustomerTable->First(); } // BeforePrintReport5

OnBodyAfter event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnBodyAfter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Shell TDetailShell, TMasterShell, TReportShell This is where you de-initialize resources used in the body of the report. OnBodyBefore, OnBodyFooter, OnBodyHeader

171

OnBodyBefore event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnBodyBefore(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Shell TDetailShell, TMasterShell, TReportShell This is where you initialize resources for use in the body of the report. OnBodyAfter, OnBodyFooter, OnBodyHeader

OnBodyFooter event OnBodyHeader event


Declaration:

(read/write/pub) (read/write/pub)

Category: Components: Description: See Also:

procedure OnBodyFooter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); procedure OnBodyHeader(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Shell TDetailShell, TMasterShell, TReportShell These events are called to print the body header or footer for a shell report. SectionBodyHeader, SectionBodyFooter, PrintBodyHeader, PrintBodyFooter
{Rave}

OnCreate event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnCreate(Sender: TObject); Rave TRaveProject This event is called when the TRaveProject is created. This is the normal place to register custom Rave components by calling the RaveRegister procedure for the unit containing the custom Rave components. See the tutorials for more information. OnDestroy

172

OnDecodeImage event
Declaration:

(read/write/pub)

Category: Components: Description:

See Also:

procedure OnDecodeImage( Sender: TObject); ImageStream: TStream; ImageType: String; Bitmap: TBitmap ); Graphics TReportFiler , TReportPrinter This event is called when ReportPrinter Pro needs to convert image data (created from the PrinitImageRect method) to a bitmap for printing. This would normally appear on a TFilePrinter or TFilePreview component, but could also be defined in a TReportSystem component. PrintImageRect

Example (Delphi) as part of the event


var Image: TJPEGImage; Format: word; Data: THandle; Palette: HPalette; if ImageType = 'JPG' then begin Image := TJPEGImage.Create; // Create a TJPEGImage class Image.LoadFromStream(ImageStream); // Load JPEG image from ImageStream Image.DIBNeeded; // Convert JPEG to bitmap format // Save JPEG to clipboard in bitmap format Image.SaveToClipboardFormat(Format,Data,Palette); Image.Free; // Free the image // Load bitmap from clipboard Bitmap.LoadFromClipboardFormat(Format,Data,Palette); end; { if}

Example (C++ Builder)


if (ImageType == JPG) { Image = new TJPEImage(); // Create a JPEGImage class Image->LoadFromStream(ImageStream); // Load JPEG image from ImageStream Image->DIBNeeded(); // Convert JPEG to bitmap format // Save JPEG to clipboard in bitmap format Image->SaveToClipboardFormat(Format,Data,Palette); delete Image; // Free the image // Load bitmap from clipboard Bitmap->LoadFromClipboardFormat(Format,Data,Palette); }// if

173

OnDesignerSave event
Declaration: Category: Components: Description:

{Rave}

(read/write/pub)

See Also:

procedure OnDesignerSave(Sender: TObject); Rave TRaveProject When this event is defined, a save button and save menu item will be displayed in the end user version of the Rave visual designer to allow the end user to perform intermediate saves. In this event, you will normally call RaveProject.Save or whatever code you are using to save the project (i.e., RaveProject1.SaveToStream(BlobStream)). The Sender parameter is the TRaveProject component that generated the event. OnDesignerSaveAs, OnDesignerShow, SaveToStream
{Rave}

OnDesignerSaveAs event
Declaration: Category: Components: Description:

(read/write/pub)

See Also:

procedure OnDesignerSaveAs(Sender: TObject); Rave TRaveProject When this event is defined, a Save As menu item will be displayed in the end user version of the Rave visual designer to allow the end user to perform saves to alternate destinations. In this event, you will normally prompt the user for an alternate destination and then call RaveProject.Save or whatever code you are using to save the project (i.e., RaveProject1.SaveToStream(BlobStream)). The Sender parameter is the TRaveProject component that generated the event. OnDesignerSave, OnDesignerShow, SaveToStream
{Rave}

OnDesignerShow event
Declaration: Category: Components: Description:

(read/write/pub)

See Also:

procedure OnDesignerShow(Sender: TObject); Rave TRaveProject This event will be called after the Rave visual designer is initialized but immediately before it is displayed. This will allow you to show a splash screen or change the mouse cursor while the designer is loading, then restore everything just before Rave is displayed. The Sender parameter is the TRaveProject component that generated the event. OnDesignerSave
{Rave}

OnDestroy event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnDestroy(ReportPrinter: TRave); Rave TRaveProject This event is called when the TRaveProject component is being destroyed. This is useful for freeing up resources that were allocated in the OnCreate event. OnCreate

174

OnDetailAfter event OnDetailBefore event


Declaration:

(read/write/pub) (read/write/pub)

Default: Category: Components: Description: See Also:

procedure OnDetailAfter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); procedure OnDetailBefore(ReportPrinter: TBaseReport; ReportShell: TDetailShell); nil Shell TMasterShell, TReportShell These events are called before and after the detail section of a shell report is printed. PrintDetail, DetailReport

OnEndOfSection event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnEndOfSection(Sender: TObject); Shell TMasterShell, TReportShell These events are called before and after the detail section of a shell report is printed. PrintDetail, DetailReport
{Rave}

OnEOF event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnEOF(Connection: TRPCustomConnection; var Eof: Boolean); Rave DataConnection This event is called when the Rave data system wants the EOF status for the data. See the tutorial on customizing data connections for more information. OnFirst, OnNext
{Rave}

OnFirst event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnFirst(Connection: TRPCustomConnection); Rave DataConnection This event is called when the Rave data system wants the data cursor to be positioned to the beginning of the data. See the tutorial on customizing data connections for more information. OnNext, OnEOF

OnFooterAfter event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnFooterAfter( TableColumn: TTableColumn); TablePrinter TTableColumn, TDBTableColumn This event is called after a table column footer prints. OnFooterBefore, OnFooterPrint

175

OnFooterBefore event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnFooterBefore(TableColumn: TTableColumn); TablePrinter TTableColumn, TDBTableColumn This event is called before a table column footer prints. OnFooterAfter, OnFooterPrint

OnFooterHeight event
Declaration: Category: Components: Description: See Also: procedure OnFooterHeight(

(read/write/pub)
TableColumn: TTableColumn; var Height,MinHeight: Double);

TablePrinter TTableColumn, TDBTableColumn This event acts much like OnRowHeight except that it is called to override the height of a footer row box. OnHeaderHeight, OnRowHeight

OnFooterPrint event
Declaration: Category: Components: Description: See Also: procedure OnFooterPrint(

(read/write/pub)
TableColumn: TTableColumn; var Height, MinHeight: Double);

TablePrinter TTableColumn, TDBTableColumn This event is called to print the contents of a column footer. OnFooterSetup

OnFooterSetup event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnFooterSetup(TableColumn: TTableColumn); TablePrinter TTableColumn, TDBTableColumn This event is called to setup the contents of a column footer after it is initialized but before it is printed. OnFooterPrint
{Rave}

OnGetCols event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnGetCols(Connection: TRPCustomConnection); Rave DataConnection This event is called when the Rave data system wants to retrieve the meta-data information (field names, types, sizes and descriptions) for the data. See the tutorial on customizing data connections for more information. OnGetRow

176

OnGetNextRow event
Declaration: Category: Components: Description: See Also: procedure OnGetNextRow(

(read/write/pub)
TablePrinter: TTablePrinter; var Valid: Boolean);

TablePrinter TTablePrinter, TDBTablePrinter This event is called to get the next row of data. A value of false should be passed back in the Valid parameter if there are no more rows. OnValidateRow
{Rave}

OnGetRow event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnGetRow(Connection: TRPCustomConnection); Rave DataConnection This event is called when the Rave data system wants to retrieve the data for the current row of the data. See the tutorial on customizing data connections for more information. OnFirst, OnNext
{Rave}

OnGetSorts event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnGetSorts(Connection: TRPCustomConnection); Rave DataConnection This event is called when the Rave data system wants the available sorting methods available for the data. See the tutorial on customizing data connections for more information. OnSetSort

OnGroupAfter event
Declaration: Default: Category: Components: Description: See Also: procedure OnGroupAfter(

(read/write/pub)
ReportPrinter: TBaseReport; ReportShell: TDetailShell; var Valid: Boolean);

nil Shell TMasterShell, TReportShell This is where you de-initialize resources used in the group. OnGroupBeforeFirst, OnGroupAfterLast

177

OnGroupAfterLast event
Declaration: Default: Category: Components: Description: See Also: nil Shell TMasterShell, TReportShell These events will be called after the last group. OnGroupBefore, OnGroupAfter, OnGroupBeforeFirst

(read/write/pub)

procedure OnGroupAfterLast(ReportPrinter: TBaseReport; ReportShell: TDetailShell);

OnGroupBefore event
Declaration: Default: Category: Components: Description: See Also: procedure OnGroupBefore(

(read/write/pub)
ReportPrinter: TBaseReport; ReportShell: TDetailShell; var Valid: Boolean);

nil Shell TMasterShell, TReportShell This is where you initialize resources for use in the group. OnGroupBeforeFirst, OnGroupAfterLast

OnGroupBeforeFirst event
Declaration: Default: Category: Components: Description: See Also: nil Shell TMasterShell, TReportShell These events will be called before the first group. OnGroupBefore, OnGroupAfter, OnGroupAfterLast

(read/write/pub)

procedure OnGroupBeforeFirst(ReportPrinter: TBaseReport; ReportShell: TDetailShell);

OnGroupFooter event
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

procedure OnGroupFooter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); nil Shell TMasterShell, TReportShell This event is called to print the group footer for a shell report. SectionGroupHeader, SectionGroupFooter

OnGroupHeader event
Declaration: Default: Category: Components: Description: See Also: 178

(read/write/pub)

procedure OnGroupHeader(ReportPrinter: TBaseReport; ReportShell: TDetailShell); nil Shell TMasterShell, TReportShell This event is called to print the group header for a shell report. SectionGroupHeader, SectionGroupFooter

OnHeaderAfter event OnHeaderBefore event


Declaration: Category: Components: Description: See Also:

(read/write/pub) (read/write/pub)

procedure OnHeaderAfter(TableColumn: TTableColumn); procedure OnHeaderBefore(TableColumn: TTableColumn); TablePrinter TTableColumn, TDBTableColumn These events are called before and after a table column header prints. OnHeaderPrint

OnHeaderHeight event
Declaration: Category: Components: Description: See Also: procedure OnHeaderHeight(

(read/write/pub)
TableColumn: TTableColumn; var Height,MinHeight: Double);

TablePrinter TTableColumn, TDBTableColumn This event acts much like OnRowHeight except that it is called to override the height of a header row box. OnFooterHeight, OnRowHeight

OnHeaderPrint event
Declaration: Category: Components: Description: See Also: procedure OnHeaderPrint(

(read/write/pub)
TableColumn: TTableColumn; var Height, MinHeight: Double);

TablePrinter TTableColumn, TDBTableColumn This event is called to print the contents of a table column header. OnHeaderSetup

OnHeaderSetup event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnHeaderSetup(TableColumn: TTableColumn); TablePrinter TTableColumn, TDBTableColumn This event is called after a table column header is initialize but before it prints. OnHeaderPrint

OnInitMaster event
Declaration: Category: Components: Description:

{ Table Column } (read/write/pub)

procedure OnInitMaster(TableColumn: TTableColumn); TablePrinter TTableColumn, TDBTableColumn This event is called for each new master record and is a good place to initialize subtotals or in the case of TQuery components, set the parameters in the detail query for the new master record.

179

OnInitMaster event
Declaration: Category: Components: Description: See Also: procedure OnInitMaster(

{ Table Printer } (read/write/pub)


TablePrinter: TTablePrinter; var Valid: Boolean);

TablePrinter TTablePrinter, TDBTablePrinter This event is called for each new master record and is a good place to set the selection of valid records (for the 1 to many relationship). MasterTablePrinter

OnInitPage event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnInitPage(TableColumn: TTableColumn); TablePrinter TTableColumn, TDBTableColumn This event is called for each new page and is a good place to initialize PageTotal PageTotal

OnInitTable event
Declaration: Category: Components: Description: procedure OnInitTable(

(read/write/pub)
TablePrinter: TTablePrinter; var Valid: Boolean);

TablePrinter TTablePrinter, TDBTablePrinter This event is called to initialize the report and/or table for a table printer.

OnLabelAfter event OnLabelBefore event


Declaration: procedure OnLabelAfter(

(read/write/pub) (read/write/pub)

Category: Components: Description: See Also:

ReportPrinter: TBaseReport; LabelShell: TLabelShell; var Valid: Boolean); procedure OnLabelBefore( ReportPrinter: TBaseReport; LabelShell: TLabelShell; var Valid: Boolean); Label TLabelShell This is where you would initialize or de-initialize any resources for a label OnLabelPrint

OnLabelPrint event
Declaration: Category: Components: Description: See Also: procedure OnLabelPrint(

(read/write/pub)
ReportPrinter: TBaseReport; LabelShell: TLabelShell; var Valid: Boolean);

Label TLabelShell This event is called to print the contents of each label. Col, Row

180

OnNewColumn event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnNewColumn(Sender: TObject); Control TReportFiler, TReportPrinter, TReportSystem This event will be called whenever a new column has begun (after a call to Println, NewLine, SetColumns or SetColumnWidth). This can be useful for printing column headers. NewLine, Println, SetColumns, SetColumnWidth

Example (Delphi)
procedure TReportForm.OnNewColumnReport10(Sender: TObject); begin WITH Sender as TBaseReport do begin Underline := true; Println(Column Titles); Underline := false; end; { with } end;

Example (C++ Builder)


void __fastcall TReportForm:: OnNewColumnReport10 (TObject *Sender) { TBaseReport* rp = dynamic_cast<TBaseReport*>(Sender); rp->Underline = true; rp->Println("Column Titles"); rp->Underline = false; }

OnNewPage event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnNewPage(Sender: TObject); Control TReportFiler, TReportPrinter, TReportSystem This event will be called whenever a new page is generated. This can be useful to initialize page related items. NewPage, SelectBin

Example (Delphi)
procedure TRPForm.ReportPrinter1NewPage(Sender: TObject); begin WITH Sender as TBaseReport do begin PrintBitmapRect(0.5,0.5,1.20,1.20,Logo); MarginTop := 0.5; Home; SetFont('Arial',24); PrintHeader(Report Title, pjCenter); MarginTop := 1.0; Home; SetFont('Arial',10); PrintHeader(FormatDateTime(DateFormat, now), pjRight); end; { with } end;

181

Example (C++ Builder)


void __fastcall TRPForm:: ReportPrinter1NewPage (TObject *Sender) { TBaseReport* rp = dynamic_cast<TBaseReport*>(Sender); rp->PrintBitmapRect(0.5,0.5,1.20,1.20,Logo); rp->MarginTop = 0.5; rp->Home(); rp->SetFont("Arial",24); rp->PrintHeader("Report Title", pjCenter); rp->MarginTop = 1.0; rp->Home(); rp->SetFont("Arial",10); rp->PrintHeader(FormatDateTime("ddd, dd mmm yyyy hh:mm:ss", Now()), pjRight); }

OnNext event
Declaration: Category: Components: Description: See Also:

{Rave}

(read/write/pub)

procedure OnNext(Connection: TRPCustomConnection); Rave DataConnection This event is called when the Rave data system wants the data cursor to be moved to the next row of the data. See the tutorial on customizing data connections for more information. OnFirst, OnEOF
{Rave}

OnOpen event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnOpen(Connection: TRPCustomConnection); Rave DataConnection This event is called when the Rave data system wants to initialize the data session. See the tutorial on customizing data connections for more information. OnRestore

OnOverFlow event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnOverflow(TableColumn: TTableColumn); TablePrinter TDBTableColumn, TTableColumn This event is called if text is too wide to print in the current column and OverflowMethod for the TTableColumn component is set to omUser. This allows you to modify the text however you wish so that it will fit. OverflowMethod

182

OnPageAfter event OnPageBefore event


Declaration:

(read/write/pub) (read/write/pub)

Default: Category: Components: Description:

procedure OnPageAfter(ReportPrinter: TBaseReport; LabelShell: TLabelShell); procedure OnPageBefore(ReportPrinter: TBaseReport; LabelShell: TLabelShell); nil Shell TReportShell, TLabelShell These events are called before and after each page of a shell report.

OnPageChange event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnPageChange(Sender: TObject); Preview TFilePreview This event will be called whenever the current page changes on the preview screen. This can be useful for updating the current page number on visual controls on the preview screen. NextPage, PrevPage, PrintPage

Example (Delphi)
procedure TPreForm.FilePreview1PageChange(Sender: TObject); begin WITH FilePreview1 do begin PageEdit.Text := IntToStr(CurrentPage); PageLabel.Caption := 'Page ' + IntToStr(CurrentPage FirstPage + 1) + ' of ' + IntToStr(Pages); end; { with } end;

Example (C++ Builder)


void __fastcall TPreForm::FilePreview1PageChange(TObject *Sender) { TBaseReport* rp = dynamic_cast<TBaseReport*>(Sender); PageEdit->Text = IntToStr(rp->CurrentPage); PageLabel->Caption = "Page " + IntToStr(rp->CurrentPage rp->FirstPage + 1) + " of " + IntToStr(FilePreview1->Pages); }

183

OnPageFooter event OnPageHeader event


Declaration:

(read/write/pub) (read/write/pub)

Default: Category: Components: Description: See Also:

procedure OnPageFooter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); procedure OnPageHeader(ReportPrinter: TBaseReport; ReportShell: TDetailShell); nil Shell TReportShell These events are called to print the page header and footer for a shell report. SectionPageHeader, SectionPageFooter, PrintPageHeader PrintPageFooter

OnPreviewSetup event
Declaration: Category: Components: Description:

( read/write/pub )

See Also:

procedure OnPreviewSetup( Sender: TObject ); Preview TReportSystem This will allow you to modify the TFilePreview component on a preview form as well as the preview form itself. Some functions, such as ZoomPageWidthFactor will need to be called in the OnPreviewShow event. NOTE: OnPreviewSetup is called before the form is shown and TFilePreview is started. OnPreviewShow

Example (Delphi)
Procedure TForm1.ReportSystem1PreviewSetup( Sender: Tobject); begin With Sender as TFilePreview do begin ZoomFactor := 50; With Owner as TForm do begin Position := poDesigned; Top := 10; Left := 10; end; { with } end; { with } end;

Example (C++ Builder)


void __fastcall TForm1::ReportSystem1PreviewSetup(TObject *Sender) { TFilePreview* fp = dynamic_cast<TFilePreview*>(Sender); fp->ZoomFactor = 50; TForm* pf = dynamic_cast<TForm*>(fp->Owner); pf->Position = poDesigned; pf->Top = 10; pf->Left = 10; }

184

OnPreviewShow event
Declaration: Category: Components: Description: See Also:

( read/write/pub )

procedure OnPreviewShow( Sender: TObject ); Preview TFilePreview, TReportSystem This will allow you to modify the TFilePreview component on the preview form itself. NOTE: This event is called during the OnShow event of the preview form. OnPreviewSetup

Example (Delphi)
Procedure TForm1.ReportSystem1PreviewShow( Sender: Tobject); begin With Sender as TFilePreview do begin ZoomFactor := ZoomPageWidthFactor; end; { with } end;

Example (C++ Builder)


void __fastcall TForm1::ReportSystem1PreviewShow(TObject *Sender) { TFilePreview* fp = dynamic_cast<TFilePreview*>(Sender); fp->ZoomFactor = fp->ZoomPageWidthFactor; }

OnPrint event
Declaration: Category: Components: Description:

{ Output }

(read/write/pub)

See Also:

procedure OnPrint(Sender: TObject); Control TReportFiler, TReportPrinter, TReportSystem This event will be called when it is time to print the body of the report. To begin a new page call the NewPage method. To finish the report just exit this event. The event is useful for more complicated reports that are different from page to page. OnPrintPage, Execute, NewPage

Example (Delphi)
procedure TReportForm.PrintReport1(Sender: TObject); begin { PrintReport1 } With Sender as TBaseReport do begin StatusText[0] := 'Printing Report Page'; StatusText[1] := 'Boxed columns'; UpdateStatus; SectionTop := 0.75; SetFont('Arial',24); Underline := true; Home; PrintCenter('Report Page Demo', PageWidth / 2); end; { with } end; { PrintReport1 }

185

Example (C++ Builder)


void __fastcall TReportForm:: PrintReport1 (TObject *Sender) { TBaseReport* rp = dynamic_cast<TBaseReport*>(Sender); rp->StatusText->Strings[0] = "Printing Report Page"; rp->StatusText->Strings[1] = "Boxed columns"; rp->UpdateStatus(); rp->SectionTop = 0.75; rp->SetFont("Arial",24); rp->Underline = true; rp->Home(); rp->PrintCenter("Report Page Demo", rp->PageWidth / 2); }

OnPrint event
Declaration: Category: Components: Description: See Also:

{ Table }

(read/write/pub)

procedure OnPrint(TableSection: TTableSection); Control TTableSection This event is called to print the contents of a table section OnBefore, OnAfter

OnPrintFooter event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnPrintFooter(Sender: TObject); Control TReportFiler, TReportPrinter, TReportSystem This event will be called after the body for each page that has been printed. This can be useful for printing similar footers for each page. OnPrintHeader, GotoFooter, PrintFooter

Example (Delphi)
procedure TReportForm.PrintFooterReport5(Sender: TObject); begin { PrintFooterReport5 } WITH Sender as TBaseReport do begin SetFont('Times New Roman',8); MarginBottom := 0.5; PrintFooter('Page ' + IntToStr(CurrentPage),pjLeft); PrintFooter('Date 01/20/95',pjRight); MarginBottom := 1.0; end; { with } end; { PrintFooterReport5 }

Example (C++ Builder)


void __fastcall TReportForm:: PrintFooterReport5 (TObject *Sender) { TBaseReport* rp = dynamic_cast<TBaseReport*>(Sender); rp->SetFont("Times New Roman",8); rp->MarginBottom = 0.5; rp->PrintFooter("Page " + IntToStr(rp->CurrentPage),pjLeft); rp->PrintFooter("Date 01/20/95",pjRight); rp->MarginBottom = 1.0; }

186

OnPrintHeader event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnPrintHeader(Sender: TObject); Control TReportFiler, TReportPrinter, TReportSystem This event will be called before the body for each page that has been printed. This can be useful for printing similar headers for each page. OnPrintFooter, GotoHeader, PrintHeader

Example (Delphi)
procedure TReportForm.PrintHeaderReport5(Sender: TObject); begin { PrintHeaderReport5 } With Sender as TBaseReport do begin MarginTop := 0.5; SetFont('Arial',24); Underline := true; Home; PrintCenter('Customer List', PageWidth / 2); MarginTop := 1.0; end; { with } end; { PrintHeaderReport5 }

Example (C++ Builder)


void __fastcall TReportForm:: PrintHeaderReport5 (TObject *Sender) { TBaseReport* rp = dynamic_cast<TBaseReport*>(Sender); rp->MarginTop = 0.5; rp->SetFont("Arial",24); rp->Underline = true; rp->Home(); rp->PrintCenter("Customer List", rp->PageWidth / 2); rp->MarginTop = 1.0; }

187

OnPrintPage event
Declaration: Category: Components: Description: function OnPrintPage(

(read/write/pub)
Sender: TObject; var PageNum: Integer): Boolean;

See Also:

Control TReportFiler, TReportPrinter, TReportSystem This event will be called when it is time to print the body of a page for the report. This event will only be called if an OnPrint event handler does not already exist for this report. To begin a new page, return a result of true; otherwise, to finish the report just exit this event with a result of false. This event is useful for reports that are the same from page to page. OnPrint, Execute

Example (Delphi)
function TReportForm.PrintPageReport3(Sender: TObject; var PageNum: integer): Boolean; begin { PrintPageReport3 } With Sender as TBaseReport do begin SetFont('Times New Roman',10); Home; { Print memo buffer } SetColumns(3,0.25); MemoBuf.PrintStart := ColumnStart; MemoBuf.PrintEnd := ColumnEnd; PrintMemo(MemoBuf, ColumnLinesLeft, false); ClearColumns; Result := not MemoBuf.Empty; end; { with } end; { PrintPageReport3 }

Example (C++ Builder)


bool __fastcall TReportForm:: PrintPageReport3 (TObject *Sender, int &PageNum) { TBaseReport* rp = dynamic_cast<TBaseReport*>(Sender); rp->SetFont("Times New Roman",10); rp->Home(); // Print memo buffer rp->SetColumns(3,0.25); MemoBuf->PrintStart = rp->ColumnStart; MemoBuf->PrintEnd = rp->ColumnEnd; rp->PrintMemo(MemoBuf, rp->ColumnLinesLeft(), false); rp->ClearColumns(); return !MemoBuf->Empty(); }

188

OnReportAfter event OnReportBefore event


Declaration:

(read/write/pub) (read/write/pub)

Default: Category: Components: Description:

procedure OnReportAfter(ReportPrinter: TBaseReport; LabelShell: TLabelShell); procedure OnReportBefore(ReportPrinter: TBaseReport; LabelShell: TLabelShell); nil Shell TReportShell, TLabelShell These events are called before and after a shell report.

OnReportFooter event OnReportHeader event


Declaration:

(read/write/pub) (read/write/pub)

Default: Category: Components: Description: See Also:

procedure OnReportFooter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); procedure OnReportHeader(ReportPrinter: TBaseReport; ReportShell: TDetailShell); nil Shell TReportShell This is where you put the output that goes into the report header or footer. SectionReportHeader, SectionReportFooter, PrintReportHeader, PrintReportFooter
{Rave}

OnRestore event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnRestore(Connection: TRPCustomConnection); Rave DataConnection This event is called when the Rave data system wants to restore the data session to its state before the OnOpen event was called. See the tutorial on customizing data connections for more information. OnOpen
{ Shell }

OnRowAfter event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnRowAfter(TableColumn: TTableColumn); Shell TDetailShell, TMasterShell, TReportShell This is where you de-initialize output that goes into a row. A value of false for Valid results in no more rows being assumed. OnRowBefore, PrintRow

189

OnRowAfter event
Declaration: Category: Components: Description: See Also:

{ Table Printer }

(read/write/pub)

property OnRowBefore: TTableColumnEvent; property OnRowAfter: TTableColumnEvent; TablePrinter TTableColumn, TDBTableColumn This event is called after each table column row prints. OnRowBefore, OnRowPrint
{ Shell }

OnRowBefore event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnRowBefore(TableColumn: TTableColumn); Shell TDetailShell, TMasterShell, TReportShell This is where you initialize output that goes into a row. A value of false for Valid results in no more rows being assumed. OnRowAfter, PrintRow
{ Table Printer }

OnRowBefore event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

property OnRowBefore: TTableColumnEvent; TablePrinter TTableColumn, TDBTableColumn This event is called before each table column row prints. OnRowAfter, OnRowPrint

OnRowHeight event
Declaration: Category: Components: Description: See Also: procedure OnRowHeight(

(read/write/pub)
TableColumn: TTableColumn; var Height, MinHeight: Double);

TablePrinter TTableColumn, TDBTableColumn This event allows the programmer to override the default height for a column row. OnRowPrint
{ Shell }

OnRowPrint event
Declaration: Category: Components: Description: See Also: procedure OnRowPrint(

(read/write/pub)

ReportPrinter: TBaseReport; ReportShell: TDetailShell; var Valid: Boolean);

Shell TDetailShell, TMasterShell, TReportShell This is where you put the output that goes into a row. A value of false for Valid results in no more rows being assumed. PrintRow, SectionRow

190

OnRowPrint event
Declaration: Category: Components: Description: See Also: procedure OnRowPrint(

{ Table Printer }

(read/write/pub)

TableColumn: TTableColumn; var Height, MinHeight: Double);

TablePrinter TTableColumn, TDBTableColumn This event is called to print the contents of the current column. OnRowSetup

OnRowSetup event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnRowSetup(TableColumn: TTableColumn); TablePrinter TTableColumn, TDBTableColumn This event is called after the contents for the current column have been initialized, but before it is printed. MemoBuf, OnRowPrint
{Rave}

OnSetFilter event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnSetFilter(Connection: TRPCustomConnection); Rave DataConnection This event is called when the Rave data system wants to filter the data based on field criteria. See the tutorial on customizing data connections for more information. OnSetSort
{Rave}

OnSetSort event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnSetSort(Connection: TRPCustomConnection); Rave DataConnection This event is called when the Rave data system wants to sort the data. See the tutorial on customizing data connections for more information. OnSetFilter

OnSetup event
Declaration: Category: Components: Description: See Also:

(read/write/pub)

procedure OnSetup(TableSection: TTableSection); TablePrinter TTableSection This event is called to setup the contents of a table section OnPrint

191

OnValidateRow event
Declaration: Category: Components: Description: See Also:

{Rave}

(read/write/pub)

procedure OnValidateRow(Connection: TRPCustomConnection; var ValidRow: boolean);

Rave DataConnection This event is called for each row in the data and allows the custom selection of which records will be included in the report by setting ValueRow to true or false. See the tutorial on customizing data connections for more information. OnSetFilter

OnValidateRow event
Declaration: Category: Components: Description: See Also:
procedure OnValidateRow(

(read/write/pub)
TablePrinter: TTablePrinter; var Valid: Boolean);

TablePrinter TTablePrinter This event is called to validate the current row for printing. A return value of false in Valid will cause the row to not be printed. OnGetNextRow

OnZoomChange event
Declaration: Category: Components: Description:

(read/write/pub)

See Also:

procedure OnZoomChange(Sender: TObject); Preview TFilePreview This event will be called whenever the current zoom factor changes for the preview screen. This can be useful for updating the current zoom factor on visual controls on the preview screen. NOTE: If an OnZoomChange event handler is created, it is responsible for redrawing the page by calling RedrawPage. ZoomIn, ZoomOut, RedrawPage

Example (Delphi)
procedure TRPPreviewForm.FilePreview1ZoomChange(Sender: TObject); var S1: string[10]; begin Str(FilePreview1.ZoomFactor:1:1,S1); ZoomEdit.Text := S1; FilePreview1.RedrawPage; end;

Example (C++ Builder)


void __fastcall TForm1::FilePreview1ZoomChange(TObject *Sender) { AnsiString S1; S1 = FloatToStrF(FilePreview1->ZoomFactor, ffGeneral,1,1); ZoomEdit->Text = S1; FilePreview1->RedrawPage(); }

192

Open method
Declaration: Category: Components: Description: See Also:

{Rave}

procedure Open; Rave TRaveProject This method will open the report project file defined by ProjectFile to make it available for printing or modification. Close, LoadDesigner, OnAfterOpen, OnBeforeOpen, ProjectFile, Save

Orientation property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property Orientation: TOrientation; poPortrait Printer TReportFiler, TReportPrinter This property will return or set the current page orientation to either poPortrait or poLandscape. Use poDefault to retain the setting defined byTPrinterSetupDialog.

Example (Delphi)
ReportPrinter1.Orientation := poLandscape;

Example (C++ Builder)


ReportPrinter1->Orientation = poLandscape;

OriginX property OriginY property


Declaration: Default: Category: Components: Description: property OriginX: double; property OriginY: double; 0.0 Position TReportFiler, TReportPrinter These properties return or set the currently defined origin.

(read/write) (read/write)

Origins can be very useful for printing similar items that are at different locations of the page (Example (Delphi) labels). Example (Delphi)
ReportPrinter1.OriginX := 2.0; ReportPrinter1.OriginY := 2.0;

Example (C++ Builder)


ReportPrinter1->OriginX = 2.0; ReportPrinter1->OriginY = 2.0;

193

OutputFileName property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property OutputFileName: TFileName; (empty) Printer TReportSystem Specifies the file name that the report output should be sent to. This is a file with printer commands that can be later printed using a command from the DOS prompt like: COPY /b TEST.DAT PRN OutputName

Example (Delphi)
ReportSystem1.OutputFileName := TEST.DAT;

Example (C++ Builder)


ReportSystem1->OutputFileName = TEST.DAT;

OutputInvalid property
Declaration: Default: Category: Components: Description:

(read only)

See Also:

property OutputInvalid: boolean; true Control TReportFiler, TReportPrinter Returns true if the current report destination is invalid. Will also return true if the report has been aborted or is finished executing. This can occur if the user has selected a page range that does not include the current page or the report has been aborted. Abort, FirstPage, LastPage, Selection

OutputName property
Declaration: Default: Category: Components: Description:

(read/write)

property OutputName: string; ( empty ) Printer TReportFiler, TReportPrinter This property defines an alternate output device for the current printer. The output device can be another port, 'LPT3:', or a file on the disk, 'C:\APP\PRINTER.DMP'. The contents of the file that is created will contain actual printer commands and can be copied to a printer at a later time with a DOS command This can be useful for sending output to printers that are not hooked up to the current computer. To do this create the file, copy it to a computer hooked up to the printer and then use the copy command to send it to the printer port Example (Delphi) COPY PRINTER.DMP LPT1 /B

See Also:

Port

Example (Delphi)
ReportPrinter1.OutputName := C:\APP\PRINTER.DMP;

Example (C++ Builder)


ReportPrinter1->OutputName = C:\APP\PRINTER.DMP;

194

OutputType property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property OutputType: TOutputType; otText TablePrinter TTableSection, TTableColumn, TDBTableColumn This property defines what type of output a table section or the column being generated will produce. otText will use the Text property and is good for report titles and will produce normal rows. otHeadings will print the headings for each column. otGrandTotals, otPageTotals and otSubTotals will print the totals for each column. TOutputType

OverflowAppend property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property OverflowAppend: TFormatString; ( empty ) TablePrinter TTableColumn, TDBTableColumn, TTableSection This property defines the text that will be appended to table column data that overflows the row box. OverflowReplace

Example (Delphi)
TableColumn.OverflowAppend := ;

Example (C++ Builder)


TableColumn->OverflowAppend = ;

OverflowMethod property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property OverflowMethod: TOverflowMethod; omTruncateChar TablePrinter TTableColumn, TDBTableColumn, TTableSection This property defines the method used when table column data will not fit in one line. omReplace will replace the string with OverflowReplace. omShrink will shrink the font until it either fits or MinFontSize is reached at which point it will truncate like omTruncateChar does. omTruncateWord will truncate to the nearest word and omWrap will wrap the text into multiple lines. TOverflowMethod

Example (Delphi)
TableColumn.OverflowMethod := omWrap

Example (C++ Builder)


TableColumn->OverflowMethod = omWrap

195

OverflowReplace property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property OverflowReplace: TFormatString; * TablePrinter TTableColumn, TDBTableColumn, TTableSection This property will return or set the text string that will be used when OverflowMethod is omReplace. If OverflowReplace is a single character it will be repeated as many times as possible in the row box. OverflowAppend, OverflowMethod

Example (Delphi)
TableColumn.OverflowReplace := $****.**;

Example (C++ Builder)


TableColumn->OverflowReplace = $****.**;

OverridePreview event
Declaration: Category: Components: Description: See Also:

(read/write)

procedure OnOverridePreview(ReportSystem: TReportSystem; OverrideMode: TOverrideMode; var OverrideForm: TForm);

ReportSystem TReportSystem This event allows the programmer to replace the default preview screen with a custom preview screen. See RPSYSTEM.PAS for more information. RPSystem.OverridePreviewProc

OverrideSetup event
Declaration:
procedure OnOverrideSetup(

(read/write)
ReportSystem: TReportSystem; OverrideMode: TOverrideMode; var OverrideForm: TForm);

property OverrideSetup: TReportSystemEvent; Category: ReportSystem Components: TReportSystem Description: This event allows the programmer to replace the default preview screen with a custom preview screen. See RPSYSTEM.PAS for more information. See Also: RPSystem.OverrideSetupProc

OverrideStatus event
Declaration: Category: Components: Description: See Also:
procedure OnOverrideStatus(

(read/write)
ReportSystem: TReportSystem; OverrideMode: TOverrideMode; var OverrideForm: TForm);

ReportSystem TReportSystem This event allows the programmer to replace the default preview screen with a custom preview screen. See RPSYSTEM.PAS for more information. RPSystem.OverrideStatusProc

196

PageHeight property
Declaration: Category: Components: Description: See Also:

(read only)

property PageHeight: double; Printer TReportFiler, TReportPrinter This property returns the height of the currently selected paper size. PageWidth

Example (Delphi)
{ Save current page height } CurrPageHeight := ReportPrinter1.PageHeight;

Example (C++ Builder)


// Save current page height CurrPageHeight = ReportPrinter1->PageHeight;

PageInc property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property PageInc: integer; 1 Preview TFilePreview This property will set or return the number of pages that the preview screen will be incremented or decremented by when NextPage or PrevPage is called. NextPage, PrevPage

Example (Delphi)
PageInc := 4;

Example (C++ Builder)


PageInc = 4;

PageInvalid property
Declaration: Category: Components: Description: See Also:

(read only)

property PageInvalid: boolean; Control TReportFiler, TReportPrinter This property will return whether the current page is valid for printing or not. Typically this property will be true if the current page is outside the range for FirstPage to LastPage. FirstPage, LastPage

Example (Delphi)
If ReportPrinter1.PageInvalid then begin { code to respond to an invalid page } end; { if }

Example (C++ Builder)


if (ReportPrinter1.PageInvalid) { // code to respond to an invalid page }// if

197

Pages property
Declaration: Category: Components: Description: See Also:

(read only)

property Pages: integer; Preview TFilePreview This property returns the total number of pages that exist inside the report file for a preview screen. Macro(midTotalPages)

Example (Delphi)
Edit1.Text := IntToStr(FilePreview1.Pages); Form1.Invalidate;

Example (C++ Builder)


Edit1->Text = IntToStr(FilePreview1->Pages); Form1->Invalidate();

PageTotal property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property PageTotal: double; 0.0 TablePrinter TTableColumn, TDBTableColumn This property returns or sets the current page total for a table column. This value is used by a table section with an OutputType of otPageTotals. GrandTotal, SubTotal

PageWidth property
Declaration: Category: Components: Description: See Also:

(read only)

property PageWidth: double; Printer TReportFiler, TReportPrinter This property returns the width of the currently selected paper size. PageHeight

Example (Delphi)
{ Save current page width } CurrPageWidth := ReportPrinter1.PageWidth;

Example (C++ Builder)


// Save current page width CurrPageWidth = ReportPrinter1->PageWidth;

198

Papers property
Declaration: Default: Category: Components: Description: See Also:

(read only)

property Papers: TStrings; (list of paper sizes supported by the default printer) Printer TReportFiler, TReportPrinter This property will return a TStringList of paper sizes that are supported by the current printer. SelectPaper, SupportPaper, TStrings

Example (Delphi)
ListBox2.Items := ReportFiler1.Papers;

Example (C++ Builder)


ListBox2->Items = ReportFiler1->Papers;

ParagraphAttributes property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property ParagraphAttributes: string; (empty) HTML TRPHTMLFiler This property allows you to specify an HTML attribute that will be used on any paragraph tags (<p>) that are created. NewPara, TableAttributes

Example (Delphi)
HTMLFiler1.ParagraphAttributes := align=center;

Example (C++ Builder)


HTMLFiler1->ParagraphAttributes = align=\center\;

ParaJustify property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property ParaJustify: TTabJustify; tjNone RTF TRTFFiler This property allows you to set the justification used for the current paragraph. Usually the justification is set by the first print command on a new paragraph (i.e. PrintCenter would set the paragraph to be center justified). Setting ParaJustify for other output components such as TReportFiler or TReportPrinter will have no effect. NewPara

Example (Delphi)
With Sender as TBaseReport do begin ParaJustify := tjCenter; Print(This text is centered); end; { with }

Example (C++ Builder)


rp->ParaJustify = tjCenter; rp->Print("This text is centered");

199

Pen property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Pen: TPen; Default pen TablePrinter TTableColumn, TDBTableColumn, TTableSection, TTablePrinter This property returns or sets the pen that will be used to draw the row box for each table column or table section. UseParentPen, TPen

Pie method
Declaration: Category: Components: Description: procedure Pie(X1,Y1,X2,Y2,X3,Y3,X4,Y4: double); Graphics TReportFiler, TReportPrinter This method draws a pie slice inside an ellipse bounded by the rectangle defined by (X1,Y1) and (X2,Y2). The slice starts at the intersection of the line drawn between the ellipse center ((X1+X2) / 2.0,(Y1+Y2) / 2.0) and the point (X3,Y3) and is drawn counterclockwise until it reaches the intersection of the line drawn between the ellipse center and the point (X4,Y4). Arc, Ellipse

See Also:

Example (Delphi)
SetBrush(clBlack, bsHorizontal, nil); Pie(3.25,1.0,5.25,3.0,5.25,2.0,0.0,0.0); SetBrush(clBlack, bsVertical, nil); Pie(3.25,1.0,5.25,3.0,0.0,0.0,3.25,7.0); SetBrush(clBlack, bsBDiagonal, nil); Pie(3.25,1.0,5.25,3.0,3.25,7.0,5.25,2.0);

Example (C++ Builder)


rp->SetBrush(clBlack, bsHorizontal, NULL); rp->Pie(3.25,1.0,5.25,3.0,5.25,2.0,0.0,0.0); rp->SetBrush(clBlack, bsVertical, NULL); rp->Pie(3.25,1.0,5.25,3.0,0.0,0.0,3.25,7.0); rp->SetBrush(clBlack, bsBDiagonal, NULL); rp->Pie(3.25,1.0,5.25,3.0,3.25,7.0,5.25,2.0);

200

PIVar method
Declaration: Category: Components: Description: function PIVar(PIVarName: String): String; Printing TReportFiler , TReportPrinter , TReportSystem This method allows you to initialize the value of a PIVar (Post Initialize Variable). Any PIVars of the same name that were previously printed will show this value. PIVars will use the value that is set after it is printed. A common use for PIVars is to print a total in a header band that would be initialized later in the footer band. This works even across multiple pages. TReportSystem.SystemOptions.soUseFiler must be true if you are using PIVars in your report. SetPIVar

See Also:

Example (Delphi)
With Sender as TBaseReport do begin Print('SubTotal:' + PIVar('SubTotal')); // Other print statements including new pages SetPIVar('SubTotal',FormatFloat(SubTotal)); end; {with}

Example (C++ Builder)


rp->Print("SubTotal:" + PIVar("SubTotal")); // Other print statements including new pages rp->SetPIVar("SubTotal",FormatFloat(SubTotal));

Polygon method
Declaration: Category: Components: Description: See Also: procedure Polygon(const Points: array of TPoint); Graphics TReportFiler, TReportPrinter This method will draw a polygon using the current pen defined by the points contained in the open array Points. It also closes the shape between the first and last points and fills it using the current brush. CreatePoint, TPoint

Example (Delphi)
ReportPrinter1.Polygon([CreatePoint(1.0,2.0), CreatePoint(2.0,3.0), CreatePoint(5.0,2.0)]);

Example (C++ Builder)


POINT points[3]; points[0] = rp->CreatePoint(1.0,2.0); points[1] = rp->CreatePoint(2.0,3.0); points[2] = rp->CreatePoint(5.0,2.0); ReportPrinter1->Polygon(points,2);

201

Polyline method
Declaration: Category: Components: Description: See Also: procedure Polyline(const Points: array of TPoint); Graphics TReportFiler, TReportPrinter This method will draw a series of lines using the current pen connecting the points defined in the open array Points. CreatePoint, TPoint
-1 ); 0.81); -0.31); -0.31); 0.81); -1);

Example (Delphi)
PolyLineArr[1] := CreatePoint( 0 , PolyLineArr[2] := CreatePoint(-0.59, PolyLineArr[3] := CreatePoint( 0.95, PolyLineArr[4] := CreatePoint(-0.95, PolyLineArr[5] := CreatePoint( 0.59, PolyLineArr[6] := CreatePoint( 0 , PolyLine(PolyLineArr);

Example (C++ Builder)


POINT PolyLineArr[7]; PolyLineArr[1] = rp->CreatePoint( 0 , PolyLineArr[2] = rp->CreatePoint(-0.59, PolyLineArr[3] = rp->CreatePoint( 0.95, PolyLineArr[4] = rp->CreatePoint(-0.95, PolyLineArr[5] = rp->CreatePoint( 0.59, PolyLineArr[6] = rp->CreatePoint( 0 , rp->Polyline(PolyLineArr,6); -1 ); 0.81); -0.31); -0.31); 0.81); -1);

PopFont method
Declaration: Category: Components: Description: See Also: function PopFont: boolean; Font TReportFiler, TReportPrinter This method will set the font to the setting that was last pushed by PushFont. PopFont will return false if no more fonts exist on the stack. PushFont

Example (Delphi)
PushFont; SetFont(Arial,10); Println(This is in Arial); PopFont;

Example (C++ Builder)


rp->PushFont(); rp->SetFont("Arial",10); rp->Println("This is in Arial"); rp->PopFont();

202

PopPos method
Declaration: Category: Components: Description: See Also: function PopPos: boolean; Position TReportFiler, TReportPrinter This method will set the text cursor position to the setting that was last pushed by PushPos. PopPos will return false if no more positions exist on the stack. PushPos

Example (Delphi)
PushPos; PrintXY(4,1.5,Name); PopPos;

Example (C++ Builder)


rp->PushPos(); rp->PrintXY(4,1.5,Name); rp->PopPos();

PopTabs method
Declaration: Category: Components: Description: See Also: function PopTabs: boolean; Tabs TReportFiler, TReportPrinter This method will set the tabs to the setting that was last pushed by PushTabs. PopTabs will return false if no more tabs exist on the stack. PushTabs

Port property
Declaration: Category: Components: Description: See Also:

(read only)

property Port: string; Printer TReportFiler, TReportPrinter This property will return the port name for the currently selected printer. PrinterIndex, OutputName

Example (Delphi)
Edit1.Text := ReportPrinter1.Port; Form1.Invalidate;

Example (C++ Builder)


Edit1->Text = ReportPrinter1->Port; Form1->Invalidate();

203

Pos property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property Pos: longint; 0 Memo TDBMemoBuf, TMemoBuf This property will return or set the current position marker for the memo buffer. The first position is at index 0. Reset

Example (Delphi)
{ Save current memo buffer position } CurrMemoPos := MemoBuf1.Pos;

Example (C++ Builder)


// Save current memo buffer position CurrMemoPos = MemoBuf1->Pos;

Position property
Declaration: Category: Components: Description: See Also:

( read/write )

property Position: double; Bar Code TRPBarsBase This property sets or returns the positions of the bar code that is used in relation to the state of the BarCodeJustify property. This property along with BarCodeJustify is changed whenever the Left, Right or Center properties are changed. BarCodeJustify, BarTop, Center, Left, Right

Example (Delphi)
BarCodeJustify := pjCenter; Position := SectionLeft + 3.0; { Bar Code will be centered at the SectionLeft + 3.0 point }

Example (C++ Builder)


BarCodeJustify = pjCenter; Position = SectionLeft + 3.0; // Bar Code will be centered at the SectionLeft + 3.0 point

PrevPage method
Declaration: Category: Components: Description: See Also: procedure PrevPage; Preview TFilePreview This method will go to and print the previous page to the preview window. The OnPageChange event handler will be called if the current page number changes. NextPage, CurrentPage, OnPageChange

Example (Delphi)
FilePreview1.PrevPage;

Example (C++ Builder)


FilePreview1->PrevPage();

204

Print method
Declaration: Category: Components: Description: See Also: procedure Print(Text: string); Printing TReportFiler, TReportPrinter This method will print the string, Text, at the current text cursor position. If the string contains any tab characters (9) the Tab method will be called with the default parameters. The text cursor is left at the end of the string that is printed. all other print functions

Example (Delphi)
ReportPrinter1.Print(Hello World!);

Example (C++ Builder)


ReportPrinter1->Print(Hello World!);

Print method
Declaration: Category: Components: Description: See Also:

{ Bar Code }

procedure Print; Bar Code TRPBarsBase This method will print the bar code at the current text cursor position. The text cursor is left at the end of the string that is printed. GotoXY, PrintReadable, PrintTop, PrintXY, Text

Example (Delphi)
BarCode1.Text := 12345; BarCode1.Print;

Example (C++ Builder)


BarCode1->Text = 12345; BarCode1->Print();

PrintBitmap method
Declaration: Category: Components: Description: procedure PrintBitmap(X,Y: double; ScaleX, ScaleY: double; Bitmap: TBitmap); Graphics TReportFiler, TReportPrinter This method will draw Bitmap on the printer canvas at the point defined by (X,Y). The bitmap will be scaled by the factors ScaleX and ScaleY. (Example (Delphi) A scaling factor of 2 would draw each pixel in the bitmap as 2 pixels on the printer canvas.) PrintBitmapRect, TBitmap

See Also:

Example (Delphi)
{ Print MyBitmap in upper left corner four times its size } ReportPrinter1.PrintBitmap( 1.0, 1.0, 2.0, 2.0, MyBitmap );

205

Example (C++ Builder)


// Print MyBitmap in upper left corner four times its size ReportPrinter1->PrintBitmap( 1.0, 1.0, 2.0, 2.0, MyBitmap );

PrintBitmapRect method
Declaration: Category: Components: Description: See Also: procedure PrintBitmapRect(X1,Y1,X2,Y2: double; Bitmap: TBitmap); Graphics TReportFiler, TReportPrinter This method will draw Bitmap on the printer canvas stretched or shrunken to fit within the rectangle defined by the points (X1,Y1) and (X2,Y2). CalcGraphicHeight, CalcGraphicWidth, PrintBitmap, StretchDraw, TBitmap

Example (Delphi)
Bitmap := TBitmap.Create; Bitmap.LoadFromFile('RPDEMO.BMP'); PrintBitmapRect(5.375,3.5,7.375,5.5,Bitmap); Bitmap.Free;

Example (C++ Builder)


TBitmap* Bitmap = new TBitmap(); Bitmap.LoadFromFile(RPDEMO.BMP); rp->PrintBitmapRect(5.375,3.5,7.375,5.5,Bitmap); delete Bitmap;

PrintBlock method
Declaration: Category: Components: Description: See Also: procedure PrintBlock(Text: string; Pos: double; Width: double); Printing TReportFiler, TReportPrinter This method will print Text on the current line starting The text will be block justified within the area defined by Width. All other print functions

at

Pos.

Example (Delphi)
PrintBlock('This is block justified text',0.5,4.0);

Example (C++ Builder)


Rp->PrintBlock(This is block justified text,0.5,4.0);

206

PrintBodyFooter method PrintBodyHeader method


Declaration: Category: Components: Description: See Also: procedure PrintBodyHeader; procedure PrintBodyFooter; Shell TDetailShell, TMasterShell, TReportShell These methods will reprint the body header or footer by calling the OnBodyHeader or OnBodyFooter events with IsReprint set to true. OnBodyHeader, OnBodyFooter

Example (Delphi)
MasterShell1.PrintBodyHeader;

Example (C++ Builder)


MasterShell1->PrintBodyHeader();

PrintBox method
Declaration: Category: Components: Description: See Also: procedure PrintBox; TablePrinter TTableColumn, TDBTableColumn, TTableSection This method will print the row box using the current section settings and is useful if the default printing for a table column or table section has been overridden. Pen, ShadeColor, ShadePercent, PrintDefault

PrintByRow property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property PrintByRow: boolean; true Label TLabelShell This property determines whether the TLabelShell component processes the labels of the page by rows or columns. If PrintByRow is true then all labels on the top row would be printed first. If PrintByRow is false then all labels on the left column would be printed first. Col, Row

Example (Delphi)
LabelShell1.PrintByRow := false;

Example (C++ Builder)


LabelShell1->PrintByRow = false;

207

PrintCenter method
Declaration: Category: Components: Description: See Also: procedure PrintCenter(Text: string; Pos: double); Printing TReportFiler, TReportPrinter This method will print the string, Text, on the current line centered horizontally at the position, Pos. all other print functions

Example (Delphi)
PrintCenter('Text centered at 2.0', 2.0);

Example (C++ Builder)


rp->PrintCenter(Text centered at 2.0, 2.0);

PrintCharJustify method
Declaration: Category: Components: Description: procedure PrintCharJustify(Text: string; Ch: char; Pos: double); Printing TReportFiler, TReportPrinter This method will print a text string out, justified at Pos with respect to the first occurrence of Ch in Text. This can be useful for printing columns of numbers, aligned by the decimal point, when there can be a variable number of digits after the decimal point. PrintLeft, PrintRight
}

See Also:

Example (Delphi)
{ Print the number justified by the decimal point PrintCharJustify(NumStr,.,4.25);

Example (C++ Builder)


// Print the number justified by the decimal point rp->PrintCharJustify(NumStr,.,4.25);

PrintChecksum property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property PrintChecksum: boolean False Bar Code TRPBarsBase This property determines if the readable text includes the checksum character. NOTE: It is possible that the checksum character may not be a printable character with some of the bar code types. BarTop, UseChecksum

208

PrintData method
Declaration: Category: Components: Description: procedure PrintData(Value: string); Printer TRPHTMLFiler, TReportFiler, TReportPrinter This method will print the string Value directly to the printer. This can be useful for sending printer specific commands to do things not normally supported by the Windows printer driver (Example (Delphi) electronic forms or HP-GL commands). WARNING: Including any printer specific commands in your reports may render the reports unusable on other computer systems. Use this method only on a limited basis. NOTE: This property may be used to send raw HTML tags and text out to the page which is not altered in any way by RPPro. All other print functions, PrintDataStream

See Also:

Example (Delphi)
ReportPrinter1.PrintData( SpecialCodes );

Example (C++ Builder)


ReportPrinter1->PrintData( SpecialCodes );

PrintDataStream method
Declaration: Category: Components: Description: procedure PrintDataStream(Stream: TStream; BufSize: longint); Printer TReportFiler, TReportPrinter This procedure will send BufSize bytes from Stream directly to the printer. If BufSize is 0 the remaining contents of Stream will be send. NOTE: Depending upon the content of the data sent to the printer, this command may cause your reports to be incompatible across different brands of printers. There are also many printer functions that are incompatible with the Windows printer driver and should not be used. PrintData

See Also:

Example (Delphi)
MyFileStream := TFileStream.Create('PAGE.PCL', fmOpenRead); PrintDataStream(MyFileStream,0); MyFileStream.Free;

Example (C++ Builder)


MyFileStream = new TFileStream(PAGE.PCL, fmOpenRead); rp->PrintDataStream(MyFileStream,0); delete MyFileStream;

209

PrintDefault method
Declaration: Category: Components: Description: See Also:

{ Table }

procedure PrintDefault; TablePrinter TTableColumn, TDBTableColumn, TTableSection This method will print the default contents of a table section or table column and is useful if the default printing events have been overridden. PrintBox

PrintDetail method
Declaration: Category: Components: Description: See Also: procedure PrintDetail Shell TMasterShell, TReportShell This method will reprint the detail section of the group by calling OnDetailBefore, DetailReport.Execute and then OnDetailAfter with IsReprint set to true. DetailReport, OnDetailBefore, OnDetailAfter

Example (Delphi)
ReportShell1.PrintDetail;

Example (C++ Builder)


ReportShell1->PrintDetail();

PrintEnd property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property PrintEnd: double; 0.0 Memo TDBMemoBuf, TMemoBuf This property will return or set the rightmost position that the memo field will print in. PrintStart

Example (Delphi)
{ Leave 1.5 inches for left margin } MemoBuf1.PrintEnd := 6.5;

Example (C++ Builder)


// Leave 1.5 inches for left margin MemoBuf1->PrintEnd = 6.5;

210

PrinterIndex property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property PrinterIndex: integer; -1 Printer TReportFiler, TReportPrinter This property will return or set the currently selected printer as defined in the Printer.Printers string list. Set PrinterIndex to -1 to use the default printer. SelectPrinter

Example (Delphi)
{ Save current printer index } CurrIndex := ReportPrinter1.PrinterIndex;

Example (C++ Builder)


// Save current printer index CurrIndex = ReportPrinter1->PrinterIndex;

Printers property
Declaration: Default: Category: Components: Description: See Also:

(read only)

property Printers: TStrings; (list of printers currently installed on the system) Printer TReportFiler, TReportPrinter This property will return a TStringList of printers that are currently installed on the users computer. SelectPrinter, TStrings

Example (Delphi)
ComboBox2.Items := Printers;

Example (C++ Builder)


ComboBox2->Items := rp->Printers;

PrintFimA method PrintFimB method PrintFimC method


Declaration: Category: Components: Description: procedure PrintFimA( X,Y: double ); procedure PrintFimB( X,Y: double ); procedure PrintFimC( X,Y: double ); Bar Code TRPBarsPostNet This method prints a PostNet FIM A, B or C at the given X, Y location.

Example (Delphi)
PostNetBC1.PrintFimB(3.5,0.5);

Example (C++ Builder)


PostNetBC1->PrintFimB(3.5,0.5);

211

PrintFooter method
Declaration: Category: Components: Description: See Also: procedure PrintFooter(Text: string; Justify: TPrintJustify); Printing TReportFiler, TReportPrinter This method will print the string, Text, just above the current SectionBottom justified by, Justify, between the current SectionLeft and SectionRight. All other print functions, GotoFooter

Example (Delphi)
PrintFooter('Date 01/20/95', pjRight);

Example (C++ Builder)


PrintFooter(Date 01/20/95, pjRight);

PrintGroupFooter method PrintGroupHeader method


Declaration: Category: Components: Description: See Also: procedure PrintGroupFooter; procedure PrintGroupHeader; Shell TMasterShell, TReportShell These methods will reprint the group header or footer by calling the OnGroupHeader or OnGroupFooter events with IsReprint set to true. OnGroupHeader, OnGroupFooter

Example (Delphi)
MasterShell1.PrintGroupHeader;

Example (C++ Builder)


MasterShell1->PrintGroupHeader();

PrintHeader method
Declaration: Category: Components: Description: See Also: procedure PrintHeader(Text: string; Justify: TPrintJustify); Printing TReportFiler, TReportPrinter This method will print the string, Text, just below the current SectionTop justified by, Justify, between the current SectionLeft and SectionRight. All other print functions, GotoHeader

Example (Delphi)
PrintHeader( 'Report Header Text', pjCenter);

Example (C++ Builder)


PrintHeader( Report Header Text, pjCenter);

212

PrintHeight method
Declaration: Category: Components: Description: procedure PrintHeight(Height:double; PrintTabs: boolean); Memo TMemoBuf This method will print the memo buffer for the height specified by the Height parameter. If Height is 0 then all lines in the memo buffer will be printed. If PrintTabs is true, then PrintHeight will print lines of empty tabs for each line that the memo buffer is printed on. NOTE: If the entire memo buffer is not printed, the internal position of MemoBuf will be set to the last character that was printed. This will allow the memo buffer to be continued on another page. You must initialize the TMemoBuf.BaseReport before calling this method. TMemoBuf, MemoHeightLeft, BaseReport

NOTE: See Also:

PrintHyperLink method
Declaration: Category: Components: Description: procedure PrintHyperLink(URL: string Attributes: string Text: string); HTML TRPHTMLFiler This method is used for simple links that need to be output. It prints the hyperlink with the specified URL, Target and Text. The Attributes parameter is used for any additional attributes that need to be included. PrintHyperLinkStart and PrintHyperLinkEnd are used when more complicated links are needed. For example, PrintHyperLinkStart may be called and then PrintImage may be called to provide an image for the link instead of text. PrintHyperLinkStart prints only the opening tag. It prints the URL, target and then any additional Attributes that are needed. PrintHyperLinkEnd, PrintHyperLinkStart, PrintImage

See Also:

Example (Delphi)
With HTMLFiler1 do begin PrintHyperLink(http://www.nevrona.com,, Nevrona Designs Web Site); end; { with }

Example (C++ Builder)


HTMLFiler1->PrintHyperLink(http://www.nevrona.com,, Nevrona Designs Web Site);

213

PrintHyperLinkEnd method
Declaration: Category: Components: Description: See Also: Example
see PrintHyperLinkStart for example

procedure PrintHyperLinkEnd; HTML TRPHTMLFiler This method simply outputs the ending </a> tag. PrintHyperLink, PrintHyperLinkStart, PrintImage

PrintHyperLinkStart method
Declaration: Category: Components: Description: See Also: procedure PrintHyperLinkStart(URL: string Attributes: string); HTML TRPHTMLFiler This method is used for simple links that need to be output. It prints the hyperlink with the specified URL, Target and Text. The Attributes parameter is used for any additional attributes that need to be included. PrintHyperLink, PrintHyperLinkEnd

Example (Delphi)
With HTMLFiler1 do begin PrintHyperLinkStart(http://www.nevrona.com,); Println(Nevrona Designs); PrintImage(http://www.nevrona.com/logo.jpg,2.0,2.0, alt=logo); Println(Web Site); PrintHyperLinkEnd; end; { with }

Example (C++ Builder)


HTMLFiler1->PrintHyperLinkStart("http://www.nevrona.com",""); rp->Println("Nevrona Designs"); HTMLFiler1->PrintImage( "http://www.nevrona.com/logo.jpg",2.0,2.0,"alt=\"logo\""); rp->Println("Web Site"); HTMLFiler1->PrintHyperLinkEnd();

214

PrintImage method
Declaration: procedure PrintImage(URL: string; Width; double Height: double; Attributes: string); HTML TRPHTMLFiler This method will print a link to an image. The URL parameter is the location of the image. Width and Height specify the size in inches of the rectangle that you want the image displayed in. If Width or Height is 0 then a tag for these properties is not generated and the browser will usually grab these values from the image when it is displayed. If Width or Height is negative, then the value is assumed to be in pixels and are directly used without conversion (except for negating). The Attributes parameter may be used to specify any additional attributes that are needed. PrintHyperLink, PrintHyperLinkEnd, PrintHyperLinkStart

Category: Components: Description:

See Also: Example

See PrintHyperLineStart for example

PrintImageRect method
Declaration: Category: Components: Description: See Also: procedure PrintImageRect(X1,Y1,X2,Y2: double; ImageStream: Tstream; ImageType: string); Graphics TReportFiler, TReportPrinter This method will draw ImageStream on the printer canvas stretched or shrunken to fit within the rectangle defined by the points (X1,Y1) and (X2,Y2). CalcGraphicHeight, CalcGraphicWidth, OnDecodeImage, PrintBitmap, StretchDraw, TBitmap

Example (Delphi)
With Sender as TBaseReport do begin Stream := TMemoryStream.Create; Image := TJPEGImage.Create; try Image.LoadFromFile('image1.jpg'); Image.SaveToStream(Stream); Stream.Position := 0; PrintImageRect(1,1,3,3,Stream,'JPG'); finally Image.Free; Stream.Free end; {tryf} end; {with}

215

Example (C++ Builder)


TBaseReport *rp = dynamic_cast<TBaseReport*>(Sender); Stream = new TMemoryStream->Create(); Image = new TJPEGImage->Create(); try { Image->LoadFromFile(image1.jpg); Image->SaveToStream(Stream); Stream->Position = 0; rp->PrintImageRect(1,1,3,3,Stream, JPG); } finally { delete Image; delete Stream; }; {tryf}

Printing property
Declaration: Category: Components: Description: See Also:

(read only)

property Printing: boolean; Control TReportFiler, TReportPrinter This property will be set to true after a call to Execute has been made and will remain true until the report has finished. Execute

Example (Delphi)
If ReportPrinter1.Printing then ReportPrinter1.Abort;

Example (C++ Builder)


if (ReportPrinter1->Printing) ReportPrinter1->Abort();

PrintJustify method
Declaration: procedure PrintJustify(Text: string; Pos: double; Justify: TPrintJustify; Margin: double; Width: double); Printing TReportFiler, TReportPrinter This method will print left, right, center or block justified text. The text will be justified inside a measurement rectangle starting at Pos and with a horizontal size of Width. Margin is the spacing between the text and the sides of the measurement rectangle in units. PrintBlock, PrintCenter, PrintLeft, PrintRight

Category: Components: Description:

See Also:

Example (Delphi)
PrintJustify(Centered Text, SectionLeft,pjCenter,0.0,SectionRight SectionLeft); { Same as PrintCenter(Centered Text, (SectionLeft + SectionRight) / 2.0); }

216

Example (C++ Builder)


rp->PrintJustify(Centered Text, SectionLeft,pjCenter,0.0,SectionRight SectionLeft); /* Same as PrintCenter(Centered Text, (SectionLeft + SectionRight) / 2.0); */

PrintLeft method
Declaration: Category: Components: Description: See Also: procedure PrintLeft(Text: string; Pos: double); Printing TReportFiler, TReportPrinter This method will print the string Text on the current line left justified at the position Pos. All other print functions

Example (Delphi)
ReportPrinter1.PrintLeft( Text left at 4.0, 4.0);

Example (C++ Builder)


ReportPrinter1->PrintLeft( Text left at 4.0, 4.0);

PrintLines method
Declaration: Category: Components: Description: procedure PrintLines(Lines: longint; PrintTabs: boolean); Memo TMemoBuf This method will print the memo buffer for the number of lines specified by Lines. If Lines is 0 then all lines in the memo buffer will be printed. If PrintTabs is true, then PrintMemo will print lines of empty tabs for each line that the memo buffer is printed on. NOTE: If the entire memo buffer is not printed, the internal position of MemoBuf will be set to the last character that was printed. This will allow the memo buffer to be continued on another page. You must initialize the TMemoBuf.BaseReport before calling this method. TMemoBuf, MemoLinesLeft, BaseReport

NOTE: See Also:

PrintLn method
Declaration: Category: Components: Description: See Also: procedure PrintLn(Text: string); Printing TReportFiler, TReportPrinter This method will print the string Text just like the Print method does; however, it also calls NewLine to go to the next line. NewLine, All other print functions

Example (Delphi)
ReportPrinter1.Println( Text on a line); ReportPrinter1.Println( Text on another line);

217

Example (C++ Builder)


ReportPrinter1->Println( Text on a line); ReportPrinter1->Println( Text on another line);

PrintMemo method
Declaration: Category: Components: Description: procedure PrintMemo(MemoBuf: TMemoBuf; Lines: longint; PrintTabs: boolean); Memo TReportFiler, TReportPrinter This method will print the memo buffer, MemoBuf, for the number of lines specified by Lines. If Lines is 0 then all lines in the memo buffer will be printed. If PrintTabs is true, then PrintMemo will print lines of empty tabs for each line that the memo buffer is printed on. NOTE: If the entire memo buffer is not printed, the internal position of MemoBuf will be set to the last character that was printed. This will allow the memo buffer to be continued on another page. TMemoBuf, MemoLines This code demonstrates just how easy it is to print a memo in multiple columns across multiple pages. This is code from the OnPrintPage event.

See Also: Example

Example (Delphi)
SetColumns(3,0.25); MemoBuf.PrintStart := ColumnStart; MemoBuf.PrintEnd := ColumnEnd; PrintMemo(MemoBuf, ColumnLinesLeft, false); ClearColumns;

Example (C++ Builder)


rp->SetColumns(3,0.25); MemoBuf->PrintStart = rp->ColumnStart; MemoBuf->PrintEnd := rp->ColumnEnd; rp->PrintLines(MemoBuf, rp->ColumnLinesLeft, false); rp->ClearColumns();

PrintPage method
Declaration: Category: Components: Description: See Also: procedure PrintPage(PageNum: word); Preview TFilePreview This method will print the page specified by PageNum to the preview window. The OnPageChange event handler will be called if the current page number changes. RedrawPage, OnPageChange

Example (Delphi)
FilePreview1.PrintPage( 2);

Example (C++ Builder)


FilePreview1->PrintPage( 2);

218

PrintPageFooter method PrintPageHeader method


Declaration: Category: Components: Description: See Also: procedure PrintPageFooter; procedure PrintPageHeader Shell TReportShell These methods will reprint the page header or footer by calling the OnPageHeader or OnPageFooter events with IsReprint set to true. OnPageHeader, OnPageFooter

Example (Delphi)
ReportShell1.PrintPageHeader;

Example (C++ Builder)


ReportShell1->PrintPageHeader();

PrintReadable property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property PrintReadable: boolean; true Bar Code TRPBarsBase Set this property to false if you do not want readable text to be printed along with the bar code. NOTE: For UPC bar codes, text is always printed. PrintTop, TextJustify

PrintReportFooter method PrintReportHeader method


Declaration: Category: Components: Description: See Also: procedure PrintReportFooter; procedure PrintReportHeader; Shell TReportShell These methods will reprint the report header or footer by calling the OnReportHeader or OnReportFooter events with IsReprint set to true. OnReportHeader, OnReportFooter

Example (Delphi)
ReportShell2.PrintReportFooter;

Example (C++ Builder)


ReportShell2->PrintReportFooter();

219

PrintRight method
Declaration: Category: Components: Description: See Also: procedure PrintRight(Text: string; Pos: double); Printing TReportFiler, TReportPrinter This method will print the string, Text, on the current line right justified at the position, Pos. all other print functions

Example (Delphi)
ReportPrinter1.PrintRight(Right justified at 3.0,3.0 );

Example (C++ Builder)


ReportPrinter1->PrintRight(Right justified at 3.0,3.0 );

PrintRow method
Declaration: Category: Components: Description: See Also: procedure PrintRow; Shell TDetailShell, TMasterShell, TReportShell This method will reprint the row section of the group by calling OnRowBefore, OnRowPrint. Execute() and then OnRowAfter with IsReprint set to true. OnRowBefore, OnRowPrint, OnRowAfter

Example (Delphi)
DetailShell1.PrintRow;

Example (C++ Builder)


DetailShell1->PrintRow();

PrintStart property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property PrintStart: double; 0.0 Memo TDBMemoBuf, TMemoBuf This property will return or set the leftmost position that the memo buffer will print in. PrintEnd

Example (Delphi)
{ Leave 1.5 inches for right margin } MemoBuf1.PrintStart := 1.5;

Example (C++ Builder)


// Leave 1.5 inches for right margin MemoBuf1->PrintStart = 1.5;

220

PrintTab method
Declaration: Category: Components: Description: See Also: procedure PrintTab(Text: string); Printing TReportFiler, TReportPrinter This method will print the next tab setting and then print Text within that tab box. This is equivalent to Print( #9 + Text); with the exception that Text is truncated if it is too long. Print, Println, Tab

Example (Delphi)
PrintTab(FieldByName(Name));

Example (C++ Builder)


PrintTab(FieldByName(Name));

PrintTop property
Declaration: Default: Category: Components: Description:

( read/write )

See Also:

property PrintTop: boolean; false Bar Code TRPBarsBase Set this property to true if you want the readable text to be printed on top of the bar code. A false value means that the readable text will be printed below the bar code. This property has no effect when printing UPC codes, since the UPC text is always printed at the bottom of the bar code. PrintReadable, TextJustify

Example (Delphi)
Code39.PrintTop := True; Code39.Print;

Example (C++ Builder)


Code39->PrintTop = true; Code39->Print();

PrintXY method
Declaration: Category: Components: Description: See Also: procedure PrintXY(X,Y: double; Text: string); Printing TReportFiler, TReportPrinter This method will print the string, Text, at the location specified by the point (X,Y). NOTE: The Y position will determine the location of the baseline of the printed text. All other print functions, GotoXY

Example (Delphi)
ReportPrinter1.PrintXY( 1.0, 2.0, Text above (1.0, 2.0));

Example (C++ Builder)


ReportPrinter1->PrintXY( 1.0, 2.0, Text above (1.0, 2.0));

221

PrintXY method
Declaration: Category: Components: Description: See Also:

{ Bar Code }

procedure PrintXY( X,Y: double ); Bar Code TRPBarsBase This method will print the bar code at the location specified by the point (X,Y). NOTE: The Y position will determine the location of the top of the bar code. Print, PrintReadable, PrintTop, Text

Example (Delphi)
Code2of5.Text := 12345; Code2of5.PrintXY( 1.0, 2.0 );

Example (C++ Builder)


Code2of5->Text = 12345; Code2of5->PrintXY( 1.0, 2.0 );

ProjectFile property
Declaration: Default: Category: Components: Description: See Also:

{Rave}

(read/write/pub)

property ProjectFile: string; Rave TRaveProject This property defines the filename of the report project that will be loaded when the TRaveProject component is opened. This parameter should point to a valid .RAV file. Active, Close, Open

PushFont method
Declaration: Category: Components: Description: See Also: Example: function PushFont: boolean; Font TReportFiler, TReportPrinter This method will push the current font onto an internal stack for later retrieval by PopFont. PopFont see PopFont

PushPos method
Declaration: Category: Components: Description: See Also: Example: function PushPos: boolean; Position TReportFiler, TReportPrinter This method will push the current text cursor position onto an internal stack for later retrieval by PopPos. PopPos see PopPos

222

PushTabs method
Declaration: Category: Components: Description: See Also: function PushTabs: boolean; Tabs TReportFiler, TReportPrinter This method will push the current tab settings onto an internal stack for later retrieval by PopTabs. PopTabs
{Rave}

Query property
Declaration: Category: Components: Description:

(read/write/pub)

property Query: TQuery; Rave TRPQueryConnection Specifies the TQuery component that is connected to the TRPQueryConnection component.

Example (Delphi)
CustOrdCXN.Query := CustOrdQuery;

Example (C++ Builder)


CustOrdCXN->Query = CustOrdQuery;

RaveBlobDateTime property
Declaration: Category: Components: Description:

{Rave}

(read/write/pub)

See Also:

property RaveBlobDateTime: TDateTime; Rave TRaveProject Returns the date and time that a report project was last loaded into the application form. This is not the date and time of the file that was loaded, but rather the date and time that the loading action was performed. If no report project is loaded, the value will be equal to 0.0. ClearRaveBlob, LoadRaveBlob, SaveRaveBlob

Example (Delphi)
Label1.Caption := DateTimeToStr(RaveProject1.RaveBlobDateTime);

Example (C++ Builder)


Label1->Caption = DateTimeToStr(RaveProject1->RaveBlobDateTime);

ReadableHeight property
Declaration: Category: Components: Description: See Also: property ReadableHeight: double; BarCode TRPBarsBase Returns the height that the readable text adds to the bar code. BarHeight, Height

(read only)

223

RecoverPrinter method
Declaration: Category: Components: Description: See Also:
Example:

procedure RecoverPrinter; Printer TReportFiler, TReportPrinter This method will recover the printer handle that was released by a prior call to ReleasePrinter. ReleasePrinter
See ReleasePrinter

Rectangle method
Declaration: Category: Components: Description: See Also: procedure Rectangle(X1,Y1,X2,Y2: double); Graphics TReportFiler, TReportPrinter This method will draw a rectangle defined by the points (X1,Y1) and (X2,Y2). The rectangle will be drawn with a border of the current pen and filled with the current brush. RoundRect

Example (Delphi)
ReportPrinter1.Rectangle(1.0, 1.0, 4.0, 5.0);

Example (C++ Builder)


ReportPrinter1->Rectangle(1.0, 1.0, 4.0, 5.0);

RedrawPage method
Declaration: Category: Components: Description: See Also: procedure RedrawPage; Preview TFilePreview This method will redraw the current page for the preview screen. PrintPage

Example (Delphi)
FilePreview1.RedrawPage;

Example (C++ Builder)


FilePreview1->RedrawPage();

224

RegisterGraphic method
Declaration: Category: Components: Description: procedure RegisterGraphic( index: integer); Graphics TReportFiler, TReportPrinter This method will help manage repeating, large bitmaps in a print job. You can register up to 10 bitmaps at once by passing in the index value from 1 to 10. With this method only one copy of the bitmap would be stored in the file with all other print functions referencing the same copy. NOTE: Use UnregisterGraphic( n ) to make sure that the graphic index that you are using is cleared. NOTE: This method will only optimize the execution of a report through TReportFiler. ReuseGraphic, UnregisterGraphic

See Also:

Example (Delphi)
Bitmap := TBitmap.Create; With Sender as TBaseReport do try Bitmap.LoadFromFile( LOGO.BMP ); UnregisterGraphic( 1 ); While not Table1.EOF do begin ReuseGraphic( 1 ); PrintBitmapRect( 1,1,2,2,Bitmap ); RegisterGraphic( 1 ); { other printing code } end; { while } finaly Bitmap.Free; end; { with }

Example (C++ Builder)


Bitmap = new TBitmap(); try { Bitmap->LoadFromFile( LOGO.BMP ); rp->UnregisterGraphic( 1 ); while (!Table1->Eof) { rp->ReuseGraphic( 1 ); rp->PrintBitmapRect( 1,1,2,2,Bitmap ); rp->RegisterGraphic( 1 ); // other printing code }// while } __finally { delete Bitmap; }// tryf

225

ReleasePrinter method
Declaration: Category: Components: Description: See Also: procedure ReleasePrinter; Printer TReportFiler, TReportPrinter This method will release the printer handle from ReportPrinter so that other components, such as TPrinterSetupDialog, can access the printer. Use RecoverPrinter to re-initialize ReportPrinter and recover the printer handle. RecoverPrinter

Example (Delphi)
ReportPrinter1.ReleasePrinter; PrinterSetupDialog1.Execute; ReportPrinter1.RecoverPrinter;

Example (C++ Builder)


ReportPrinter1->ReleasePrinter(); PrinterSetupDialog1->Execute(); ReportPrinter1->RecoverPrinter();

ReplaceAll method
Declaration: Category: Components: Description: See Also: procedure ReplaceAll(SearchText: string; ReplaceText: string; CaseMatters: boolean); Memo TDBMemoBuf, TMemoBuf This method will replace all occurrences of SearchText with ReplaceText. If CaseMatters is true then the case of the characters must match; otherwise, case will not be a factor for a match. SearchFirst, SearchNext

Example (Delphi)
MemoBuf.ReplaceAll('%name%', Name, false); MemoBuf.ReplaceAll('%address%', Address, false);

Example (C++ Builder)


MemoBuf->ReplaceAll(%name%, Name, false); MemoBuf->ReplaceAll(%address%, Address, false);

226

ReplaceFileName property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property ReplaceFileName: String; (empty) Printing TRPHTMLFiler This property is used in conjunction with ReplaceToken. This property is used to define a master HTML template file which contains a unique token (e.g. <REPORT1>) somewhere in its source. When the report is executed, the token will be replaced with the report contents and the new HTML file will be written to FileName. The file, ReplaceFileName, will not be modified. If no value is defined by ReplaceFileName or ReplaceToken or if the ReplaceFileName does not exist then a simple, default HTML template is used. ReplaceToken

Example (Delphi)
HTMLFiler1.ReplaceFileName := template.html; HTMLFiler1.ReplaceToken := <REPORT_INSERT_POINT>; HTMLFiler1.FileName := generated.html; HTMLFiler1.Execute;

Example (C++ Builder)


HTMLFiler1->ReplaceFileName = template.html; HTMLFiler1->ReplaceToken = <REPORT_INSERT_POINT>; HTMLFiler1->FileName = generated.html; HTMLFiler1->Execute();

ReplaceToken property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property ReplaceToken: String; (empty) Printing TRPHTMLFiler This property is used in conjunction with ReplaceFileName. This property is used to define a master HTML template file which contains a unique token (e.g. <REPORT1>) somewhere in its source. When the report is executed, the token will be replaced with the report contents and the new HTML file will be written to FileName. The file, ReplaceFileName, will not be modified. If no value is defined by ReplaceFileName or ReplaceToken or if the ReplaceFileName does not exist then a simple, default HTML template is used. ReplaceFileName

Example (Delphi)
see ReplaceFileName for example

Example (C++ Builder)


see ReplaceFileName for example

227

ReportDateTime property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property ReportDateTime: TDateTime; (Date and time Execute or Start was called) Printing TReportFiler, TReportPrinter This property will set or return the date and time the report was started. Macro, TDateTime

Example (Delphi)
Edit1.Text := DateTimeToStr(ReportDateTime);

Example (C++ Builder)


Edit1->Text = DateTimeToStr(rp->ReportDateTime);

ReportDesc property
Declaration: Category: Components: Description:

{Rave}

(read only)

See Also:

property ReportDesc: string; Rave TRaveProject A Rave report is defined by 3 items. The name property is the standard type name with no spaces or special characters. The full name is like a short title that can be more descriptive of the reports purpose. The description is more like a memo that would be the complete description about a report that could be displayed in a memobuf area for the user to select. This property will return the description of the currently selected report. ReportFullName, ReportName, ReportDescToMemo, SelectReport
{Rave}

ReportDescToMemo method
Declaration: Category: Components: Description: See Also:

procedure ReportDescToMemo(Memo: TCustomMemo); Rave TRaveProject Initializes the memo component, Memo, to the contents of the currently selected report description. ReportDesc, SelectReport

ReportDest property
Declaration: Category: Components: Description:

(read only)

See Also:

property ReportDest: TReportDest; ReportSystem TReportSystem This property will be set to the actual destination of the report after the setup form has been exited. This can be useful for determining which selection the user has chosen (printer/preview/file) and assign that to other ReportSystem components (in the DefaultDest property). DefaultDest

228

ReportFullName property
Declaration: Category: Components: Description:

{Rave}

(read only)

See Also:

property ReportFullName: string; Rave TRaveProject A Rave report is defined by 3 items. The name property is the standard type name with no spaces or special characters. The full name is like a short title that can be more descriptive of the reports purpose. The description is more like a memo that would be the complete description about a report that could be displayed in a memobuf area for the user to select. This property will return the full name of the currently selected report. ReportDesc, ReportName, SelectReport
{Rave}

ReportName property
Declaration: Category: Components: Description:

(read only)

See Also:

property ReportName: string; Rave TRaveProject A Rave report is defined by 3 items. The name property is the standard type name with no spaces or special characters. The full name is like a short title that can be more descriptive of the reports purpose. The description is more like a memo that would be the complete description about a report that could be displayed in a memobuf area for the user to select. This property will return the name of the currently selected report. ReportFullName, ReportDesc, SelectReport

ReportPrinter property
Declaration: Category: Components: Description:

(read/write)

property ReportPrinter: TBaseReport; TablePrinter TTableColumn, TDBTableColumn, TTableSection This property returns the TBaseReport component that is handling the printer output.

Reprint property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Reprint: boolean; false Shell TMasterShell, TReportShell This property defines whether the current row will be called to reprint if the detail section wraps to a second page. This can be useful to reprint the master record for detail records on another page. IsReprint

Example (Delphi)
MasterShell2.Reprint := true;

Example (C++ Builder)


MasterShell2->Reprint = true;

229

ReprintHeader property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property ReprintHeader: boolean; true TablePrinter TTablePrinter This property defines whether or not the headers for a table will be re-printed if the detail section has to go to a new page.

Reset method
Declaration: Category: Components: Description: See Also: procedure Reset; Control TReportFiler, TReportPrinter This method will reset certain settings (Pen, Brush, Origins, Columns, Tabs, Sections and Text Cursor position) to their default values. ResetPrinter

Example (Delphi)
ReportPrinter1.Reset;

Example (C++ Builder)


ReportPrinter1->Reset();

Reset method
Declaration: Category: Components: Description: See Also:

{MemoBuf}

procedure Reset; Memo TDBMemoBuf, TMemoBuf This method will reset the memo buffer back to the beginning position. Use this method if you have printed a portion of a memo buffer, but want to start at the beginning again. Pos

Example (Delphi)
MemoBuf1.Reset;

Example (C++ Builder)


MemoBuf1->Reset();

ResetLineHeight method
Declaration: Category: Components: Description: procedure ResetLineHeight; Position TReportFiler, TReportPrinter This method will reset the property LineHeight to the current font if the LineHeightMethod property is equal to lhmFont. Otherwise, ResetLineHeight sets LineHeight to the value of 1.0/LinesPerInch or leaves it alone if LineHeightMethod is lhmUser. LineHeight, LineHeightMethod

See Also:

Example (Delphi)
ReportPrinter1.ResetLineHeight;

230

Example (C++ Builder)


ReportPrinter1->ResetLineHeight();

ResetPrinter method
Declaration: Category: Components: Description: procedure ResetPrinter; Printer TReportFiler, TReportPrinter This method will reset the current printer for the settings given in the DevMode structure as well as other printer related settings. This function is called automatically whenever you change the current printer or change the orientation. DevMode

See Also:

Example (Delphi)
ReportPrinter1.ResetPrinter;

Example (C++ Builder)


ReportPrinter1->ResetPrinter();

ResetSection method
Declaration: Category: Components: Description: See Also: procedure ResetSection; Position TReportFiler, TReportPrinter This method will reset the section values, SectionLeft, SectionRight, SectionTop and SectionBottom to be equal to the current margin settings. All Margin and Section properties

Example (Delphi)
ReportPrinter1.ResetSection;

Example (C++ Builder)


ReportPrinter1->ResetSection();

ResetTabs method
Declaration: Category: Components: Description: See Also: procedure ResetTabs; Tabs TReportFiler, TReportPrinter This method resets the current tab to the beginning. NewLine calls this function to reset the current tab. ClearTabs, SetTab

Example (Delphi)
ReportPrinter1.ResetTabs

Example (C++ Builder)


ReportPrinter1->ResetTabs()

231

RestoreBuffer method
Declaration: Category: Components: Description: See Also: Example: procedure RestoreBuffer; Memo TDBMemoBuf, TMemoBuf This method will restore the memo buffer to the state it was in during the last call to SaveBuffer. SaveBuffer see Tutorial 12

RestoreFont method
Declaration: Category: Components: Description: See Also: function RestoreFont(Index: integer): boolean; Font TReportFiler, TReportPrinter This method will restore the font settings, saved by a previous SaveFont call, using an Index from 1 to 10. The result of this function will be true if the call was successful. SaveFont

Example (Delphi)
RestoreFont(10); { Restore the font saved in position 10 }

Example (C++ Builder)


rp->RestoreFont(10); // Restore the font saved in position 10

RestorePos method
Declaration: Category: Components: Description: See Also: function RestorePos(Index: byte): boolean; Position TReportFiler, TReportPrinter This method will set the text cursor position to the setting that was last stored at index, Index, by SavePos. The valid values for Index are 1 to 10. SavePos

Example (Delphi)
ReportPrinter.RestorePos(1);

Example (C++ Builder)


ReportPrinter->RestorePos(1);

RestoreState method
Declaration: Category: Components: Description: See Also: procedure RestoreState; Memo TDBMemoBut, TMemoBuf This method restores the cursor position and other state information of the memobuffer back to what it was when SaveState was called. NOTE: This does not effect the contents of the memo buffer. Pos, RestoreBuffer, SaveState

232

RestoreTabs method
Declaration: Category: Components: Description: See Also: function RestoreTabs(Index: integer): boolean; Tabs TReportFiler, TReportPrinter This method will restore the tab settings, saved by a previous SaveTabs call, using an Index from 1 to 10. The result of this function will be true if the call was successful. SetTab, RestoreTabs

Example (Delphi)
RestoreTabs(3); { Restore the tab settings in position 3 }

Example (C++ Builder)


RestoreTabs(3); // Restore the tab settings in position 3

ReuseGraphic method
Declaration: Category: Components: Description: procedure ReuseGraphic; Graphics TReportFiler, TReportPrinter This method allows the use of a repeating, large bitmaps in a print job that has been registered with the RegisterGraphic method. With this method only one copy of the bitmap would be stored in the file with all other print functions referencing the same copy. NOTE: This method will only optimize the execution of a report through TReportFiler. RegisterGraphic, UnregisterGraphic See RegisterGraphic

See Also: Example:

RichEdit property
Declaration: Category: Components: Description: See Also:

( write only )

property RichEdit: string Memo TDBMemoBuf, TMemoBuf Imports the RTF contents stored in a TRichEdit component into a memo buffer. NOTE: This property does not exist in Delphi 1.0. RTFLoadFromStream, RTFText

Example (Delphi)
MemoBuf1.RichEdit := RichEdit1;

Example (C++ Builder)


MemoBuf1->RichEdit = RichEdit1;

233

Right property
Declaration: Category: Components: Description: See Also:

{Bar Code}

( read/write )

property Right: double; Bar Code TRPBarsBase Sets or returns the position for the right edge of the bar code. When a value is assigned to Right, the BarCodeJustify property is set to pjRight as well. BarCodeJustify, Center, Left, Position

Example (Delphi)
BarCode1.Right := SectionRight;

Example (C++ Builder)


BarCode1->Right = rp->SectionRight;

Right property
Declaration: Default: Category: Components: See:

{ReportSection}

(read/write/pub)

property Right: double; 0.0 ReportSection TReportSection Bottom (for description and example), Left, RightMethod, Top
{ReportSection}

RightMethod property
Declaration: Default: Category: Components: See:

(read/write/pub)

property RightMethod: TDistanceMethod; dmMargin (except TopMethod is dmSpecial) ReportSection TReportSection BottomMethod (for description and example), Left

RightWaste property
Declaration: Category: Components: Description: See Also: Example:

(read only)

property RightWaste: double; Printer TReportFiler, TReportPrinter This property returns the waste area on the right side of the page that the printer cannot print into. It is a good idea to make sure that the reports margins are greater than or equal to its waste areas. BottomWaste , LeftWaste , MarginRight , TopWaste See LeftWaste

234

RoundRect method
Declaration: Category: Components: Description: procedure RoundRect(X1,Y1,X2,Y2,X3,Y3: double); Graphics TReportFiler, TReportPrinter This method will draw a rectangle defined by the points (X1,Y1) and (X2,Y2). The corners of the rectangle will be drawn as quarters of an ellipse with a width of X3 and a height of Y3. The rectangle will be drawn with a border of the current pen and filled with the current brush. Rectangle, Ellipse

See Also:

Example (Delphi)
RoundRect(1.125,3.5,3.125,5.0,0.25,0.25);

Example (C++ Builder)


rp->RoundRect(1.125,3.5,3.125,5.0,0.25,0.25);

Row property
Declaration: Default: Category: Components: Description: See Also:

(read only)

property Row: integer; (current row of the label being printed) Label TLabelShell This property will return the current row of the label being printed. Col

RPDev function
Declaration: Category: Components: Description: function RPDev: TRPDevice; Printer RPDevice unit This function will return the current RPDevice object that is managing printing for ReportPrinter. See RPDEVICE.PAS for more information.

RTFField property
Declaration: Category: Components: Description: See Also:

( write only )

property RTFField: TMemoField Memo TDBMemoBuf Imports a RTF string stored in a TMemoField component into a memo buffer. Field, RTFText

RTFLoadFromFile method
Declaration: Category: Components: Description: See Also: procedure RTFLoadFromFile( FileName: String); Memo TDBMemoBuf, TMemoBuf Load an RTF text file into the memo buffer. LoadFromFile, RTFLoadFromStream

Example (Delphi)
MemoBuf1.RTFLoadFromFile(Letter.RTF);

235

Example (C++ Builder)


MemoBuf1->RTFLoadFromFile(Letter.RTF);

RTFLoadFromStream method
Declaration: Category: Components: Description: See Also: procedure RTFLoadFromStream( stream: Tstream; BufSize: longint); Memo TDBMemoBuf, TMemoBuf Loads a RTF text from a stream into the memo buffer. If BufSize is 0 then remaining lenth of the stream is read in, otherwise, BufSize bytes are read in. LoadFromFile, RTFLoadFromFile

RTFText property
Declaration: Category: Components: Description: See Also:

( write only )

property RTFText: string Memo TDBMemoBuf, TMemoBuf Imports an RTF string stored in a text variable into the memo buffer. RTFField, SetRTF

RulerType property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property RulerType: TRulerType; rtNone Preview TFilePreview, TReportSystem This will create a ruler around the preview screen that can be used to measure items during report development. rtNone: No rulers will be visible. rtHorizCm: A ruler in centimeters will be on the top of the page. rtVertCm: A ruler in centimeters will be on the left side of the page. rtBothCm: Rulers in centimeters will be on the top and left side of the page. rtHorizIn: A ruler in inches will be on the top of the page. rtVertIn: A ruler in inches will be on the left side of the page. rtBothIn: Rulers in inches will be on the top and left side of the page. GridHoriz, GridPen, GridVert

Example (Delphi)
RulerType := rtBothIn;

Example (C++ Builder)


rp->RulerType = rtBothIn;

236

RuntimeVisibility property
Declaration: Default: Category: Components: Description:

{Rave}

(read/write/pub)

Note: See Also:

property RuntimeVisibility: Boolean; rtDeveloper Rave TRPCustomConnection This property determines the visibility of the data connection to an End User designer. rtNone: invisible to external programs at runtime. rtDeveloper: visible only to developer version of Rave at runtime. rtEndUser: visibile to any version of Rave. If you are NOT distributing the end user report designer and are concerned about the visibility of your data to external application, you should set the RuntimeVisibility to rtNone before distributing your application. DevLock property on Rave Compoents

Example (Delphi)
RPCustomConnection1.RuntimeVisibility := rtNone;

Example (C++ Builder)


RPCustomConnection1->RuntimeVisibility = rtNone;

Save method
Declaration: Category: Components: Description: See Also:

{Rave}

procedure Save; Rave TRaveProject This method will save the current report project to the file specified by the ProjectFile property. Close, Open, ProjectFile

SaveBuffer method
Declaration: Category: Components: Description: procedure SaveBuffer; Memo TDBMemoBuf, TMemoBuf This method will save the current memo buffer to a saved buffer that can later be restored with RestoreBuffer. This can be useful for printing form letters that you need to modify for each print run, but want to return to the original settings at the beginning of each page. FreeSaved, RestoreBuffer

See Also:

Example (Delphi)
MemoBuf.SaveBuffer; { Save original contents }

Example (C++ Builder)


MemoBuf->SaveBuffer(); // Save original contents

237

SaveFont method
Declaration: Category: Components: Description: See Also: function SaveFont(Index: integer): boolean; Font TReportFiler, TReportPrinter This method will save the current font settings using a value of Index from 1 to 10. These settings can later be restored with a call to RestoreFont. The result of this function will be true if the call was successful. RestoreFont

Example (Delphi)
SaveFont(2); {Save the current font settings in position 2}

Example (C++ Builder)


rp->SaveFont(2);//Save the current font settings in position 2

SavePos method
Declaration: Category: Components: Description: See Also: function SavePos(Index: byte): boolean; Position TReportFiler, TReportPrinter This method will store the current text cursor position into an array at index, Index. The valid values for Index are 1 to 10. RestorePos

Example (Delphi)
ReportPrinter1.SavePos(1);

Example (C++ Builder)


ReportPrinter1->SavePos(1);

SaveRaveBlob method
Declaration: Category: Components: Description:

{Rave}

See Also:

function SaveRaveBlob(Stream: TStream); Rave TRaveProject This method will save the currently loaded report project from the application form to Stream. You should not need to call this function since the normal method of saving the loaded report project is through the TRaveProject.StoreRAV property editor. ClearRaveBlob, LoadRaveBlob, RaveBlobDateTime, StoreRAV

Example (Delphi)
RaveProject1.SaveRaveBlob( MyStream );

Example (C++ Builder)


RaveProject1->SaveRaveBlob( MyStream );

238

SaveState method
Declaration: Category: Components: Description: See Also: procedure SaveState; Memo TMemoBuf This method saves the current cursor position, Pos, and other state information. You can restore the memo buffer state back by calling RestoreState. Pos, RestoreState, SaveBuffer

SaveTabs method
Declaration: Category: Components: Description: See Also: function SaveTabs(Index: integer): boolean; Tabs TReportFiler, TReportPrinter This method will save the current tab settings using a value of Index from 1 to 10. These settings can later be restored with a call to RestoreTabs. The result of this function will be true if the call was successful. SetTab, RestoreTabs

Example (Delphi)
SaveTabs(5); { Save the current tab settings in position 5 }

Example (C++ Builder)


SaveTabs(5);// Save the current tab settings in position 5

SaveToFile method
Declaration: Category: Components: Description: See Also: function SaveToFile(FileName: String); Rave TRaveProject This method will save the report project to the file specified by FileName. LoadFromStream, Save, SaveToStream

{Rave}

Example (Delphi)
RaveProject1.SaveToFile(Project1.Rav);

Example (C++ Builder)


RaveProject1->SaveToFile(Project1.Rav);

SaveToStream method
Declaration: Category: Components: Description: See Also: procedure SaveToStream(Stream: TStream); Memo TDBMemoBuf, TMemoBuf This method will save the memo buffer to the stream. LoadFromStream

Example (Delphi)
MemoBuf1.SaveToStream( MyStream );

Example (C++ Builder)


MemoBuf1->SaveToStream( MyStream );

239

SaveToStream method
Declaration: Category: Components: Description: See Also: procedure SaveToStream(Stream: TStream); Rave TRaveProject This method will save the report project to Stream. LoadFromFile, LoadFromStream, Save, SaveToFile

{Rave}

Example (Delphi)
RaveProject1.SaveToStream(RaveStream);

Example (C++ Builder)


RaveProject1->SaveToStream(RaveStream);

ScaleX property ScaleY property


Declaration: Default: Category: Components: Description:

(read/write/pub) (read/write/pub)

See Also:

property ScaleX: double; property ScaleY: double; 100 Control TReportFiler, TReportPrinter These properties return or set the current scaling percent to apply. A value of 100.0 results in normal size, while 200.0 will double the print size and 50.0 will half the print size. This can be used with OriginX and OriginY to print multiple pages per piece of paper. OriginX, OriginY

Example (Delphi)
{ Scale to fit 4 pages on one sheet of paper } ReportPrinter1.ScaleX := 50.0; ReportPrinter1.ScaleY := 50.0;

Example (C++ Builder)


// Scale to fit 4 pages on one sheet of paper ReportPrinter1->ScaleX = 50.0; ReportPrinter1->ScaleY = 50.0;

ScreenDPI property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property ScreenDPI: integer; 96 HTML TRPHTMLFiler This property allows you to define the conversion factor that is used for converting measurements in the report to pixels on the screen.

Example (Delphi)
HTMLFiler1.ScreenDPI := 120; { Set for large fonts }

Example (C++ Builder)


HTMLFiler1->ScreenDPI = 120;// Set for large fonts

240

ScrollBox property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property ScrollBox: TScrollBox; nil Preview TFilePreview This property defines the scroll box on the preview form that the report will be drawn in.

Example (Delphi)
FilePreview1.ScrollBox := Form1.ScrollBox1;

Example (C++ Builder)


FilePreview1->ScrollBox = Form1->ScrollBox1;

SearchFirst method
Declaration: Category: Components: Description: function SearchFirst(SearchText: string; CaseMatters: boolean): boolean; Memo TDBMemoBuf, TMemoBuf This method will start a search process, looking for SearchText from the beginning of the buffer. If CaseMatters is true then the case of the characters must match; otherwise, case will not be a factor for the match. This function will return true if it finds a match and false if it doesn't. Use SearchNext to continue the search after the first occurrence. Pos, SearchNext

See Also:

Example (Delphi)
{ Store the number of occurrences of 'APPLE' in apples } Apples := 0; Found := MemoBuf.SearchFirst('APPLE', false); While Found do begin Inc(Apples); Found := MemoBuf.SearchNext; end; { while }

Example (C++ Builder)


// Store the number of occurrences of 'APPLE' in apples Apples := 0; Found := MemoBuf->SearchFirst(APPLE, false); while (Found == true) { Apples++; Found = MemoBuf->SearchNext(); }// while

241

SearchNext method
Declaration: Category: Components: Description: See Also:
Example:

function SearchNext: boolean; Memo TDBMemoBuf, TMemoBuf This method will continue a search initiated by SearchFirst. This function will return true if it finds a match and false if it doesn't. Pos, SearchFirst
See SearchFirst

Section property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Section: TReportSection; Default report section TablePrinter TTableSection This property defines the report section parameters that the table section will be drawn in. TReportSection

SectionBodyFooter property SectionBodyHeader property


Declaration: Default: Category: Components: Description: See Also:

(read/write/pub) (read/write/pub)

property SectionBodyFooter: TReportSection; property SectionBodyHeader: TReportSection; Standard section values Shell TDetailShell, TMasterShell, TReportShell Brings up the section editor, which you can use to define the section settings for the body header or footer. OnBodyHeader, OnBodyFooter

Example (Delphi)
SectionBodyHeader.Lines := 1;

Example (C++ Builder)


SectionBodyHeader->Lines = 1;

242

SectionBottom property
Declaration: Default: Category: Components: Description: property SectionBottom: double; MarginBottom Position TReportFiler, TReportPrinter

(read/write)

These properties return or set the current section of the paper to be printed on. Items that rely upon the current section settings are line starting points (Example (Delphi) after a CR call), setting columns, LinesLeft and ColumnLinesLeft. The section settings are reset to the margin values after each new page is generated. Changing a margin setting will change its corresponding section setting to the same measurement. NOTE: Section settings are different from margin setting in that the section values are always measurements from the upper or left side of the page while margins are measurements from the closest side of the page. ( Example (Delphi) SectionRight := 8.0 would be the same as MarginRight := 0.5 for 8.5 inch wide paper.) Margin properties, ResetSection, SectionLeft, SectionRight, SectionTop

See Also:

Example (Delphi)
With ReportPrinter1 do begin SectionLeft := 1.0; SectionRight := 7.5; SectionTop := 1.5; SectionBottom := 1.0; end; { with }

Example (C++ Builder)


rp->SectionLeft = 1.0; rp->SectionRight = 7.5; rp->SectionTop = 1.5; rp->SectionBottom = 1.0;

SectionGroupFooter property SectionGroupHeader property


Declaration: Default: Category: Components: Description: See Also:

(read/write/pub) (read/write/pub)

property SectionGroupFooter: TReportSection; property SectionGroupHeader: TReportSection; Standard section values Shell TMasterShell, TReportShell Brings up the section editor, which you can use to define the section settings for the group header or footer OnGroupHeader, OnGroupFooter

Example (Delphi)
SectionGroupHeader.FontIndex := 5;

Example (C++ Builder)


SectionGroupHeader->FontIndex = 5;

243

SectionLeft property
Declaration: Default: Category: Components: Description: property SectionLeft: double; MarginLeft Position TReportFiler, TReportPrinter

(read/write)

These properties return or set the current section of the paper to be printed on. Items that rely upon the current section settings are line starting points (Example (Delphi) after a CR call), setting columns, LinesLeft and ColumnLinesLeft. The section settings are reset to the margin values after each new page is generated. Changing a margin setting will change its corresponding section setting to the same measurement. NOTE: Section settings are different from margin setting in that the section values are always measurements from the upper or left side of the page while margins are measurements from the closest side of the page. ( Example (Delphi) SectionRight := 8.0 would be the same as MarginRight := 0.5 for 8.5 inch wide paper.) Margin properties, ResetSection, SectionBottom (for description and example), SectionRight, SectionTop

See:

SectionPageFooter property SectionPageHeader property


Declaration: Default: Category: Components: Description: See Also:

(read/write/pub) (read/write/pub)

property SectionPageHeader: TReportSection; property SectionPageFooter: TReportSection; Standard section values Shell TReportShell Brings up the section editor, which you can use to define the section settings for the page header or footer. OnPageHeader, OnPageFooter

Example (Delphi)
SectionPageFooter.BottomMethod := dmPage; SectionPageFooter.Bottom := 0.25;

Example (C++ Builder)


SectionPageFooter->BottomMethod = dmPage; SectionPageFooter->Bottom = 0.25;

244

SectionReportFooter property SectionReportHeader property


Declaration: Default: Category: Components: Description: See Also:

(read/write/pub) (read/write/pub)

property SectionReportHeader: TReportSection; property SectionReportFooter: TReportSection; Standard section values Shell TReportShell Brings up the section editor, which you can use to define the section settings for the report header or footer. OnReportHeader, OnReportFooter

Example (Delphi)
SectionReportHeader.TopMethod := dmMargin; SectionReportHeader.Top := 0.25;

Example (C++ Builder)


SectionReportHeader->TopMethod = dmMargin; SectionReportHeader->Top = 0.25;

SectionRight property
Declaration: Default: Category: Components: Description: property SectionRight: double; MarginRight Position TReportFiler, TReportPrinter

(read/write)

These properties return or set the current section of the paper to be printed on. Items that rely upon the current section settings are line starting points (Example (Delphi) after a CR call), setting columns, LinesLeft and ColumnLinesLeft. The section settings are reset to the margin values after each new page is generated. Changing a margin setting will change its corresponding section setting to the same measurement. NOTE: Section settings are different from margin setting in that the section values are always measurements from the upper or left side of the page while margins are measurements from the closest side of the page. ( Example (Delphi) SectionRight := 8.0 would be the same as MarginRight := 0.5 for 8.5 inch wide paper.) Margin properties, ResetSection, SectionBottom (for description and example), SectionLeft, SectionTop

See:

245

SectionRow property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property SectionRow: TReportSection; Standard section values Shell TDetailShell, TMasterShell, TReportShell Brings up the section editor, which you can use to define the section settings for each row. OnRowPrint

Example (Delphi)
SectionRow.TabIndex := 2;

Example (C++ Builder)


SectionRow->TabIndex = 2;

SectionTop property
Declaration: Default: Category: Components: Description: property SectionTop: double; MarginTop Position TReportFiler, TReportPrinter

(read/write)

These properties return or set the current section of the paper to be printed on. Items that rely upon the current section settings are line starting points (Example (Delphi) after a CR call), setting columns, LinesLeft and ColumnLinesLeft. The section settings are reset to the margin values after each new page is generated. Changing a margin setting will change its corresponding section setting to the same measurement. NOTE: Section settings are different from margin setting in that the section values are always measurements from the upper or left side of the page while margins are measurements from the closest side of the page. ( Example (Delphi) SectionRight := 8.0 would be the same as MarginRight := 0.5 for 8.5 inch wide paper.) Margin properties, ResetSection, SectionBottom (for description and example), SectionLeft, SectionRight

See:

SectionType property
Declaration: Category: Components: Description: See Also:

(read only)

property SectionType: TSectionType; TablePrinter TTableSection This property defines the type of section that this table section is. This will control when it is called during the report. OutputType

246

SelectBin method
Declaration: Category: Components: Description: See Also: function SelectBin(BinName: string): boolean; Printer TReportPrinter This method will select a bin containing BinName in its description and return a boolean value of whether it was successful or not. NOTE: This method must be called before any calls to the OnNewPage event. Bins, OnNewPage, SupportBin

Example (Delphi)
SelectBin(UPPER);

Example (C++ Builder)


SelectBin(UPPER);

Selection property
Declaration: Default: Category: Components: Description:

(read/write)

property Selection: string; ( empty ) Control TReportFiler, TReportPrinter This property will override FirstPage and LastPage if not blank. Selection defines the valid pages in a print job and can contain separate page ranges, separated by commas or with ranges defined as First-Last. You also are allowed to select even, odd or reverse order page output by including one of the following. e or even pages o or odd pages r reverse order pages a or all FirstPage, LastPage, SystemOptions
:= := := := 1-11; 5-8,25; 1,3,6-; 1,e,9-11; {Print {Print {Print {Print pages 1 through 11} pages 5 through 8 and page 25} pages 1,3 and 6 to end of job} all even pages and page 1, 9 through 11} {Print all odd pages} // // // // Print pages 1 through 11 Print pages 5 through 8 and page 25 Print pages 1,3 and 6 to end of job Print all even pages and page 1, 9 through 11 // Print all odd pages

See Also:
Selection Selection Selection Selection

Example (Delphi)

Selection := o;

Example (C++ Builder)


Selection Selection Selection Selection = = = = 1-11; 5-8,25; 1,3,6-; 1,e,9-11;

Selection := o;

247

SelectPaper method
Declaration: Category: Components: Description: See Also: function SelectPaper(PaperName: string): boolean; Printer TReportPrinter This method will select a paper size containing PaperName in its description and return a boolean value of whether it was successful or not. Papers, SupportPaper

Example (Delphi)
SelectPaper(LEGAL);

Example (C++ Builder)


SelectPaper(LEGAL);

SelectPrinter method
Declaration: Category: Components: Description: See Also: function SelectPrinter(SubStr: string): boolean; Printer TReportFiler, TReportPrinter This method will set the current printer to the first printer in Printers that contains the substring SubStr in its name. If no printer is found then the current printer is not changed and a false value is returned. PrinterIndex

Example (Delphi)
SelectPrinter(Laser);

Example (C++ Builder)


SelectPrinter(Laser);

SelectReport method
Declaration: Category: Components: Description:

{Rave}

See Also:

function SelectReport(ReportName: string; FullName: boolean): boolean; Rave TRaveProject This method will select the report specified by ReportName. If FullName is true, the function will search the report whose full name matches, otherwise it will search the short names. The result of the function is whether the selection of the report, ReportName, was successful or not. GetReportList, ReportFullName, ReportName

248

SetBrush method
Declaration: Category: Components: Description: See Also: procedure SetBrush(NewColor: TColor; NewStyle: TBrushStyle; NewBitmap: TBitmap); Graphics TReportFiler, TReportPrinter This method will set the current brush for the given parameters. If a bitmap is not desired, pass in the value of nil. CreateBrush, TBitmap, TBrushStyle, TColor

Example (Delphi)
ReportPrinter1.SetBrush(clBlack, bsClear, nil);

Example (C++ Builder)


ReportPrinter1->SetBrush(clBlack, bsClear, NULL);

SetColumns method
Declaration: Category: Components: Description: See Also: procedure SetColumns(NewColumns: integer; Between: double); Column TReportFiler, TReportPrinter This method sets up a specific number of columns, NewColumns, with a separation, Between, between each column. The column width is calculated to fit within the current SectionLeft and SectionRight. SetColumnWidth, ColumnWidth, SectionLeft, SectionRight

Example (Delphi) This code shows how to create columns and send output to them. Also see PrintMemo.
{ Create 4 columns with 0.5" between each } SetColumns(4,0.5); While ColumnLinesLeft > 0 do begin Println(IntToStr(LinesLeft) + '/' + IntToStr(ColumnLinesLeft) + '/' + IntToStr(LineNum) + '/' + IntToStr(ColumnNum)); end; { while }

Example (C++ Builder)


// Create 4 columns with 0.5" between each rp->SetColumns(4,0.5); while (rp->ColumnLinesLeft() > 0) { rp->Println( IntToStr(rp->LinesLeft()) + "/" + IntToStr(rp->ColumnLinesLeft()) + "/" + IntToStr(rp->LineNum) + "/" + IntToStr(rp->ColumnNum)); }// while

249

SetColumnWidth method
Declaration: Category: Components: Description: procedure SetColumnWidth(Width: double; Between: double); Column TReportFiler, TReportPrinter This method sets the columns to a specific width, Width, with a separation, Between, between each column. The number of columns is calculated to fit within the current SectionLeft and SectionRight. SetColumns, Columns, SectionLeft, SectionRight.

See Also:

Example (Delphi)
{ Create columns 2 inches wide and a half of an inch apart } ReportPrinter1.SetColumnWidth( 2.0, 0.5 );

Example (C++ Builder)


// Create columns 2 inches wide and a half of an inch apart ReportPrinter1->SetColumnWidth( 2.0, 0.5 );

SetData method
Declaration: Category: Components: Description: See Also: procedure SetData(var Buffer; BufSize: longint); Memo TDBMemoBuf, TMemoBuf This method will assign the data in Buffer (for BufSize bytes) to the memo buffer. This can be useful for long strings that are more than 255 characters. Text

Example (Delphi)
{ Assign a PChar to a memo buffer } MemoBuf.SetData(PCharVar^, StrLen(PCharVar));

SetFont method
Declaration: Category: Components: Description: See Also: procedure SetFont(NewName: string; NewSize: integer); Font TReportFiler, TReportPrinter This method will set the current font for the given parameters. NewSize is the point size of the font (1/72nds of an inch). AssignFont , CreateFont , FontCharSet

Example (Delphi)
ReportPrinter1.SetFont( Arial, 10 );

Example (C++ Builder)


ReportPrinter1->SetFont( Arial, 10 );

250

SetPaperSize method
Declaration: Category: Components: Description: procedure SetPaperSize(Size: integer; Width: double; Height: double); Printer TReportFiler, TReportPrinter This method will set the current paper size for the selected printer to the settings of either the Windows API constant, Size (see TDevMode.dmPaperSize) or if Width and Height are non-zero then it will attempt to set a custom paper size. NOTE: Not all printer drivers support custom page sizes and most have minimum and maximum acceptable values.

Example (Delphi)
{ Set papersize to 10 wide by 12 high } ReportPrinter1.SetPaperSize(0,10,12); { Set papersize to 8.5 wide by 14 high } ReportFiler1.SetPaperSize(DMPAPER_LEGAL,0,0);

Example (C++ Builder)


// Set papersize to 10 wide by 12 high ReportPrinter1->SetPaperSize(0,10,12); // Set papersize to 8.5 wide by 14 high ReportFiler1->SetPaperSize(DMPAPER_LEGAL,0,0);

SetPen method
Declaration: procedure SetPen(NewColor: TColor; NewStyle: TPenStyle; NewWidth: integer; NewMode: TPenMode); Graphics TReportFiler, TReportPrinter This method will set the current pen for the given parameters. The NewWidth parameter, if positive, is the width of the pen in printer units (dots) and if negative, is the width on the pen in 1/100ths of an inch. CreatePen, TPenMode, TPenStyle, TColor

Category: Components: Description: See Also:

Example (Delphi)
ReportPrinter1.SetPen(clBlack,psSolid,-2,pmCopy);

Example (C++ Builder)


ReportPrinter1->SetPen(clBlack,psSolid,-2,pmCopy);

251

SetPIVar method
Declaration: Category: Components: Description: procedure SetPIVar(PIVarName: string; PIVarValue: string); Printing TReportFiler , TReportPrinter , TReportSystem This method allows you to initialize the value of a PIVar (Post Initialize Variable). Any PIVars of the same name that were previously printed will show this value. A common use for PIVars is to print a total in a header band that would be initialized later in the footer band. This works even across multiple pages. TReportSystem.SystemOptions.soUserFiler must be true if you are using PIVars in your report. PIVar

See Also: Example


See PIVar

SetRTF method
Declaration: Category: Components: Description: See Also: procedure SetRTF(var Buffer; BufSize: longint); Memo TRTFFiler Works exactly like SetData, except the data stored in Buffer is RTF text. RTFText, SetData

252

SetTab method
Declaration: procedure SetTab(NewPos: double; NewJustify: TPrintJustify; NewWidth: double; NewMargin: double; NewLines: byte; NewShade: byte); Tabs TReportFiler, TReportPrinter This method adds a tab setting. NewPos defines the starting position of the tab. If NewPos is set to the constant, NA, then the tab will start immediately after the previous tab box. NewJustify defines whether the tab is left (pjLeft), right (pjRight) or center (pjCenter) justified. If a non-zero width is given, then a tab box is defined and the text will be justified within the tab box rather than justified at the tab position. NewMargin defines the distance between the tab box side and the text in 1/100ths of an inch. NewLines uses the BoxLineXxxx constants to define where lines are to be drawn around the tab box. NewShade defines the percent of background shading to use for this tab box. ClearTabs, ResetTabs

Category: Components: Description:

See Also:

Example (Delphi)
ClearTabs; SetPen(clBlack, psSolid,1, SetTab(0.5,pjCenter,3.5,0, SetTab(NA, pjCenter,1.0,0, SetTab(NA, pjCenter,1.5,0, SetTab(NA, pjCenter,1.5,0, Bold := true; Tab(-2,NA,-2,-2,NA); Print('Name'); Tab(NA,NA,-2,-2,NA); Print('Number'); Tab(NA,NA,-2,-2,NA); Print('Amount 1'); Tab(NA,-2,-2,-2,NA); Println('Amount 2'); Bold := false; pmCopy); BOXLINEALL,0); BOXLINEALL,0); BOXLINEALL,0); BOXLINEALL,0);

253

Example (C++ Builder)


rp->ClearTabs(); rp->SetPen(clBlack, psSolid,1, rp->SetTab(0.5,pjCenter,3.5,0, rp->SetTab(NA, pjCenter,1.0,0, rp->SetTab(NA, pjCenter,1.5,0, rp->SetTab(NA, pjCenter,1.5,0, rp->Bold = true; rp->Tab(-2,NA,-2,-2,NA); rp->Print("Name"); rp->Tab(NA,NA,-2,-2,NA); rp->Print("Number"); rp->Tab(NA,NA,-2,-2,NA); rp->Print("Amount 1"); rp->Tab(NA,-2,-2,-2,NA); rp->Println("Amount 2"); rp->Bold = false; pmCopy); BOXLINEALL,0); BOXLINEALL,0); BOXLINEALL,0); BOXLINEALL,0);

SetTopOfPage method
Declaration: Category: Components: Description: See Also: procedure SetTopOfPage; Position TReportFiler, TReportPrinter This method will set SectionTop to the bottom of the current line. SectionTop, MarginTop

Example (Delphi)
ReportPrinter1.SetTopOfPage;

Example (C++ Builder)


ReportPrinter1->SetTopOfPage();

SetupSection method
Declaration: Category: Components: Description: function SetupSection(BaseReport: TBaseReport): boolean; ReportSection TReportSection This method will adjust the section to match the settings defined. If there is not enough height available for the section then a new page will be generated. The tabs and font will also be initialized if TabIndex or FontIndex are non-zero. This method is called automatically by the shell and table printer components. Enabled

See Also:

Example (Delphi)
ReportSection.SetupSection(Sender as TBaseReport);

Example (C++ Builder)


ReportSection->SetupSection( dynamic_cast<TBaseReport*>(Sender));

254

ShadeColor property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property ShadeColor: TColor; clBlack TablePrinter TTableColumn, TDBTableColumn, TTableSection This property, along with ShadePercent, defines the color that will be used to fill a table column or table section. ShadePercent, TColor

ShadePercent property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property ShadePercent: byte; 0 TablePrinter TTableColumn, TDBTableColumn, TTableSection This property defines the percentage (0 for none, 100 for all) of ShadeColor that will be used to fill a table column or table section. ShadeColor

ShadeToColor method
Declaration: Category: Components: Description: See Also: function ShadeToColor(ShadeColor: TColor; ShadePercent: byte): TColor; Graphics N/A This function will create a color that only has ShadePercent amount of Shadecolor. SetBrush, TColor

ShadowDepth property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property ShadowDepth: integer; 0 Preview TFilePreview, TReportSystem This property will define the shadow depth of the preview page in pixels. NOTE: Shadows will not be drawn while the Monochrome property is true. Monochrome

Example (Delphi)
ShadowDepth := 5;

Example (C++ Builder)


ShadowDepth = 5;

255

ShowPrintDialog method
Declaration: Category: Components: Description: See Also: function ShowPrintDialog: boolean; Printer TReportFiler, TReportPrinter Brings up the standard Windows PrintDialog. Use this function instead of Delphis TPrintDialog component. ShowPrinterSetupDialog

Example (Delphi)
If ReportPrinter1.ShowPrintDialog then begin ReportPrinter1.Execute; end; { if }

Example (C++ Builder)


if (ReportPrinter1->ShowPrintDialog()) { ReportPrinter1->Execute(); }// if

ShowPrinterSetupDialog method
Declaration: Category: Components: Description: See Also: function ShowPrinterSetupDialog: boolean; Printer TReportFiler, TReportPrinter Brings up the standard Windows PrinterSetupDialog. Use this function instead of Delphis TPrinterSetupDialog component. ShowPrintDialog

Example (Delphi)
If ReportPrinter1.ShowPrinterSetupDialog then begin ReportPrinter1.Execute; end; { if }

Example (C++ Builder)


if (ReportPrinter1->ShowPrinterSetupDialog()) { ReportPrinter1->Execute(); }// if

Size property
Declaration: Category: Components: Description: See Also:

(read/write)

property Size: longint; Memo TDBMemoBuf, TMemoBuf This property will return the current size of the text in the memo buffer in bytes. MaxSize, Pos

Example (Delphi)
MemoBytes := MemoBuf1.Size;

Example (C++ Builder)


MemoBytes = MemoBuf1->Size;

256

SkipNum property
Declaration: Default: Category: Components: Description:

( read/write )

See Also:

property SkipNum: Integer 0 Label TLabelShell When SkipNum is set to a non-zero value, then TLabelShell will skip that many labels before it starts printing. This can be useful if your want to prompt your users for the number of labels that have already been printed on the first sheet. This will automatically be reset to 0 after the label report has been executed. StartCol, StartRow

SoftLine method
Declaration: Category: Components: Description: See Also: procedure SoftLine; RTF TRTFFiler This method should be called to go to the next line in an RTF exported document without inserting a hard carriage return. For printer based ouput (TreportPrinter, TReportFiler) this method performs the same as NewLine. NewLine, NewPara

SpacingHeight property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property SpacingHeight: double; 1.0 Label TLabelShell This property returns or sets the label height plus the vertical spacing between two adjacent labels. SpacingLeft, SpacingTop, SpacingWidth

Example (Delphi)
LabelShell1.SpacingHeight := 1.2;

Example (C++ Builder)


LabelShell1->SpacingHeight = 1.2;

SpacingLeft property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property SpacingLeft: double; 0.19 Label TLabelShell This property returns or sets the spacing between the left side of the label and the left margin. SpacingTop, SpacingWidth, SpacingHeight

Example (Delphi)
LabelShell1.SpacingLeft := 0.21;

257

Example (C++ Builder)


LabelShell1->SpacingLeft = 0.21;

SpacingTop property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property SpacingTop: double; 0.5 Label TLabelShell This property returns or sets the spacing between the top of the label and the top margin. SpacingLeft, SpacingWidth, SpacingHeight

Example (Delphi)
LabelShell1.SpacingTop := 0.75;

Example (C++ Builder)


LabelShell1->SpacingTop = 0.75;

SpacingWidth property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property SpacingWidth: double; 2.75 Label TLabelShell This property returns or sets the label width plus the horizontal spacing between two adjacent labels. SpacingLeft, SpacingTop, SpacingHeight

Example (Delphi)
LabelShell1.SpacingWidth := 3.00;

Example (C++ Builder)


LabelShell1->SpacingWidth = 3.00;

SplitRow property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property SplitRow: boolean; true TablePrinter TTableColumn, TDBTableColumn This property determines whether or not table column rows can be split across pages.

258

Start method
Declaration: Category: Components: Description: procedure Start; Control TFilePreview, TReportFiler, TReportPrinter For TFilePreview, this method starts a preview session and draws the first page to the preview screen. Use the methods, PrevPage, NextPage, PrintPage, ZoomIn and ZoomOut to interact with the user of the preview screen after Start has been called. For TReportPrinter and TReportFiler, these methods start a printing job that should be terminated later with a call to Finish. All event handlers are active except for OnPrint and OnPrintPage which are used only with Execute. Finish, Execute

See Also:

Example (Delphi)
FilePreview1.Start;

Example (C++ Builder)


FilePreview1->Start();

StartCol property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property StartCol: Integer 0 Label TLabelShell Use both StartCol and StartRow to instruct TLabelShell to start printing at a particular row and column. This will automatically be reset to 0 after the label report has been executed. SkipNum, StartRow

StartNewPage property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property StartNewPage: boolean; false Shell TDetailShell, TMasterShell, TReportShell This property, if true, will force a page break before each new group prints. This can be useful for forms that contain one record per page. NewPage

Example (Delphi)
ReportShell1.StartNewPage := true;

Example (C++ Builder)


ReportShell1->StartNewPage = true;

259

StartPos property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property StartPos: double; 0.0 TablePrinter TTablePrinter, TDBTablePrinter This property defines the horizontal starting position for the table.

Example (Delphi)
DBTablePrinter2.StartPos := 1.5;

Example (C++ Builder)


DBTablePrinter2->StartPos = 1.5;

StartRow property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property StartRow: Integer 0 Label TLabelShell Use both StartCol and StartRow to instruct TLabelShell to start printing at a particular row and column. This will automatically be reset to 0 after the label report has been executed. SkipNum, StartCol

StatusFormat property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property StatusFormat: string; Printing page %p Misc TReportFiler, TReportPrinter This property defines the format for the text printed to StatusLabel during an UpdateStatus call. There are several special formatting character pairs that can be used within the string: %c - Current printing pass %p - Current Page %f - First Page %l - Last Page %d - Printer Device Name %n - force a carriage return %r - Printer Driver Name %s - Total number of passes %t - Printer Port %0 through %9 - Status Text Line (see StatusText) %% - % character CurrentPass, StatusLabel, StatusText, TotalPasses, UpdateStatus

Example (Delphi)
ReportPrinter1.StatusFormat := Generating page %p; ReportPrinter1.StatusFormat := 'Printing page %p (Pass %c of %s)';

260

Example (C++ Builder)


ReportPrinter1->StatusFormat = Generating page %p; ReportPrinter1->StatusFormat = Printing page %p (Pass %c of %s);

StatusLabel property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property StatusLabel: TLabel; nil Misc TReportFiler, TReportPrinter This property defines the TLabel component that UpdateStatus will put the status text, StatusFormat, into. StatusFormat, StatusText, UpdateStatus

Example (Delphi)
ReportPrinter1.StatusLabel := StatusForm.Label1;

Example (C++ Builder)


ReportPrinter1->StatusLabel = StatusForm->Label1;

StatusText property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property StatusText: TStrings; ( Empty ) Misc TReportFiler, TReportPrinter This property defines a string list of at most 10 strings that can replace the special formatting characters (%0 to %9) in StatusFormat. StatusFormat, TStrings

Example (Delphi)
StatusText[1] := 'Inform user of report status'; UpdateStatus;

Example (C++ Builder)


rp->StatusText->Strings[1] = Inform user of report status; rp->UpdateStatus();

261

StoreRAV property
Declaration: Default: Category: Components: Description:

{Rave}

(read only/special/pub)

See Also:

property StoreRAV: boolean; False Rave TReportProject This property will return whether a report project (RAV file) is stored in the executable or not. At design-time, editing this property will bring up a dialog allowing you to load, save or remove a report project from your application. The date and time that a report project was last loaded into is displayed in the Object Inspector. Note that this is not the date and time of the file on disk, but the date and time that the load action was performed. A warning will be displayed if a file, defined by ProjectFile, exists that is of a later date and time and you will be prompted to use the version on the disk instead. ClearRaveBlob, LoadRaveBlob, ProjectFile, RaveBlobDateTime, SaveRaveBlob

Stream property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Stream: TStream; nil Control TFilePreview, TFilePrinter, TReportFiler This property returns or sets the stream used to either write to or read from the report file. A user created stream can be assigned when StreamMode is equal to smUser but otherwise this property should not be modified. StreamMode, FileName

Example (Delphi)
var ReportStream: TMemoryStream; begin ReportStream := TMemoryStream.Create; try With ReportPrinter1 do begin StreamMode := smUser; Stream := ReportStream; Execute; end; { with } finally ReportStream.Free; end; { tryf } end;

Example (C++ Builder)


TMemoryStream* ReportStream = new TMemoryStream(); try { rp->StreamMode = smUser; rp->Stream = ReportStream; rp->Execute(); } __finally { delete ReportStream; }// tryf

262

StreamMode property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property StreamMode: TStreamMode; smMemory Control TFilePreview, TFilePrinter, TReportFiler This property defines how the stream for the report file is maintained. The setting smFile uses a TFileStream to store the report file and is very good for large reports, but may run a little slower. smTempFile will send the ouput to a temporary file in the \Windows\Temp directory. This filename used by smTempFile is created by the system and will be deleted when you exit the reporting system. The setting smMemory uses a TMemoryStream and is good for small reports to run faster, but do not use this option for reports that may be large. smUser does not create a stream, but uses the stream that has been assigned to the Stream property before the report was started. The programmer is responsible for creating and freeing the stream if smUser is used. Stream, FileName

Example (Delphi)
ReportPrinter1.StreamMode := smMemory; ReportPrinter2.FileName := TEMP.RPT; ReportPrinter2.StreamMode := smFile;

Example (C++ Builder)


ReportPrinter1->StreamMode = smMemory; ReportPrinter2->FileName = TEMP.RPT; ReportPrinter2->StreamMode = smFile;

StretchDraw method
Declaration: Category: Components: Description: procedure StretchDraw(const Rect: TRect; Graphic: TGraphic); Graphics TReportFiler, TReportPrinter This method draws the graphic object, Graphic, to the printer canvas stretched or shrunken to fit within the rectangle, Rect. NOTE: Do not use StretchDraw for bitmaps, instead use PrintBitmap or PrintBitmapRect. CreateRect, Draw, PrintBitmap, PrintBitmapRect, TGraphic, TRect

See Also:

263

Strikeout property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property Strikeout: boolean; false Font TReportFiler, TReportPrinter This property returns or sets the strikeout attribute for the current font. Bold, Underline, Italic

Example (Delphi)
With ReportPrinter1 do begin Strikeout := true; Print( Deleted Text ); Strikeout := false; end; { with }

Example (C++ Builder)


rp->Strikeout = true; rp->Print( Deleted Text ); rp->Strikeout = false;

Subscript property
Declaration: Default: Category: Components: Description: See Also: property Subscript: boolean; false Font TReportFiler, TReportPrinter Returns or sets the superscript setting for the current text font. Superscript

(read/write)

Example (Delphi)
{ Print a formula } Print('Y = Pi * X'); Subscript := true; Print('a'); Subscript := false;

Example (C++ Builder)


// Print a formula rp->Print(Y = Pi * X); rp->Subscript = true; rp->Print(a); rp->Subscript = false;

264

SubTotal property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property SubTotal: double; 0.0 TablePrinter TTableColumn, TDBTableColumn This property returns or sets the current subtotal for a table column. This value is used by a table section with an OutputType of otSubTotals. GrandTotal, PageTotal

Superscript property
Declaration: Default: Category: Components: Description: See Also: property Superscript: boolean; false Font TReportFiler, TReportPrinter Returns or sets the superscript setting for the current text font. Subscript

(read/write)

Example (Delphi)
{ Print a formula } Print('E = MC'); Superscript := true; Print('2'); Superscript := false;

Example (C++ Builder)


// Print a formula rp->Print(E = MC); rp->Superscript = true; rp->Print(2); rp->Superscript = false;

SupportBin method
Declaration: Category: Components: Description: See Also: function SupportBin(BinNum: integer): boolean; Printer TReportPrinter This method will return true if the bin number (see TDevMode.dmDefaultSource in the Windows API help) specified by BinNum is supported by the printer, otherwise it will return false. SelectBin, SupportXxxx methods, TDevMode in Windows API help

SupportCollate method
Declaration: Category: Components: Description: See Also: function SupportCollate: boolean; Printer TReportPrinter This method will return true if the printer supports collation, otherwise it will return false. SupportXxxx methods 265

SupportDuplex method
Declaration: Category: Components: Description: See Also: function SupportDuplex: boolean; Printer TReportPrinter This method will return true if the current printer supports duplex (double sided) printing. Duplex, SupportXxxx methods, TDuplex

SupportOrientation method
Declaration: Category: Components: Description: See Also: function SupportOrientation: boolean; Printer TReportFiler, TReportPrinter This method will return true if the current printer supports orientation changes. SupportXxxx methods

SupportPaper method
Declaration: Category: Components: Description: See Also: function SupportPaper(PaperNum: integer): boolean; Printer TReportPrinter This method will return true if the paper number (see TDevMode.dmPaperSize in the Windows API help) specified by PaperNum is supported by the printer, otherwise it will return false. SupportXxxx methods, TDevMode in Windows API help

SystemFiler property
Declaration: Category: Components: Description: See Also:

(read/write/pub)

property SystemFiler: TSystemFiler; ReportSystem TReportSystem All SystemFiler options operate in the same manner as the other components except for the stream mode of smMemory which does not require a filename and will use a TMemoryStream to contain a report. Other SystemXxxx options

Example (Delphi)
ReportSystem1.SystemFiler.AccuracyMethod := amAppearance;

Example (C++ Builder)


ReportSystem1->SystemFiler->AccuracyMethod = amAppearance;

266

SystemOptions property
Declaration: Category: Components: Description:

(read/write/pub)

See Also:

property SystemOptions: TSystemOptions; ReportSystem TReportSystem The SystemOptions properties control the configuration of the TReportSystem component: soUseFiler will always send the report to a report file. This can be very useful if the Macro method has been used in the report. soWaitForOK will determine whether the user has to press the OK button once the report has been generated for output. soShowStatus will determine whether or not the status screen is displayed when the report is being generated. soAllowPrintFromPreviewwill determine whether the user can print from the preview screen. soPreviewModal determines if the preview screen will be modal. soNoGenerate will cause the ReportSystem component to skip over the generation phase of the report and proceed straight to screen or the printer. This option should only be used with a StreamMode of smFile where the report file has been previously generated and needs only to be viewed or printed. Other SystemXxxx options

Example (Delphi)
{ Disable the status screen } ReportSystem1.SystemOptions := ReportSystem1.SystemOptions - [soShowStatus];

Example (C++ Builder)


// Disable the status screen ReportSystem1->SystemOptions = ReportSystem1->SystemOptions >> soShowStatus;

SystemPreview property
Declaration: Category: Components: Description:

(read/write/pub)

See Also:

property SystemPreview: TSystemPreview; ReportSystem TReportSystem SystemPreview displays all the preview type options displayed in TFilePreview. Following are the additional properties: FormHeight defines the height of the ReportSystem report preview form. FormState defines the initial window status (normal, minimized maximized) of the ReportSystem report preview form. FormWidth defines the width of the ReportSystem report preview form. Other SystemXxxx options

or

Example (Delphi)
ReportSystem1.SystemPreview.FormState := wsMaximized;

Example (C++ Builder)


ReportSystem1->SystemPreview->FormState = wsMaximized;

267

SystemPrinter property
Declaration: Category: Components: Description: See Also:

(read/write/pub)

property SystemPrinter: TSystemPrinter; ReportSystem TReportSystem SystemPrinter displays all the printer type options displayed in TFilePrinter. Other SystemXxxx options

Example (Delphi)
ReportSystem1.SystemPrinter.MarginLeft := 0.5;

Example (C++ Builder)


ReportSystem1->SystemPrinter->MarginLeft = 0.5;

SystemSetups property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property SystemSetups: TSystemSetups; [ssAllowSetup, ssAllowCopies, ssAllowCollate, ssAllowDuplex, ssAllowDestPreview, ssAllowDestPrinter, ssAllowDestFile, ssAllowPrinterSetup] ReportSystem TReportSystem This property contains settings that define the behavior of the Printer Setup Dialog that TReportSystem uses. To see a description of each option see TSystemSetup. TSystemSetup

Example (Delphi)
{ Disable the setup screen } ReportSystem1.SystemSetups := ReportSystem1.SystemSetups - [ssAllowSetup];

Example (C++ Builder)


// Disable the setup screen ReportSystem1->SystemSetups = ReportSystem1->SystemSetups >> ssAllowSetup;

268

Tab method
Declaration: procedure Tab(LeftWidth: integer; RightWidth: integer; TopWidth: integer; BottomWidth: integer; ShadeOverride: integer); Tabs TReportFiler, TReportPrinter This method sets the current tab settings to the next available tab. If the next tab is a tab box, then the lines for that tab are drawn at this time as well as any shading that might apply. The LeftWidth, RightWidth, TopWidth and BottomWidth are overrides for the width of the side of the tab box in 1/100ths of an inch, but should be passed as the constant, NA, for the default pen width. If the LeftWidth, RightWidth, TopWidth or BottomWidth parameter(s) are positive, then it is the width of the pen in printer units (dots) and if negative, it is the width on the pen in 1/100ths of an inch. ShadeOverride is a percent of shading to draw the background of the tab box in and will override TabShade or the original setting of the tab box shading. SetTab, TabShade

Category: Components: Description:

See Also:

Example (Delphi)
With ReportPrinter1 do begin Tab(-2,NA,-2,-2,NA); Print('First tab'); Tab(NA,NA,-2,-2,NA); Print('Second tab'); end; { with }

Example (C++ Builder)


rp->Tab(-2,NA,-2,-2,NA); rp->Print(First tab); rp->Tab(NA,NA,-2,-2,NA); rp->Print(Second tab);

TabColor property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property TabColor: TColor; clBlack Tabs TReportFiler, TReportPrinter This property defines the color that will be used to shade tab boxes created with SetTab. TabShade will define what percentage of TabColor is used. TabShade, SetTab, TColor

269

TabEnd method
Declaration: Category: Components: Description: function TabEnd(Index: integer): double; Tabs TReportFiler, TReportPrinter This method will return the horizontal ending position of the tab box specified by Index. If Index is 0 then the result will be for the current tab and if Index is greater than the number of defined tabs then a value of 0.0 will be returned. GetTab, TabStart, TabWidth

See Also:

Example (Delphi)
{ End of current tab region } CurrEnd := ReportPrinter1.TabEnd( 0);

Example (C++ Builder)


// End of current tab region CurrEnd = ReportPrinter1->TabEnd( 0);

TabIndex property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property TabIndex: integer; 0 ReportSection TReportSection This property defines the saved tabs position that will be initialized during a call to SetupSection.A value of 0 will not cause any tab settings to be changed. SaveTabs

Example (Delphi)
TabIndex := 4; { Use the tab settings saved in position 4 }

Example (C++ Builder)


TabIndex = 4; // Use the tab settings saved in position 4

TabJustify property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property TabJustify: TTabJustify; tjNone Tabs TReportFiler, TReportPrinter This property will override any tab justification that was defined with SetTab(). This can be useful for column headings that are normally centered while the remaining data is justified according to the type of data. tjNone will disable this feature while tjLeft, tjCenter, tjRight and tjBlock will set the justification respectively. SetTab

Example (Delphi)
TabJustify := tjCenter; Println(#9'Name'#9'Number'); TabJustify := tjNone;

270

Example (C++ Builder)


rp->TabJustify = tjCenter; rp->Println(\tName\tNumber); rp->TabJustify = tjNone;

Table property
Declaration: Default: Category: Components: Description:

{Rave}

(read/write/pub)

property Table(ReportPrinter: TRave); nil Rave TRPTableConnection Specifies the TTable component that is connected to the TRPTableConnection component.

Example (Delphi)
CustomerCXN.Table := CustomerQuery;

Example (C++ Builder)


CustomerCXN->Table = CustomerQuery;

TableAttributes property
Declaration: Category: Components: Description: See Also:

(read/write/pub)

property TableAttributes: String; HTML TRPHTMLFiler This allows you to override the default settings for any HTML tables that are generated. If this property is blank, the default will be [border=0|1 cellpadding=0 cellspacing=0]. ParagraphAttributes

TableColumn property
Declaration: Category: Components: Description: See Also:

(read only)

property TableColumn[Index: integer]: TTableColumn; TablePrinter TTablePrinter, TDBTablePrinter This property will return the table column component stored at Index. TableColumns, TableSection

TableColumns property
Declaration: Default: Category: Components: Description: See Also:

(read only)

property TableColumns: integer; 0 TablePrinter TTablePrinter, TDBTablePrinter This property will return the number of table columns stored in the current table printer. TableColumn

271

TableItem property
Declaration: Category: Components: Description: See Also:

(read/write)

property TableItem: TTableItem; TablePrinter TTableColumn, TDBTableColumn This property will define the TableItem item (a TTableSection or TTableColumn component) that is to be used for formatting options. Common properties between TableSection and TableColumn

TablePrinter property
Declaration: Category: Components: Description: See Also:

(read/write)

property TablePrinter: TTablePrinter; TablePrinter TTableColumn, TDBTableColumn, TTableSection This property returns the parent table printer for a table section or table column component. ReportPrinter

TableSection property
Declaration: Category: Components: Description: See Also:

(read only)

property TableSection[Index: TSectionType]: TTableSection; TablePrinter TTablePrinter, TDBTablePrinter This property returns the TTableSection component stored in the table printer. A value of nil will be returned if that table section has not been activated yet. TableColumn

272

TabShade property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

TabShade: integer; 0 Tabs TReportFiler, TReportPrinter This property defines a default tab shading that will override the tab shading defined with SetTab but not override the setting of the ShadeOverride parameter of the Tab method. TabShade can be useful for printing barred rows of alternating shades by setting TabShade before each line is printed. SetTab, Tab

Example (Delphi)
If Odd(LineNum) then begin TabShade := 0; end else begin TabShade := 15; end; { else }

Example (C++ Builder)


if ((rp->LineNum % 2) == 1) { TabShade = 0; } else { TabShade = 15; }// else

TabStart method
Declaration: Category: Components: Description: function TabStart(Index: integer): double; Tabs TReportFiler, TReportPrinter This method will return the horizontal starting position of the tab box specified by Index. If Index is 0 then the result will be for the current tab and if Index is greater than the number of defined tabs then a value of 0.0 will be returned. GetTab, TabEnd, TabWidth

See Also:

Example (Delphi)
{ Start of current tab region } CurrStart := ReportPrinter1.TabStart( 0);

Example (C++ Builder)


// Start of current tab region CurrStart = ReportPrinter1->TabStart( 0);

273

TabWidth method
Declaration: Category: Components: Description: See Also: function TabWidth(Index: integer): double; Tabs TReportFiler, TReportPrinter This method will return the width of the tab box specified by Index. If Index is 0 then the result will be for the current tab and if Index is greater than the number of defined tabs then a value of 0.0 will be returned. TabStart, TabEnd

Example (Delphi)
{ Width of current tab region } CurrWidth := ReportPrinter1.TabWidth( 0);

Example (C++ Builder)


// Width of current tab region CurrWidth = ReportPrinter1->TabWidth( 0);

TAccuracyMethod
Declaration: Category: Components: Description:

type

TAccuracyMethod = (amPositioning, amAppearance); Control TReportFiler amPositioning: This setting will cause the string to be written one character at a time. amAppearance: This setting will cause the whole string to be written at one time. See Also: AccuracyMethod Example:See AccuracyMethod

TBKMode
Declaration: Category: Components: Description:

type

TBKMode = (bkTransparent, bkOpaque); Graphics TReportFiler, TReportPrinter bkTransparent: This setting will write the text without erasing the background. bkOpaque: This setting will write the text after the background has been cleared. See Also: TextBKMode Example:See TextBKMode

274

TBoxLines
TBoxLines = (blNone, blLeft, blRight, blLeftRight, blTop, blLeftTop, blRightTop, blNoBottom, blBottom, blLeftBottom, blRightBottom, blNoTop, blTopBottom, blNoRight, blNoLeft, blAll); Category: TablePrinter Components: TTableColumn, TDBTableColumn, TTableSection Description: blNone: This setting will not draw any lines blLeft: This setting will draw the left line only blRight: This setting will draw the right line only blLeftRight: This setting will draw the left and right lines blTop: This setting will draw the top line only blLeftTop: This setting will draw the left and top lines blRightTop: This setting will draw the right and top lines blNoBottom: This setting will all lines but the bottom blBottom: This setting will draw the bottom line blLeftBottom: This setting will draw the left and bottom lines blRightBottom: This setting will draw the right and bottom lines blNoTop: This setting will draw all lines but the top blTopBottom: This setting will draw the top and bottom lines blNoRight: This setting will draw all lines but the right blNoLeft: This setting will draw all lines but the left blAll: This setting will draw all lines See Also: BoxLines Example:See BoxLines Declaration:

type

TDuplex
Declaration: Category: Components: Description: See Also: Example: TDuplex = (dupSimplex, dupHorizontal, dupVertical); Printer TReportPrinter dupSimplex: Simplex mode (Duplex mode is not initialized) dupHorizontal: Duplex mode initialized print head to toe dupVertical: Duplex mode initialized print head to head Duplex, SupportDuplex See Duplex

type

275

Text property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Text: TFormatString; ( empty ) TablePrinter TTableSection This property defines the data that a table section will print if OutputType is otText. OutputType

Example (Delphi)
TableSection.Text := Customer Listing Report;

Example (C++ Builder)


TableSection->Text = Customer Listing Report;

Text property
Declaration: Category: Components: Description:

{Bar Code}

( read/write )

See Also:

property Text: string; Bar Code TRPBarsBase The text to be printed as a bar code. NOTE: Do not include the check character. The check character will be automatically calculated and printed according to the state of the UseChecksum property. NOTE: Any characters that are invalid for the bar code type will be deleted from the text property upon assignment. Print, PrintXY, TextJustify, UseChecksum

Example (Delphi)
PostNetBC1.Text := 85283-3558; { since - is not valid it will be stripped out }

Example (C++ Builder)


PostNetBC1->Text = 85283-3558; // since - is not valid it will be stripped out

Text property
Declaration: Default: Category: Components: Description: See Also:

{Memo}

(read/write)

property Text: string; (empty) Memo TDBMemoBuf, TMemoBuf This property will set the memo buffer to a string assigned to it. If this property is referenced, the first 255 characters (unless Delphi 2.0 is being used) of the memo buffer (or the size of the memo buffer, whichever is less) will be returned. SetData

Example (Delphi)
MemoBuf1.Text := New text assigned into MemoBuf1;

Example (C++ Builder)


MemoBuf1->Text = New text assigned into MemoBuf1;

276

TextBKMode property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property TextBKMode: TBKMode; bkTransparent Graphics TReportFiler, TReportPrinter This property will define the current text background mode as either bkTransparent, where text will print on top of graphics without erasing the background, or as bkOpaque, where text will print on top of graphics after the background is cleared. NOTE: Not all printer drivers support opaque text, especially PCL5 laserjet drivers. For these printers try setting graphics mode to Raster instead of HP/GL2 inside the printer setup window and opaque text printing may work. BKColor

Example (Delphi)
ReportPrinter1.TextBKMode := bkOpaque;

Example (C++ Builder)


ReportPrinter1->TextBKMode = bkOpaque;

TextJustify property
Declaration: Default: Category: Components: Description:

( read/write )

See Also:

property TextJustify: TPrintJustify pjCenter Bar Code TRPBarsBase Determines how the readable text is justified in relation to the bar code. pjLeft Left justify the text portion pjCenter Center justify the text portion pjRight Right justify the text portion PrintReadable, PrintTop, Text

277

TextRect method
Declaration: Category: Components: Description: See Also:
var

procedure TextRect(

Rect: TRect; X,Y: double; const Text: string);

Graphics TReportFiler, TReportPrinter This method will draw Text clipped within the rectangle defined by Rect. The point (X,Y) defines the starting point of the text. Use CreateRect to initialize Rect. CreateRect, All print methods, TRect
TRect; double; double; string;

Example (Delphi)
TxtRect: TxtXPos: TxtYPos: Txt:

begin TxtRect := CreateRect(1.00,1.00,3.00,3.00); TxtXPos := 0.95; TxtYPos := 0.95; Txt := 'Text is clipped off!'; TextRect(TxtRect, TxtXPos, TxtYPos, Txt); end;

Example (C++ Builder)


TRect TxtRect; double TxtXPos; double TxtYPos; AnsiString Txt; TxtRect = rp->CreateRect(1.00,1.00,3.00,3.00); TxtXPos = 0.95; TxtYPos = 0.95; Txt = Text is clipped off!; rp->TextRect(TxtRect, TxtXPos, TxtYPos, Txt);

TextWidth method
Declaration: Category: Components: Description: function TextWidth(Text: string): double; Position TReportFiler, TReportPrinter This method will return the length of the string, Text.

Example (Delphi)
var TxtLen: double; begin TxtLen := TextWidth( How long am I? ); end;

Example (C++ Builder) double TxtLen = rp->TextWidth(How long am I?);

278

TFontAlign
Declaration: Category: Components: Description: TFontAlign = (faBaseline, faTop, faBottom); Font TReportFiler, TReportPrinter faBaseline: This setting will align the font at the baseline of the font. faTop: This setting will align the font at the top of the line. faBottom: This setting will align the font at the bottom of the line. See Also: FontAlign Example:See FontAlign

type

Title property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property Title: string; ReportPrinter Report Misc TRPHTMLFiler, TReportFiler, TReportPrinter This property defines the title for the current print job that will be displayed in the Windows Print Manager. (16 bit is limited to 31 characters). This code causes the text Sales Report to show as the print job name in the print manager. Example (Delphi)
ReportPrinter1.Title := Sales Report;

Example (C++ Builder)


ReportPrinter1->Title = Sales Report;

TitlePreview property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property TitlePreview: TFormatString; Report Preview ReportSystem TReportSystem This property defines the caption that will be used for the ReportSystem report preview form. TitleStatus, TitleSetup

TitleSetup property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property TitleSetup: TFormatString; Report Setup ReportSystem TReportSystem This property defines the caption that will be used for the ReportSystem report setup form. TitleStatus, TitlePreview

279

TitleStatus property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property TitleStatus: TFormatString; Report Status ReportSystem TReportSystem This property defines the caption that will be used for the ReportSystem report status form. TitleSetup, TitlePreview

TLineHeightMethod
Declaration: Category: Components: Description:

type

TLineHeightMethod = (lhmLinesPerInch, lhmFont); Position TReportFiler, TReportPrinter lhmLinesPerInch: This setting will cause the number of lines to be fit per inch. lhmFont: This setting will cause the line to adjust to the font size. lhmUser: This setting will allow the user to define LineHeight directly. See Also: LineHeightMethod, LineHeight Example:See LineHeightMethod

280

TMacroID
TMacroID = (midCurrDateShort, midCurrDateLong, midCurrDateUS, midCurrDateInter, midCurrTimeShort, midCurrTimeLong, midCurrTimeAMPM, midCurrTime24, midFirstPage, midLastPage, midTotalPages, midCurrentPage, midPrinterName, midDriverName, midPortName, midUser01..midUser20); Category: Printing Components: TReportFiler, TReportPrinter Description: midCurrDateShort: Returns the short date format midCurrDateLong: Returns the long date format midCurrDateUS: Returns the date as MM/DD/YY midCurrDateInter: Returns the date as DD/MM/YY midCurrTimeShort: Returns the short time format midCurrTimeLong: Returns the long time format midCurrTimeAMPM: Returns the time in am/pm format midCurrTime24: Returns the time in 24 hour format midFirstPage: Returns the first page number midLastPage: Returns the last page number midTotalPages: Returns the total number of pages midCurrentPage: Returns the current page number midPrinterName: Returns the printer name midDriverName: Returns the driver name midPortName: Returns the port name midUser01 through midUser20: Returns the nth entry from MacroData See Also: MacroID, MacroData Example:See MacroID Declaration:

type

TMarginMethod
Declaration: Category: Components: Description:

type

TMarginMethod = (mmScaled, mmFixed); Preview TFilePreview mmScaled: This setting will cause the margin on the preview screen to be scaled according to MarginPercent. mmFixed: Margins will not change in the preview screen. See Also: MarginMethod, MarginPercent Example:See MarginMethod

281

Top property
Declaration: Category: Components: Description: See Also:

{Bar Code}

(read/write)

property Top: double; Bar Code TRPBarsBase Sets or returns the position for the top edge of the bar code. The value for this property includes the readable text, if it is printed. BarTop, PrintReadable, PrintTop

Example (Delphi)
{ Print the bar code so the top is 3.5 inches down } BarCode1.Top := 3.5;

Example (C++ Builder)


// Print the bar code so the top is 3.5 inches down BarCode1->Top = 3.5;

Top property
Declaration: Default: Category: Components: See:

{ReportSection}

(read/write/pub)

property Top: double; 0.0 ReportSection TReportSection Bottom (for description and example), Left, Right, TopMethod

TopBorder property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property TopBorder: Double; 0 Position TTextFiler Sets the waste area for the top edge of the page. For dot-matrix printers, this value should normally be 0 and for laser or inkjet printers, the value should equal or greater than the top waste width. LeftBorder, LPI

Example (Delphi)
TextFiler1.TopBorder := 0.25;

Example (C++ Builder)


TextFiler1->TopBorder = 0.25;

TopMethod property
Declaration: Default: Category: Components: See:

{ReportSection}

(read/write/pub)

property TopMethod: TDistanceMethod; dmSpecial (all others are dmMargin ReportSection TReportSection BottomMethod (for description and example), Left

282

TopWaste property
Declaration: Category: Components: Description: See Also: Example:

(read only)

property TopWaste: double; Printer TReportFiler, TReportPrinter This property returns the waste area on the top side of the page that the printer cannot print into. It is a good idea to make sure that the reports margins are greater than or equal to its waste areas. BottomWaste , LeftWaste , MarginTop ,RightWaste See LeftWaste

TOrientation
Declaration: Category: Components: Description:

type

TOrientation = (poPortrait, poLandscape, poDefault); Control TReportFiler, TReportPrinter poPortrait: Portrait mode. poLandscape: Landscape mode. poDefault: Default mode on the current printer. See Also: Orientation Example:See Orientation example

TotalPasses property
Declaration: Category: Components: Description: See Also:

(read/write)

property TotalPasses: Integer; Misc TReportFiler, TReportPrinter This is the value that will be returned when a %s is encountered in a StatusFormat string. CurrentPass, StatusFormat, StatusLabel, StatusText, UpdateStatus

Example (Delphi)
ReportPrinter1.StatusFormat := 'Printing page %p (Pass %c of %s)';

Example (C++ Builder)


ReportPrinter1->StatusFormat = Printing page %p (Pass %c of %s);

Totals property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Totals: boolean; false TablePrinter TTableColumn, TDBTableColumn This property determines whether or not a table column will keep totals. GrandTotal, PageTotal, SubTotal

283

TOutputType
TOutputType = (otText, otHeadings, otPageTotals, otSubTotals, otGrandTotals); Category: TablePrinter Components: TTableSection Description: otText: Text will be used for the output otHeadings: The table column headers will be printed otPageTotals: The table column page totals will be printed otSubTotals: The table column subtotals will be printed otGrandTotals: The table column grand totals will be printed See Also: OutputType Example:See OutPutType Declaration:

type

TOverflowMethod
TOverflowMethod = (omTruncateWord, omTruncateChar, omReplace, omWrap, omShrink); Category: TablePrinter Components: TTableColumn, TDBTableColumn, TTableSection Description: omTruncateWord: The text will be truncated at the nearest word omTruncateChar: The text will be truncated omReplace: The text will be replaced with OverflowReplace omWrap: The text will be word wrapped omShrink: The font will be shrunk until it fits See Also: OverflowMethod, OverflowReplace, OverflowAppend, MinFontSize Example:See OverflowMethod Declaration:

type

TPrintJustify
Declaration: Category: Components: Description:

type

TPrintJustify = (pjCenter, pjLeft, pjRight, pjBlock); Printing TReportFiler, TReportPrinter, TTableColumn, TDBTableColumn, TTableSection pjCenter: Center justify pjLeft: Justify to the left pjRight: Justify to the right pjBlock: Block (full) justify See Also: Justify, PrintFooter, PrintHeader, SetTab Example:See SetTab

284

TPrintJustifyVert
TPrintJustifyVert = (pjTop, pjMiddle, pjBottom); Printing TTableColumn, TDBTableColumn, TTableSection pjTop: Justify at the top of the row box pjMiddle: Justify by the middle of the row box pjBottom: Justify by the bottom of the row box See Also: JustifyVert Example:See JustifyVert Declaration: Category: Components: Description:

type

TPrintUnits
Declaration: Category: Components: Description:

type

TPrintUnits = (unInch, unMM, unCM, unPoint, unUser); Units TReportFiler, TReportPrinter unInch: This setting will set the units to inches. unMM: This setting will set the units to millimeters. unCM: This setting will set the units to centimeters. unPoint: This setting will set the units to pixels. unUser: This setting will set the units to a scale provided by the user. See Also: Units Example:See Units

TransparentBitmaps property
Declaration: Default: Category: Components: Description:

(read/write)

See Also:

property TransparentBitmaps: boolean; false Graphics TReportFiler, TReportPrinter This property will control the mode that PrintBitmap and PrintBitmapRect use to draw bitmaps. A value of true will cause bitmaps to be combined (using the AND operator) with the current page contents while a value of false will replace the page contents with the bitmap. PrintBitmap, PrintBitmapRect

Example (Delphi)
TransparentBitmaps := true;

Example (C++ Builder)


TransparentBitmaps = true;

285

TReportDest
Declaration: Category: Components: Description: See Also: Example: TReportDest = (rdPreview, rdPrinter, rdFile); TablePrinter TReportSystem rdPreview: This setting will send the report to the preview screen. rdPrinter: This setting will send the report to the printer. rdFile: This setting will send the report to a file. DefaultDest See DefaultDest

type

TruncateText method
Declaration: Category: Components: Description: See Also: function TruncateText(Value: String; Width: Double): String; Printing TReportFiler, TReportPrinter This property calculates the width of the string Value using the current font. If the text is wider than the Width parameter then it will be truncated by characters to fit. PrintTab, SetFont

Example (Delphi)
ReportPrinter1.SetFont( Arial, 14 ); TruncateText(This text is too long to fit within 2 inches, 2.0);

Example (C++ Builder)


ReportPrinter1->SetFont( Arial, 14 ); TruncateText(This text is too long to fit within 2 inches, 2.0);

TStreamMode
Declaration: Category: Components: Description:

type

See Also: Example:

TStreamMode = (smMemory, smTempFile, smFile, smUser); Control TReportFiler, TFilePrinter, TFilePreview smMemory: This setting will use a memory stream for input and output. smFile: This setting will use a file for input and output. smTempFile will send the ouput to a temporary file in the \Windows\Temp directory. This filename used by smTempFile is created by the TReportSystem component and will be deleted when it is finished. If this stream mode is used with a custom preview system utilizing TReportFiler, TFilePrinter and TFilePreview components, the generated FileName property from the TReportFiler component must be transferred to the TFilePrinter and TFilePreview components. smUser: This setting will use stream defined by user for input and output. StreamMode, Stream See StreamMode

286

TSystemOption TSystemOptions
Declaration: Category: Components: Description: See Also: Example:

type type

TSystemOption = (soUseFiler, soWaitForOK, soShowStatus, soAllowPrintFromPreview, soPreviewModal); TSystemOptions = Set of TSystemOption; ReportSystem TReportSystem See SystemOptions SystemOptions See SystemOptions

TSystemSetup TSystemSetups
Declaration:

type type

TSystemSetup = (ssAllowSetup, ssAllowCopies, ssAllowCollate, ssAllowDuplex, ssAllowDestPreview, ssAllowDestPrinter, ssAllowDestFile, ssAllowPrinterSetup); TSystemSetups = Set of TSystemSetup; Category: ReportSystem Components: TReportSystem Description: ssAllowSetup: If false, the setup screen will not be displayed. ssAllowCopies: If false, the user will not be able to change the copies. ssAllowCollate: If false, the user will not be able to change the collation mode. ssAllowDuplex: If false, the user will not be able to change the duplex mode. ssAllowDestPreview: If false, the user will not be able to select the preview screen as the report destination. ssAllowDestPrinter: If false, the user will not be able to select the printer as the report destination. ssAllowDestFile: If false, the user will not be able to select a disk file as the report destination. ssAllowPrinterSetup: If false, the user will not be able to select the printer setup dialog. See Also: SystemSetups Example:See SystemSetups

287

TTabJustify
Declaration: TTabJustify = (tjCenter, tjLeft, tjRight, tjBlock, tjNone); Category: Tabs Components: TReportFiler, TReportPrinter Description: tjCenter: This setting will center justify tabs tjLeft: This setting will left justify tabs tjRight: This setting will right justify tabs tjBlock: This setting will block justify tabs tjNone: This setting will disable justification override See Also: TabJustify Example:See TabJustify

type

Underline property
Declaration: Default: Category: Components: Description: See Also:

(read/write)

property Underline: boolean; false Font TReportFiler, TReportPrinter This property returns or sets the underline attribute for the current font. Bold, Italic, Strikeout

Example (Delphi)
With ReportPrinter1 do begin Underline := true; Print( Underlined text ); Underline := false; end; { with }

Example (C++ Builder)


rp->Underline = true; rp->Print( Underlined text ); rp->Underline = false;

Units property
Declaration: Default: Category: Components: Description:

(read/write/pub)

See Also:

property Units: TPrintUnits; unInch Units TReportFiler, TReportPrinter This property sets the current units mode to one of the following values: unInch, unMM, unCM, unPoint and unUser. If the setting is unUser then the units factor is determined by the value in UnitsFactor. UnitsFactor

Example (Delphi)
ReportPrinter1.Units := unInch;

Example (C++ Builder)


ReportPrinter1->Units = unInch;

288

UnitsFactor property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property UnitsFactor: double; 1.0 Units TReportFiler, TReportPrinter This property returns or sets the current conversion factor necessary to convert units to inches. Its value should equal the number of units that equal an inch. (unCM = 2.54 since 2.54 centimeters equal an inch) Units

Example (Delphi)
{ 300 DPI conversion } ReportPrinter1.Units := unUser; ReportPrinter1.UnitsFactor := 300; ReportPrinter1.PrintXY( 300, 600, Text at 1, 2 );

Example (C++ Builder)


// 300 DPI conversion ReportPrinter1->Units = unUser; ReportPrinter1->UnitsFactor = 300; ReportPrinter1->PrintXY( 300, 600, Text at 1\, 2\ );

UnregisterGraphic method
Declaration: Category: Components: Description: procedure UnregisterGraphic( index: integer ); Graphics TReportFiler, TReportPrinter This method will help manage repeating, large bitmaps in a print job. This method is used to insure that the index used by RegisterGraphic is clear. You must call this method if you have previously registered a graphic in that index. However, it is safe and recommended to always call UnregisterGraphic before using these graphic index methods. RegisterGraphic, ReuseGraphic See RegisterGraphic

See Also: Example:

289

UpdateStatus method
Declaration: Category: Components: Description: See Also: Example procedure UpdateStatus; Misc TReportFiler, TReportPrinter This method will update the label defined by StatusLabel with the current information defined by the report status or the items contained in StatusText. StatusLabel, StatusText After report execution, depending on whether the user aborted the reports creation or not, the status bar is updated with the appropriate message.

Example (Delphi)
If Aborted then begin StatusFormat := #13'Report Canceled!'; UpdateStatus; end else begin StatusFormat := #13'Report Completed!'; UpdateStatus; end; { else }

Example (C++ Builder)


if (rp->Aborted) { rp->StatusFormat = \nReport Canceled!; rp->UpdateStatus(); } else { rp->StatusFormat = \nReport Completed!; rp->UpdateStatus(); }// else

UseChecksum property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property UseChecksum: boolean False (Code128 := true) Bar Code TRPBarsBase Specifies whether a checksum character should be included in the bar code. BarHeight, BarWidth, PrintReadable, Text, Width

UseParentFont property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property UseParentFont: boolean; true TablePrinter TTableColumn, TDBTableColumn, TTableSection This property, if true will use the table printer font instead of the table column or table section font settings Font

Example (Delphi)
TableColumn.UseParentFont := false;

290

Example (C++ Builder)


TableColumn->UseParentFont = false;

UseParentPen property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property UseParentPen: boolean; true TablePrinter TTableColumn, TDBTableColumn, TTableSection This property, if true will use the table printer pen instead of the table column or table section pen settings Pen

Example (Delphi)
TableSection.UseParentPen := false;

Example (C++ Builder)


TableSection->UseParentPen = false;

UseSetRange property
Declaration: Default: Category: Components: Description:

(read/write/pub)

property UseSetRange: boolean; false Rave TRPTableConnection This property will determine whether filters are handled by the TTable.Filter property or the TTable.SetRange method.

Version property
Declaration: Components: Description: property Version: String; All Returns the current release version of ReportPrinter Pro.

(read/write/pub)

WideFactor property
Declaration: Default: Category: Components: Description: See Also:

( read/write )

property WideFactor: double 3.0 Bar Code TRPBarsBase The wide factor is the ratio of the wide bar to the narrow bar width. BarHeight, Bar Width, Width

Example (Delphi)
WideFactor := 2.5; {set wide to narrow bar ratio to be 2.5}

Example (C++ Builder)


WideFactor = 2.5; //set wide to narrow bar ratio to be 2.5

291

Width property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property Width: double; 1.0 TablePrinter TTableColumn, TDBTableColumn, TTableSection This property defines the width, in units, of the table section or table column. StartPos

Example (Delphi)
TableColumn.Width := 2.5;

Example (C++ Builder)


TableColumn->Width = 2.5;

Width property
Declaration: Category: Components: Description: See Also:

{Bar Code}

(read only)

property Width: double; Bar Code TRPBarsBase This property will return the calculated width of the entire bar code for the current value of Text. BarWidth, Text, WideFactor

Example (Delphi)
Var BarCodeWidth: double; BarCode1.Text := ABC123; BarCodeWidth := BarCode1.Width; { Get width of bar code for ABC123 }

Example (C++ Builder)


double BarCodeWidth; BarCode1->Text = ABC123; BarCodeWidth = BarCode1->Width; // Get width of bar code for ABC123

WriteBCDData method
Declaration: Category: Components: Description:

{Rave}

Tutorial: See Also:

function WriteBCDData(FormatData: String; NativeData: Currency): String; Rave Any Data Connection Component This method writes the contents of a custom BCD field (of type dtBCD) inside of the OnGetRow event of a data connection component. The data for custom fields must be written in the same order as the fields were defined in the OnGetCols event. FormatData parameter defines the formatted value of the field, but can be blank if no pre-formatted output is needed. NativeData parameter should contain the unmodified contents of the field See tutorial 26 (customizing data connections) for more information. OnGetCols, OnGetRow, other WriteXxxxData methods

Example (Delphi)
Connection.WriteBCDData( ,InvoiceAmount );

292

Example (C++ Builder)


Connection->WriteBCDData( ,InvoiceAmount );

WriteBlobData method
Declaration: Category: Components: Description:

{Rave}

Tutorial: See Also:

function WriteBlobData(var: Buffer; Len: Longint): String; Rave Any Data Connection Component This method writes the contents of a custom blob field (of type dtBlob / dtGraphic / dtMemo ) inside of the OnGetRow event of a data connection component. The data for custom fields must be written in the same order as the fields were defined in the OnGetCols event. See tutorial 26 (customizing data connections) for more information. OnGetCols, OnGetRow, other WriteXxxxData methods

Example (Delphi)
Connection.WriteBlobData( ,CustomerPict );

Example (C++ Builder)


Connection->WriteBlobData( ,CustomerPict );

WriteBoolData method
Declaration: Category: Components: Description:

{Rave}

Tutorial: See Also:

function WriteBoolData(FormatData: String; NativeData: Boolean): String; Rave Any Data Connection Component This method writes the contents of a custom boolean field (of type dtBoolean) inside of the OnGetRow event of a data connection component. The data for custom fields must be written in the same order as the fields were defined in the OnGetCols event. FormatData parameter defines the formatted value of the field, but can be blank if no pre-formatted output is needed. NativeData parameter should contain the unmodified contents of the field See tutorial 26 (customizing data connections) for more information. OnGetCols, OnGetRow, other WriteXxxxData methods

Example (Delphi)
Connection.WriteBoolData( ,CustomerActive );

Example (C++ Builder)


Connection->WriteBoolData( ,CustomerActive );

293

WriteCurrData method
Declaration: Category: Components: Description:

{Rave}

Tutorial: See Also:

function WriteCurrData(FormatData: String; NativeData: Currency): String; Rave Any Data Connection Component This method writes the contents of a custom Currency field (of type dtFloat) inside of the OnGetRow event of a data connection component. The data for custom fields must be written in the same order as the fields were defined in the OnGetCols event. FormatData parameter defines the formatted value of the field, but can be blank if no pre-formatted output is needed. NativeData parameter should contain the unmodified contents of the field See tutorial 26 (customizing data connections) for more information. OnGetCols, OnGetRow, other WriteXxxxData methods

Example (Delphi)
Connection.WriteCurrData( ,InvoiceAmount );

Example (C++ Builder)


Connection->WriteCurrData( ,InvoiceAmount );

WriteDateTime method
Declaration: Category: Components: Description:

{Rave}

Tutorial: See Also:

function WriteDateTime(FormatData: String; NativeData: TDateTime); Rave Any Data Connection Component This method writes the contents of a custom DateTime field (of type dtDate / dtTime / dtDateTime) inside of the OnGetRow event of a data connection component. The data for custom fields must be written in the same order as the fields were defined in the OnGetCols event. FormatData parameter defines the formatted value of the field, but can be blank if no pre-formatted output is needed. NativeData parameter should contain the unmodified contents of the field See tutorial 26 (customizing data connections) for more information. OnGetCols, OnGetRow, other WriteXxxxData methods

Example (Delphi)
Connection.WriteDateTime( ,Now );

Example (C++ Builder)


Connection->WriteDateTime( ,Now );

294

WriteFloatData method
Declaration: Category: Components: Description:

{Rave}

Tutorial: See Also:

function WriteFloatData(FormatData: String; NativeData: Extended): String; Rave Any Data Connection Component This method writes the contents of a custom BCD field (of type dtFloat) inside of the OnGetRow event of a data connection component. The data for custom fields must be written in the same order as the fields were defined in the OnGetCols event. FormatData parameter defines the formatted value of the field, but can be blank if no pre-formatted output is needed. NativeData parameter should contain the unmodified contents of the field See tutorial 26 (customizing data connections) for more information. OnGetCols, OnGetRow, other WriteXxxxData methods

Example (Delphi)
Connection.WriteFloatData( ,CustomerBudget );

Example (C++ Builder)


Connection->WriteFloatData( ,CustomerBudget );

WriteIntData method
Declaration: Category: Components: Description:

{Rave}

Tutorial: See Also:

function WriteIntData(FormatData: String; NativeData: Integer): String; Rave Any Data Connection Component This method writes the contents of a custom integer field (of type dtInteger) inside of the OnGetRow event of a data connection component. The data for custom fields must be written in the same order as the fields were defined in the OnGetCols event. FormatData parameter defines the formatted value of the field, but can be blank if no pre-formatted output is needed. NativeData parameter should contain the unmodified contents of the field See tutorial 26 (customizing data connections) for more information. OnGetCols, OnGetRow, other WriteXxxxData methods

Example (Delphi)
Connection.WriteIntData( ,CustomerCount );

Example (C++ Builder)


Connection->WriteIntData( ,CustomerCount );

295

WriteNullData method
Declaration: Category: Components: Description: Tutorial: See Also:

{Rave}

function WriteNullData( no parameters ); Rave Any Data Connection Component This method writes a null inside of the OnGetRow event of a data connection component. The data for custom fields must be written in the same order as the fields were defined in the OnGetCols event. See tutorial 26 (customizing data connections) for more information. OnGetCols, OnGetRow, other WriteXxxxData methods

Example (Delphi)
Connection.WriteNullData( );

Example (C++ Builder)


Connection->WriteNullData( );

WriteStrData method
Declaration: Category: Components: Description:

{Rave}

Tutorial: See Also:

function WriteStrData(FormatData: String; NativeData: String): String; Rave Any Data Connection Component This method writes the contents of a custom String field (of type dtStriing) inside of the OnGetRow event of a data connection component. The data for custom fields must be written in the same order as the fields were defined in the OnGetCols event. FormatData parameter defines the formatted value of the field, but can be blank if no pre-formatted output is needed. NativeData parameter should contain the unmodified contents of the field See tutorial 26 (customizing data connections) for more information. OnGetCols, OnGetRow, other WriteXxxxData methods

Example (Delphi)
Connection.WriteStrData( ,CustomerName );

Example (C++ Builder)


Connection->WriteStrData( ,CustomerName );

XD2I method
Declaration: Category: Components: Description: See Also: function XD2I(Pos: longint): double; Units TFilePrinter, TFilePreview This method will convert horizontal printer canvas measurements (dots) to inch measurements. All other units conversion functions

Example (Delphi)
{ With Units currently set to unInch } XPos := ReportPrinter1.XD2I( LastXDots );

296

Example (C++ Builder)


// With Units currently set to unInch XPos = ReportPrinter1->XD2I( LastXDots );

XD2U method
Declaration: Category: Components: Description: See Also: function XD2U(Pos: longint): double; Units TReportFiler, TReportPrinter This method will convert horizontal printer canvas measurements (dots) to unit measurements (defined by Units and UnitsFactor). Units, UnitsFactor, All other units conversion functions

Example (Delphi)
XPos := ReportPrinter1.XD2U( LastXDots );

Example (C++ Builder)


XPos = ReportPrinter1->XD2U( LastXDots );

XDPI property
Declaration: Category: Components: Description:

(read only)

property XDPI: integer; Printer TReportFiler, TReportPrinter This property returns the horizontal dots per inch for the current printer.

Example (Delphi)
CurrXDPI := ReportPrinter1.XDPI;

Example (C++ Builder)


CurrXDPI = ReportPrinter1->XDPI;

XI2D method
Declaration: Category: Components: Description: See Also: function XI2D(Pos: double): longint; Units TReportFiler, TReportPrinter This method will convert horizontal inch measurements to printer canvas measurements (dots). All other units conversion functions

Example (Delphi)
{ With Units currently set to unInch } CurrXDots := ReportPrinter1.XI2D( ReportPrinter1.XPos );

Example (C++ Builder)


// With Units currently set to unInch CurrXDots = ReportPrinter1->XI2D( ReportPrinter1->XPos );

297

XI2U method
Declaration: Category: Components: Description: See Also: function XI2U(Pos: double): double; Units TReportFiler, TReportPrinter This method will convert horizontal inch measurements to unit measurements (defined by Units and UnitsFactor). Units, UnitsFactor, All other units conversion functions

Example (Delphi)
XPos := ReportPrinter1.XI2U( LastXInch );

Example (C++ Builder)


XPos = ReportPrinter1->XI2U( LastXInch );

XPos property
Declaration: Default: Category: Components: Description: See Also: property XPos: double; 0,0 Position TReportFiler, TReportPrinter This property sets or returns the horizontal text cursor position. CursorXPos, CursorYPos, YPos

(read/write)

Example (Delphi)
XPos := 0.45; YPos := 0.95; Print('Text at ( 0.45, 0.95 )');

Example (C++ Builder)


rp->XPos = 0.45; rp->YPos = 0.95; rp->Print(Text at ( 0.45, 0.95 ));

XU2D method
Declaration: Category: Components: Description: See Also: function XU2D(Pos: double): longint; Units TReportFiler, TReportPrinter This method will convert horizontal unit measurements (defined by Units and UnitsFactor) to printer canvas measurements (dots). Units, UnitsFactor, All other units conversion functions

Example (Delphi)
CurrXDots := ReportPrinter1.XU2D( ReportPrinter1.XPos );

Example (C++ Builder)


CurrXDots = ReportPrinter1->XU2D(ReportPrinter1->XPos );

298

XU2I method
Declaration: Category: Components: Description: See Also: function XU2I(Pos: double): double; Units TReportFiler, TReportPrinter This method will convert horizontal unit measurements (defined by Units and UnitsFactor) to inch measurements. Units, UnitsFactor, All other units conversion functions

Example (Delphi)
{ With units set to unCM } CurrXInch := ReportPrinter1.XU2I( ReportPrinter1.XPos );

Example (C++ Builder)


// With units set to unCM CurrXInch = ReportPrinter1->XU2I( ReportPrinter1->XPos );

YD2I method
Declaration: Category: Components: Description: See Also: function YD2I(Pos: longint): double; Units TFilePrinter, TFilePreview This method will convert vertical printer canvas measurements (dots) to inch measurements. All other units conversion functions

Example (Delphi)
{ With Units currently set to unInch } YPos := ReportPrinter1.YD2I( LastYDots );

Example (C++ Builder)


// With Units currently set to unInch YPos = ReportPrinter1->YD2I( LastYDots );

YD2U method
Declaration: Category: Components: Description: See Also: function YD2U(Pos: longint): double; Units TReportFiler, TReportPrinter This method will convert vertical printer canvas measurements (dots) to unit measurements (defined by Units and UnitsFactor). Units, UnitsFactor, All other units conversion functions

Example (Delphi)
ReportPrinter1.YPos = ReportPrinter1.YD2U( LastYDots );

Example (C++ Builder)


ReportPrinter1->YPos = ReportPrinter1->YD2U( LastYDots );

299

YDPI property
Declaration: Category: Components: Description: See Also:

(read only)

property YDPI: integer; Printer TReportFiler, TReportPrinter This property returns the vertical dots per inch for the current printer. All other units conversion functions

Example (Delphi)
CurrYDPI := ReportPrinter1.YDPI;

Example (C++ Builder)


CurrYDPI = ReportPrinter1->YDPI;

YI2D method
Declaration: Category: Components: Description: See Also: function YI2D(Pos: double): longint; Units TReportFiler, TReportPrinter This method will convert vertical inch measurements to printer canvas measurements (dots). All other units conversion functions

Example (Delphi)
{ With Units currently set to unInch } CurrYDots := ReportPrinter1.YI2D( YPos );

Example (C++ Builder)


// With Units currently set to unInch CurrYDots = ReportPrinter1->YI2D( ReportPrinter1->YPos );

YI2U method
Declaration: Category: Components: Description: See Also: function YI2U(Pos: double): double; Units TReportFiler, TReportPrinter This method will convert vertical inch measurements to unit measurements (defined by Units and UnitsFactor). Units, UnitsFactor, All other units conversion functions

Example (Delphi)
ReportPrinter1.YPos := ReportPrinter1.YI2U( LastYInch );

Example (C++ Builder)


ReportPrinter1->YPos = ReportPrinter1->YI2U( LastYInch );

300

YPos property
Declaration: Default: Category: Components: Description: See Also: property YPos: double; 0,0 Position TReportFiler, TReportPrinter This property sets or returns the vertical text cursor position. CursorXPos, CursorYPos, XPos

(read/write)

Example (Delphi)
XPos := 0.45; YPos := 0.95; Print('Text at ( 0.45, 0.95 )');

Example (C++ Builder)


rp->XPos = 0.45; rp->YPos = 0.95; rp->Print(Text at ( 0.45, 0.95 ));

YU2D method
Declaration: Category: Components: Description: See Also: function YU2D(Pos: double): longint; Units TReportFiler, TReportPrinter This method will convert vertical unit measurements (defined by Units and UnitsFactor) to printer canvas measurements (dots). Units, UnitsFactor, All other units conversion functions

Example (Delphi)
CurrYDots := ReportPrinter1.YU2D( ReportPrinter1.YPos );

Example (C++ Builder)


CurrYDots = ReportPrinter1->YU2D( ReportPrinter1->YPos );

YU2I method
Declaration: Category: Components: Description: See Also: function YU2I(Pos: double): double; Units TReportFiler, TReportPrinter This method will convert vertical unit measurements (defined by Units and UnitsFactor) to inch measurements. Units, UnitsFactor, All other units conversion functions

Example (Delphi)
{ With units set to unCM } CurrYInch := ReportPrinter1.YU2I( ReportPrinter1.YPos );

Example (C++ Builder)


// With units set to unCM CurrYInch = ReportPrinter1->YU2I( ReportPrinter1->YPos );

301

ZoomFactor property
Declaration: Default: Category: Components: Description: See Also:

(read/write/pub)

property ZoomFactor: double; 100.0 Preview TFilePreview This property defines the current zoom percent. A value of 100.0 is normal size, 200.0 is double normal size and 50.0 is half size. ZoomIn, ZoomOut

Example (Delphi) This code updates the text in a field where the ZoomFactor can be edited by the user. It would be important to keep these well synchronized if more than one event can change this property.
var S1: string[10]; begin Str(FilePreview1.ZoomFactor:1:1,S1); ZoomEdit.Text := S1; FilePreview1.RedrawPage; end;

Example (C++ Builder)


AnsiString S1; S1 = FloatToStrF(FilePreview1->ZoomFactor, ffGeneral,1,1); ZoomEdit->Text = S1; FilePreview1->RedrawPage();

ZoomIn method
Declaration: Category: Components: Description: procedure ZoomIn; Preview TFilePreview This method will add ZoomInc to the current ZoomFactor and will make the image larger on the screen. If an OnZoomChange event handler is defined, then that event handler will be called and is responsible for redrawing the page otherwise the page is redrawn. ZoomOut, ZoomInc, ZoomFactor, OnZoomChange { This code causes the ZoomFactor to be incremented by ZoomInc percent. }

See Also: Example

Example (Delphi)
FilePreview1.ZoomIn;

Example (C++ Builder)


FilePreview1->ZoomIn();

302

ZoomInc property
Declaration: Default: Category: Components: Description: See Also: Example

(read/write/pub)

property ZoomInc: integer; 10 Preview TFilePreview This property defines the amount that ZoomIn and ZoomOut modifies ZoomFactor. ZoomFactor, ZoomIn, ZoomOut This code causes the ZoomFactor property to be incremented by 10% when ZoomIn and ZoomOut are called.

Example (Delphi)
FilePreview1.ZoomInc := 10;

Example (C++ Builder)


FilePreview1->ZoomInc = 10;

ZoomOut method
Declaration: Category: Components: Description: procedure ZoomOut; Preview TFilePreview This method will subtract ZoomInc from the current ZoomFactor and will make the image smaller on the screen. If an OnZoomChange event handler is defined, then that event handler will be called and is responsible for redrawing the page, otherwise the page is redrawn. ZoomIn, ZoomInc, ZoomFactor, OnZoomChange

See Also:

Example (Delphi)
FilePreview1.ZoomOut;

Example (C++ Builder)


FilePreview1->ZoomOut();

ZoomPageFactor property
Declaration: Category: Components: Description:

(read only)

See Also: Example

property ZoomPageFactor: double; Preview TFilePreview This property will return the zoom factor that will zoom the current page so that the entire page is visible. This value can then be assigned to ZoomFactor. You should consider the extra width used by a shadow if you have assigned a value to the ShadowDepth preview property. ShadowDepth, ZoomFactor, ZoomPageWidthFactor { use an OnPreviewShow event with the following }

Example (Delphi)
With Sender As TFilePreview do begin ZoomFactor := ZoomPageFactor (ShadowDepth + 5) / 10; end; { with }

303

Example (C++ Builder)


TFilePreview* fp = dynamic_cast<TFilePreview*>(Sender); fp->ZoomFactor = fp->ZoomPageFactor - (fp->ShadowDepth + 5) / 10;

ZoomPageWidthFactor property
Declaration: Category: Components: Description:

(read only)

See Also: Example

property ZoomPageWidthFactor: double; Preview TFilePreview This property will return the zoom factor that will zoom the current page so that the entire page width is visible. This value can then be assigned to ZoomFactor. You should consider the extra width used by a shadow if you have assigned a value to the ShadowDepth preview property. ShadowDepth, ZoomFactor, ZoomPageFactor { use an OnPreviewShow event with the following }

Example (Delphi)
With Sender As TFilePreview do begin ZoomFactor := ZoomPageWidthFactor (ShadowDepth +3) / 10; end; { with }

Example (C++ Builder)


TFilePreview* fp = dynamic_cast<TFilePreview*>(Sender); fp->ZoomFactor = fp->ZoomPageWidthFactor - (fp->ShadowDepth + 3) / 10;

304

Class Tree
TComponent TRPComponent
RPDefine.pas RPBase.pas (Version)

TReportSystem
RPSystem.pas

TRPBaseComponent

TRPHTMLFiler
RPHTFilr.pas

TReportFiler
RPFiler.pas

TTableItem
RPTable.pas

TBaseReport
RPBase.pas

TRTFFiler
RPRTFilr.pas

TTableColumn
RPTabCol.pas RPTable.pas

TTextFiler
RPTxFilr.pas

TDBTableColumn
RPDBTabl.pas

TCanvasReport
RPCanvas.pas

TReportPrinter
RPrinter.pas

TTableSection
RPTabSec.pas RPTable.pas

TFilePrinter
RPFPrint.pas

TFilePreview
RPreview.pas

TTablePrinter
RPTable.pas

TBaseShell
RPShell.pas

TDetailShell
RPShell.pas

TDBTablePrinter
RPDBTabl.pas

TMasterShell
RPShell.pas

TLabelShell
RPLabel.pas

TReportShell
RPShell.pas

305

Class Tree
TClass TRPBarsBase
RPBars.pas

TMemoBuf
RPMemo.pas

TRPBars2of5 TRPBarsCode128

TDBMemoBuf
RPDBUtil.pas

TRPBarsCode39 TRPBarsEAN

TPersistent TReportSection
RPSection.pas

TRPBarsPostNet TRPBarsUPC

CLASS USAGE TBaseReport - This is the base class for all reporting components and contains all reporting code that does not produce any actual output. This class should not be used without subclassing from it. TCanvasReport - This class is the base class for all canvas reporting components and contains code to produce output to a TCanvas object. This class should not be used without subclassing from it.

306

TBaseReport
Unit: Parentage: See Also:

Class

RPBase.pas TRPBaseComponent > TBaseReport TCanvasReport, TFilePreview, TFilePrinter, TRPHTMLFiler, TReportFiler, TReportPrinter, TRTFFiler, TTextFiler

This class is the base for all TBaseReport components.

Methods

Append.......................................................... 85 SetData ....................................................... 250

Properties
BufferInc............................................................ 95 Size ................................................................. 256 Text................................................................. 276

307

TBaseShell
Unit: Parentage: See Also: RPShell.pas TBaseShell TDetailShell, TLabelShell, TmasterShell, TReportShell, TTablePrinter

Class

This class is the base for all TBaseShell components.

Events
No Common Events..............................................

Methods

Execute .......................................................... 122

Properties

Engine............................................................ 121

308

TCanvasReport
Unit: Parentage: See Also: RPCanvas.pas TBaseReport > TCanvasReport TFilePreview, TFilePrinter, TReportPrinter

Class

This class is the base for all TCanvasReport components.

Constants
BoxLineXxxx ..................................................... 93

Events
No Common..........................................................

Properties
No Common..........................................................

Methods

No Common..........................................................

309

TDBMemoBuf
Unit: Parentage: RPDBUtil.pas TClass > TMemoBuf > TDBMemoBuf

Class

This class has all of the functionality of TMemoBuf plus the ability to load data from a TField component.

Methods

Append.............................................................. 85 AppendMemoBuf .............................................. 85 Delete.............................................................. 113 Empty.............................................................. 121 FreeSaved ...................................................... 136 Insert............................................................... 143 InsertMemoBuf................................................ 143 LoadFromFile.................................................. 154 LoadFromStream............................................ 155 ReplaceAll....................................................... 226

Reset .............................................................. 230 RestoreBuffer ................................................. 232 RTFLoadFromFile .......................................... 235 RTFLoadFromStream..................................... 236 SaveBuffer...................................................... 237 SaveToStream................................................ 239 SearchFirst ..................................................... 241 SearchNext..................................................... 242 SetData........................................................... 250

Properties
Buffer ................................................................ 95 BufferInc............................................................ 95 Field ............................................................... 125 Justify.............................................................. 145 MaxSize .......................................................... 161 Memo.............................................................. 162 MemoBuf ....................................................... 162 NoCRLF.......................................................... 167 NoNewLine ..................................................... 167 Pos ................................................................. 204 PrintEnd.......................................................... 210 PrintStart......................................................... 220 Size................................................................. 256 Text................................................................. 276

310

TDBTableColumn
Unit: Parentage: RpDbTabl.pas TTableItem > TTableColumn > TDbTableColumn

Class

This component has no icon and can only be created through the Table Editor. Once created TDBTableColumn components can be selected using the Object Inspector selection combo box or by clicking on the appropriate column in the Table Editor. To access the Table Editor, double-click on a TDBTablePrinter component or right-click on a TDBTablePrinter component and select. 'Table editor. . .'.

Events

OnAddTotal..................... 169 OnFooterAfter ................. 175 OnFooterBefore .............. 176 OnFooterHeight .............. 176 OnFooterPrint ................. 176 OnFooterSetup ............... 176

OnHeaderAfter.................179 OnHeaderHeight..............179 OnHeaderPrint.................179 OnInitMaster ....................179 OnInitPage.......................180 OnInitTable ......................180 PrintBox ...........................207 LookupDataSet ..............156 LookupDisplay...............156 LookupKey .....................156 Margin..............................158 Margin100........................158 MemoBuf .........................162 MinFontSize.....................163 OverflowAppend ..............195 OverflowMethod...............195 OverflowReplace .............196 PageTotal ........................198 Pen ..................................200 TPrintJustify .....................284 TPrintJustifyVert ..............285

OnRowAfter .....................190 OnRowBefore ..................190 OnRowHeight ..................190 OnRowPrint .....................191 OnRowSetup ...................191

Methods

CreateColumn................. 109

PrintDefault

210

Properties
AsFloat.............................. 86 AsInteger........................... 86 BoxLines ........................... 94 DataSet........................... 112 Description ...................... 114 DisplayFormat................. 117 FieldName...................... 125 Font................................. 128 GrandTotal...................... 139 Heading........................... 141 Justify.............................. 145 JustifyVert ....................... 146 ReportPrinter ...................229 ShadeColor......................255 ShadePercent..................255 SplitRow ..........................258 SubTotal ..........................265 TableItem.........................272 TablePrinter .....................272 Totals...............................283 UseParentFont ................290 UseParentPen .................291 Width ...............................292

Types
TBoxLines ....................... 275 TOverFlowMethod .......... 284

311

TDBTablePrinter

Component

Unit: Parentage:

RpDbTabl.pas TBaseShell > TTablePrinter > TDbTablePrinter

This component has the capability to generate table style listings with little to no code required. You can even link multiple table printers together for master-detail relationships to multiple levels. The table printers get their flexibility from two other components, TDBTableColumn and TTableSection. TDBTableColumns are responsible for all the properties and events for a single column of data while the TTableSections are responsible for all headers and footers.

Events

OnGetNextRow............................................... 177 OnInitMaster ................................................... 180

OnInitTable OnValidateRow

180 192

Methods
Create............................................................. 107 Default............................................................. 113 Execute........................................................... 122

Properties
DataSet........................................................... 112 DetailKey........................................................ 115 DetailTablePrinter ........................................... 116 Engine............................................................. 121 Font................................................................. 128 MasterKey...................................................... 160 MasterTablePrinter ......................................... 161 Pen ................................................................. 200 ReprintHeader ................................................ 230 StartPos.......................................................... 260 TableColumn .................................................. 271 TableColumns ................................................ 271 TableSection................................................... 272 TextBKMode................................................... 277

312

TDetailShell

Component

Unit: Parentage:

RPShell.pas TBaseShell > TDetailShell

This component is the simplest of the framework components, so we will start with that. TDetailShell is good for table listing style reports where you still want to code the report, but in a more structured and easier to maintain format. There are 2 main parts to the shell components, the sections and the events.

Events
OnBodyAfter ................................................... 171 OnBodyBefore ................................................ 172 OnBodyFooter................................................. 172 OnBodyHeader ............................................... 172 OnRowAfter .................................................... 189 OnRowBefore ................................................. 190 OnRowPrint .................................................... 190

Methods

Execute ........................................................... 122 PrintBodyFooter .............................................. 207

PrintBodyHeader ............................................ 207 PrintRow ......................................................... 220 SectionBodyHeader........................................ 242 SectionRow .................................................... 246 StartNewPage ................................................ 259

Properties
Engine............................................................. 121 IsNewPage...................................................... 143 IsReprint.......................................................... 144 SectionBodyFooter ......................................... 242

313

TFilePreview

Component

Unit: Parentage:

RpPreview.pas TBaseReport > TCanvasReport > TFilePrinter > TFilePreview

The TFilePreview component is used to send a report file generated from TReportFiler to a preview form. The construction of this form must include a ScrollBox and could include other features such as buttons or spin boxes to control the current page and zoom factor.

Events
OnPageChange ..............183 OnZoomChange.............192 NextPage ........................166 PrevPage ........................204 PrintPage........................218 RedrawPage ...................224 Start.................................259 XD2I.................................296 MarginPercent................160 Monochrome ..................164 PageInc...........................197 Pages ..............................198 ScrollBox........................241 Stream .............................262 TMacroID.........................281 TOrientation.....................283 TPrintJustify.....................284 TPrintUnits.......................285 XD2U...............................297 YD2I.................................299 YD2U...............................299 ZoomIn ...........................302 ZoomOut ........................303

Methods
Clear..................................98 Create ..............................107 Destroy.............................115 Execute............................122 ExecuteCustom................123 Finish ..............................126

Properties
FileName..........................126 GridHoriz.........................140 GridPen ...........................140 GridVert...........................140 IgnoreFileSettings............142 MarginMethod ................159 StreamMode....................263 ZoomFactor....................302 ZoomInc .........................303 ZoomPageFactor ...........303 ZoomPageWidthFactor .304

Types

TAccuracyMethod............274 TBKMode.........................274 TFontAlign........................279 TLineHeightMethod..........280

TransparentBitmaps ........285 TStreamMode..................286 TTabJustify......................288 TMarginMethod..............281

314

TFilePrinter

Component

Unit: Parentage:

RPFPrint.pas TBaseReport > TCanvasReport > TFilePrinter

The TFilePrinter component is used to send a report file previously generated from TReportFiler to the printer. To print a report with TFilePrinter, place the component on a form. Then initialize the FileName property for the report file to print. To print the report file, simply call the Execute method. You can also call ExecuteCustom to print a portion of the report file or to change the number of copies.

Methods

Create ............................................................. 107 Destroy............................................................ 115 Execute ........................................................... 122 ExecuteCustom............................................... 123

XD2I................................................................ 296 XD2U .............................................................. 297 YD2I................................................................ 299 YD2U .............................................................. 299 Stream ............................................................ 262 StreamMode ................................................... 263 TPrintJustify.................................................... 284 TPrintUnits...................................................... 285 TransparentBitmaps ....................................... 285 TStreamMode................................................. 286 TTabJustify ..................................................... 288

Properties
FileName......................................................... 126 IgnoreFileSettings ........................................... 142

Types

TAcuracyMethod............................................. 274 TBKMode ........................................................ 274 TFontAlign....................................................... 279 TLineHeightMethod......................................... 280 TMacrold......................................................... 281 TOrientation .................................................... 283

315

TLabelShell

Component

Unit: Parentage:

RPLabel.pas TBaseShell > TLabelShell

This shell component is a specialized one that will help with label style reports. There are many predefined formats or you can create a completely custom one. TLabelShell gets it power from OriginX and OriginY. Using these properties to change the upper left hand corner of the page to the upper left hand corner of each label, your reporting code will use the exact same positions for each label on the page.

Events

OnLabelAfter................................................... 180 OnLabelBefore................................................ 180

OnLabelPrint................................................... 180

Methods
Execute 122 LabelWidth...................................................... 147 NumAcross ..................................................... 168 NumDown....................................................... 169 PrintByRow..................................................... 207 Row ................................................................ 235 SpacingHeight ................................................ 257 SpacingLeft..................................................... 257 SpacingTop .................................................... 258 SpacingWidth ................................................. 258

Properties
Border ............................................................... 91 Col................................................................... 100 DrawExtents.................................................... 118 DrawPen ......................................................... 119 DrawPreviewOnly ........................................... 119 Engine............................................................. 121 LabelBrand...................................................... 146 LabelHeight..................................................... 146 LabelShape..................................................... 147

316

TMasterShell

Component

Unit: Parentage:

RPShell.pas TBaseShell > TDetailShell > TMasterShell

This component is the next shell component in ReportPrinter Pro well discuss and provides a good balance between simplicity and functionality. It adds the concept of groups and detail sections to the structure that was presented for TDetailShell.

Events
OnBodyAfter ................................................... 171 OnBodyBefore ................................................ 172 OnBodyFooter................................................. 172 OnBodyHeader ............................................... 172 OnDetailAfter................................................. 175 OnDetailBefore.............................................. 175 OnGroupAfter................................................ 177 OnGroupAfterLast ........................................ 178 OnGroupBefore ............................................ 178 OnGroupBeforeFirst..................................... 178 OnGroupFooter............................................. 178 OnGroupHeader............................................ 178 OnRowAfter .................................................... 189 OnRowBefore ................................................. 190 OnRowPrint .................................................... 190

Methods
Execute ........................................................... 122 PrintBodyFooter .............................................. 207 PrintBodyHeader............................................. 207 PrintDetail ...................................................... 210 PrintGroupFooter ......................................... 212 PrintGroupHeader......................................... 212 PrintRow ......................................................... 220

Properties

DetailReport .................................................... 116 Engine............................................................. 121 IsNewPage...................................................... 143 IsReprint.......................................................... 144 Reprint ........................................................... 229 SectionBodyFooter ......................................... 242

SectionBodyHeader........................................ 242 SectionGroupFooter..................................... 243 SectionGroupHeader.................................... 243 SectionRow .................................................... 246 StartNewPage ................................................ 259

317

TMemoBuf
Unit: Parentage: RPMemo.pas TClass > TMemoBuf

Class

TMemoBuf is a powerful class that is designed to store large amounts of text, that, along with PrintMemo, MemoLines and GetMemoLine, output text that is justified and word wrapped within a column. To use a TMemoBuf you must include RPMemo in the uses statement. To use a TDBMemoBuf you must include RPMemo and RPDBUTIL in the uses statement. The TMemoBuf component is used to print the contents of memo fields or long strings. See Tutorial 12 for an example mail merge application using TMemoBuf.

Methods
Append.............................................................. 85 AppendMemoBuf .............................................. 85 ContraintHeightLeft......................................... 104 Delete.............................................................. 113 Empty.............................................................. 121 FreeSaved ...................................................... 136 GetNextLine.................................................... 136 Insert............................................................... 143 InsertMemoBuf................................................ 143 LoadFromFile.................................................. 154 LoadFromStream............................................ 155 MemoHeightLeft.............................................. 162 MemoLinesLeft ............................................... 163 PrintHeight...................................................... 213 PrintLines........................................................ 217 ReplaceAll ...................................................... 226 Reset .............................................................. 230 RestoreBuffer ................................................. 232 RTFLoadFromFile .......................................... 235 RTFLoadFromStream..................................... 236 SaveBuffer...................................................... 237 SaveToStream................................................ 239 SearchFirst ..................................................... 241 SearchNext..................................................... 242 SetData........................................................... 250

Properties
Buffer ................................................................ 95 BufferInc............................................................ 95 Justify.............................................................. 145 MaxSize .......................................................... 161 Memo.............................................................. 162 NoCRLF .......................................................... 167 NoNewLine ..................................................... 167 Pos ................................................................. 204 PrintEnd.......................................................... 210 PrintStart......................................................... 220 Size................................................................. 256 Text................................................................. 276

318

TRaveProject

Component

Unit: Parentage:

RVProj.pas TRaveReport > TRaveProjectManager

The RaveProject component provides a connection to the Rave Visual Designer

Method:
ClearRaveBlob.................................................. 99 Close............................................................... 100 Design............................................................. 114 DesignReport .................................................. 115 Execute ........................................................... 123 ExecuteReport ................................................ 124 GetReportCategoryList ................................... 137 GetReportList.................................................. 137 LoadFromFile.................................................. 154 LoadFromStream............................................ 155 LoadRaveBlob ................................................ 155 OnDesignerSave............................................. 174 OnDesignerShow............................................ 174 Open ............................................................... 193 ReportDescToMemo ...................................... 228 Save ............................................................... 237 SaveToFile ..................................................... 239 SaveToStream................................................ 240 SelectReport................................................... 248 WriteBCDData ................................................ 292 WriteBlobData ................................................ 293 WriteBoolData ................................................ 293 WriteCurrData................................................. 294 WriteDateTime................................................ 294 WriteFloatData................................................ 295 WriteIntData.................................................... 295 WriteNullData.................................................. 296 WriteStrData ................................................... 296 RaveBlobDateTime ........................................ 223 ReportDesc..................................................... 228 ReportFullName ............................................. 229 ReportName ................................................... 229 RuntimeVisibility ............................................. 237 StoreRAV........................................................ 262 Table............................................................... 271 UseSetRange ................................................. 291 OnFirst............................................................ 175 OnGetCols...................................................... 176 OnGetRow...................................................... 177 OnGetSorts..................................................... 177 OnNext ........................................................... 182 OnOpen .......................................................... 182 OnRestore ...................................................... 189 OnSetFilter ..................................................... 191 OnSetSort....................................................... 191

Property:
Active ................................................................ 83 DataSet ........................................................... 112 DLLFile............................................................ 117 Engine............................................................. 122 LoadDesigner.................................................. 154 LocalFilter ....................................................... 156 ProjectFile ....................................................... 222 Query .............................................................. 223

Event:
OnAfterClose .................................................. 169 OnAfterOpen................................................... 169 OnBeforeClose ............................................... 170 OnBeforeOpen................................................ 170 OnCreate ........................................................ 172 OnDesignerSave............................................. 174 OnDesignerSaveAs ........................................ 174 OnDesignerShow............................................ 174 OnDestroy....................................................... 174 OnEOF............................................................ 175

319

TReportFiler

Component

Unit: Parentage:

RPFiler.pas TBaseReport > TReportFiler

The TReportFiler component is used to generate a special report file that can later be used by the TFilePrinter and TFilePreview components. A report is generated the same way as the code in a TReportPrinter report except that the report is sent to a file (or other stream) instead of the printer.

Constants
BoxLineXxxx ......................93

Events

OnAfterPrint OnBeforePrint OnDecodeImage

170 171 173

OnNewColumn 181 OnNewPage 181 OnPrintFooter ..................186 DrawFocusRect ...............119 Ellipse ..............................120 Execute............................122 FillRect.............................126 Finish ...............................126 FinishTabBox...................127 FloodFill ...........................128 FrameRect.......................135 GetMemoLine ..................136 GetTab.............................137 GotoFooter ......................138 GotoHeader .....................138 GotoXY ............................138 GraphicFieldToBitmap.....139 Home ...............................142 LF ....................................150 LinesLeft ..........................152 LineTo..............................153 Macro...............................157 MemoLines ......................163 MoveTo............................164 NewColumn .....................165 NewLine...........................165 NewPage .........................165 NoPrinterPageHeight.......168 NoPrinterPageWidth........168

OnPrintHeader.................187 OnPrintPage....................188

Methods

Abort ..................................81 AbortPage..........................82 AdjustLine ..........................83 AllowAll ..............................84 AllowPreviewOnly ..............84 AllowPrinterOnly ................85 Arc......................................85 AssignFont.........................87 BrushCopy .........................95 CalcGraphicHeight.............96 CalcGraphicWidth..............96 Chord .................................98 ClearAllTabs ......................98 ClearColumns ....................99 ClearTabs ..........................99 ColumnLinesLeft..............102 CopyRect .........................105 CR....................................105 Create ..............................107 CreateBrush.....................108 CreateFont.......................110 CreatePen........................110 CreatePoint......................111 CreateRect.......................111 Destroy.............................115 Draw.................................118 320

NoPrinters........................168 Pie ...................................200 PIVar................................201 Polygon............................201 Polyline............................202 PopFont...........................202 PopPos............................203 PopTabs ..........................203 Print .................................205 PrintBitmap......................205 PrintBitmapRect...............206 PrintBlock ........................206 PrintCenter ......................208 PrintCharJustify ...............208 PrintData..........................209 PrintDataStream..............209 PrintFooter.......................212 PrintHeader .....................212 PrintImageRect................215 PrintLeft ...........................217 Println ..............................217 PrintMemo .......................217 PrintRight.........................220 PrintTab...........................221 PrintXY ............................221 PushFont .........................222

PushPos.......................... 222 PushTabs........................ 223 RecoverPrinter ................ 224 Rectangle........................ 224 RegisterGraphic .............. 225 ReleasePrinter ................ 226 Reset............................... 230 ResetLineHeight ............. 230 ResetPrinter .................... 231 ResetSection................... 231 ResetTabs....................... 231 RestoreFont .................... 232 RestorePos ..................... 232 RestoreTabs ................... 233

ReuseGraphic..................233 RoundRect.......................235 SaveFont .........................238 SavePos ..........................238 SaveTabs.........................239 SelectPrinter ....................248 SetBrush ..........................249 SetColumns .....................249 SetColumnWidth..............250 SetFont ............................250 SetPaperSize...................251 SetPen .............................251 SetPIVar ..........................252 SetTab .............................253 FontHandle ......................130 FontHeight .......................131 FontName........................131 FontPitch..........................132 FontRotation ....................132 Fonts................................133 FontSize...........................133 FontTop ...........................133 FontWidth ........................134 FrameMode .....................135 Italic .................................145 LastPage..........................147 LeftWaste.........................149 LineBottom.......................150 LineHeight........................150 LineHeightMethod............151 LineMiddle .......................151 LineNum ..........................152 LinesPerInch....................153 LineTop............................153 MacroData .......................158 MarginBottom ..................159 MarginLeft........................159 MarginRight .....................160 MarginTop........................160 MaxCopies.......................161 NoBufferLine....................166 NoNTColorFix ..................167 NoPrinterPageHeight.......168 NoPrinterPageWidth ........168 Orientation .......................193 OriginX.............................193

SetTopOfPage.................254 StretchDraw.....................263 Tab ..................................269 TabEnd............................270 TabStart...........................273 TabWidth .........................274 TextRect ..........................278 TextWidth ........................278 UnregisterGraphic ...........289 UpdateStatus...................290 XD2I.................................296 XD2U ...............................297 YD2I.................................299 YD2U ...............................299 OriginY.............................193 OutputInvalid ...................194 OutputName ....................194 PageHeight......................197 PageInc ...........................197 PageInvalid......................197 Pages ..............................198 PageWidth .......................198 Papers .............................199 ParaJustify.......................199 Port..................................203 PrinterIndex .....................211 Printers ............................211 Printing ............................216 ReportDateTime ..............228 RightWaste ......................234 ScaleX .............................240 ScaleY .............................240 SectionBottom .................243 SectionLeft.......................244 SectionRight ....................245 SectionTop ......................246 Selection..........................247 ShadeColor......................255 ShadePercent..................255 ShadowDepth ..................255 StatusFormat...................260 StatusLabel......................261 StatusText .......................261 Stream.............................262 StreamMode....................263 Strikeout ..........................264 321

Properties

Aborted ............................. 82 AccuracyMethod ............... 83 AscentHeight..................... 86 Bins ................................... 90 BKColor............................. 90 Bold................................... 91 BottomWaste .................... 92 BoxLineColor .................... 93 Canvas.............................. 97 Collate............................. 101 ColumnEnd ..................... 101 ColumnNum .................... 102 Columns.......................... 103 ColumnStart .................... 103 ColumnWidth .................. 103 Copies............................. 104 CurrentPage.................... 111 CurrentPass .................... 112 CursorXPos..................... 112 CursorYPos..................... 112 DescentHeight ................ 114 DeviceName ................... 116 DevMode......................... 117 DriverName..................... 120 Duplex............................. 120 FileName......................... 126 FirstPage......................... 127 FontAlign......................... 129 FontBaseline ................... 129 FontBottom ..................... 129 FontCharset .................... 130 FontColor ........................ 130

Subscript..........................264 Superscript.......................265 TabColor ..........................269 TabJustify.........................270 TabShade ........................273

TextBKMode....................277 Title..................................279 TopWaste ........................283 Totals...............................283 Underline .........................288 TMacroId .........................281 TOrientation.....................283 TPrintJustify.....................284

Units ................................288 UnitsFactor ......................289 Width ...............................292

Types
TAccuracyMethod............274 TBKMode.........................274 TLineHeightMethod..........280 TPrintUnits.......................285 TStreamMode..................286 TTabJustify......................288

322

TReportPrinter

Component

Unit: Parentage:

RPrinter.pas TBaseReport > TCanvasReport > TReportPrinter

The TReportPrinter component is the primary reporting component and sends report output directly to the printer. To create a report with TReportPrinter, place the component on a form. The properties and events can then be customized or coded for the report. To run the report, simply call the Execute method. Execute will first call the OnBeforePrint event, then call the printing events, then call the OnAfterPrint event. The OnBeforePrint and OnAfterPrint events are called before and after the print job is active and therefore, the printer canvas is not valid. Code inside of these events should call only non-printing code such as opening or closing of tables or the setting of published TReportPrinter properties. Printing the body of the report is done with one of two event handlers: OnPrint and OnPrintPage. See their descriptions in the reference section for more information on how these events differ. OnPrintHeader, OnPrintFooter and OnNewPage are called for each page that is printed. OnNewPage is called before any printing code is done for that page to allow you to set the page up. OnPrintHeader is called after OnNewPage. OnPrintFooter is called after all printing for a page is completed but before the next page is activated.

Constants Events

BoxLineXxxx ..................... 93 OnAfterPrint .................... 170 OnBeforePrint ................. 171 OnDecodeImage............. 173 OnNewColumn ................181 OnNewPage ....................181 OnPrintFooter ..................186 OnPrintHeader.................187 OnPrintPage ....................188

Methods
Abort ................................. 81 AbortPage ......................... 82 AdjustLine ......................... 83 AllowAll ............................. 84 AllowPreviewOnly ............. 84 AllowPrinterOnly ............... 85 Arc..................................... 85 AssignFont ........................ 87 BrushCopy ........................ 95 CalcGraphicHeight............ 96 CalcGraphicWidth ............. 96 Chord ................................ 98 ClearAllTabs ......................98 ClearColumns ....................99 ClearTabs ..........................99 ColumnLinesLeft..............102 CopyRect .........................105 CR....................................105 Create..............................107 CreateBrush.....................108 CreateFont.......................110 CreatePen........................110 CreatePoint......................111 CreateRect.......................111 Destroy ............................115 Draw ................................118 DrawFocusRect ...............119 Ellipse ..............................120 Execute............................122 FillRect.............................126 Finish...............................126 FinishTabBox...................127 FloodFill...........................128 FrameRect.......................135 GetMemoLine..................136 GetTab.............................137 323

GotoFooter.......................138 GotoHeader .....................138 GotoXY ............................138 GraphicFieldToBitmap .....139 Home ...............................142 LF.....................................150 LinesLeft ..........................152 LineTo..............................153 Macro...............................157 MemoLines ......................163 MoveTo............................164 NewColumn .....................165 NewLine...........................165 NewPage .........................165 NoPrinters........................168 PageHeight ......................197 Pie....................................200 PIVar ................................201 Polygon............................201 Polyline ............................202 PopFont ...........................202 PopPos ............................203 PopTabs...........................203 Print..................................205 PrintBitmap ......................205 PrintBitmapRect...............206 PrintBlock.........................206 PrintCenter.......................208 PrintCharJustify................208 PrintData..........................209 PrintDataStream ..............209

PrintFooter.......................212 PrintHeader......................212 PrintImageRect................215 PrintLeft ...........................217 Println...............................217 PrintMemo .......................217 PrintRight.........................220 PrintTab ...........................221 PrintXY.............................221 PushFont .........................222 PushPos ..........................222 PushTabs.........................223 RecoverPrinter.................224 Rectangle.........................224 RegisterGraphic...............225 ReleasePrinter .................226 Reset ...............................230 ResetLineHeight ..............230 ResetPrinter.....................231 ResetSection ...................231 ResetTabs .......................231 RestoreFont.....................232 RestorePos......................232 RestoreTabs ....................233 ReuseGraphic..................233 RoundRect.......................235 SaveFont .........................238 SavePos ..........................238 SaveTabs.........................239 SelectBin..........................247 SelectPaper .....................248 CurrentPage ....................111 CurrentPass.....................112 CursorXPos .....................112 CursorYPos .....................112 DescentHeight .................114 DeviceName ....................116 DevMode .........................117 DriverName......................120 Duplex..............................120 FirstPage .........................127 FontAlign..........................129 FontBaseline....................129 FontBottom ......................129 FontCharset.....................130 FontColor.........................130

SelectPrinter....................248 SetBrush..........................249 SetColumns.....................249 SetColumnWidth..............250 SetFont............................250 SetPaperSize...................251 SetPen.............................251 SetPIVar ..........................252 SetTab.............................253 SetTopOfPage.................254 Start.................................259 StretchDraw.....................263 SupportBin.......................265 SupportCollate.................265 SupportDuplex.................266 SupportOrientation ..........266 SupportPaper ..................266 Tab ..................................269 TabEnd............................270 TabStart...........................273 TabWidth .........................274 TextRect ..........................278 TextWidth ........................278 UnregisterGraphic ...........289 UpdateStatus...................290 XD2I.................................296 XD2U...............................297 YD2I.................................299 YD2U...............................299

Properties
Aborted ..............................82 AscentHeight......................86 Bins....................................90 BKColor..............................90 Bold....................................91 BottomWaste .....................92 BoxLineColor .....................93 Canvas...............................97 Collate..............................101 ColumnEnd ......................101 ColumnNum .....................102 Columns...........................103 ColumnStart.....................103 ColumnWidth ...................103 Copies..............................104 324 FontHandle......................130 FontHeight.......................131 FontName........................131 FontPitch .........................132 FontRotation....................132 Fonts ...............................133 FontSize ..........................133 FontTop ...........................133 FrameMode .....................135 Italic .................................145 LastPage .........................147 LeftWaste ........................149 LineBottom ......................150 LineHeight .......................150 LineHeightMethod ...........151

LineMiddle....................... 151 LineNum.......................... 152 LinesPerInch ................... 153 LineTop........................... 153 MacroData ...................... 158 MarginBottom.................. 159 MarginLeft....................... 159 MarginRight..................... 160 MarginTop....................... 160 MaxCopies ...................... 161 NoBufferLine ................... 166 NoNTColorFix ................. 167 NoPrinterPageHeight ...... 168 NoPrinterPageWidth ....... 168 Orientation ...................... 193 OriginX ............................ 193 OriginY ............................ 193 OutputInvalid................... 194 OutputName.................... 194 PageHeight ..................... 197 PageInc........................... 197

PageInvalid ......................197 Pages...............................198 PageWidth .......................198 Papers .............................199 ParaJustify .......................199 Port ..................................203 PrinterIndex .....................211 Printers ............................211 Printing.............................216 ReportDateTime ..............228 RightWaste ......................234 ScaleX .............................240 ScaleY .............................240 SectionBottom .................243 SectionLeft.......................244 SectionRight ....................245 SectionTop.......................246 Selection ..........................247 ShadeColor......................255 ShadePercent ..................255 ShadowDepth ..................255 TLineHeightMethod .........280 TMacroId..........................281 TOrientation.....................283

StatusFormat...................260 StatusLabel......................261 StatusText .......................261 Stream.............................262 StreamMode....................263 Strikeout ..........................264 Subscript..........................264 Superscript ......................265 TabColor..........................269 TabJustify ........................270 TabShade........................273 TextBKMode....................277 Title..................................279 TopWaste ........................283 Totals...............................283 Underline .........................288 Units ................................288 UnitsFactor ......................289 Width ...............................292

Types
TBKMode ........................ 274 TDuplex........................... 275 TFontAlign....................... 279 TPrintJustify.....................284 TPrintUnits.......................285 TTabJustify......................288

325

TReportSection
Unit: Parentage: RRPSection.pas TPersistent > TReportSection

Class

TReportSection is a class that helps to define the section properties, SectionLeft, SectionRight, SectionTop and SectionBottom. It also can be used to define the selected font and tab settings as well as force a new page if there is not enough room on the current page.

Shown above is the Section Editor which is displayed whenever you double-click in the Object Inspector on the right columns of a TReportSection property. The most noticeable feature is the page display which visually shows you (although not to scale) how the section is being calculated. The Distance edit boxes for the left, right, top and bottom sides all control how far, in units, the section side is from the landmark defined in the From combo boxes. All sides can be measured from the page or the margins. Also, the right and bottom sections can be measured from the left and top sections respectively and the top section can be measured from the current cursor position. Having the top section measured from the previous line (current cursor) is the method that should be used for sections that you want to follow the previous section, while having it measured from the 326

margin or page would be the setting to use for headers or footers that will always appear in the same location on the page. The bottom section should reference the lowest point that SectionBottom can be placed, while the minimum height defines what the minimum distance between SectionTop and SectionBottom is allowed to be before a new page is generated. The minimum height can be measured in lines of text (see LineHeight) or in units. The tab and font indexes, if non-zero, will load up the tabs or font that were previously saved with SaveTabs or SaveFont. A TReportSection component can be completely disabled by clicking the Enabled checkbox off. All of these options can also be edited directly by double-clicking, in the Object Inspector, on the left column of a TReportSection property. TReportSection allows you to define many aspects for a section of a report and is used heavily by the shell components, TDetailShell, TMasterShell, TReportShell and TLabelShell, as well as, by the table printer components, TDBTablePrinter and TTablePrinter. Well move on to the next shell component, TMasterShell, and show you how you can link two components together for a master-detail relationship.

Properties
Bottom............................................................... 92 BottomMethod................................................... 92 Enabled........................................................... 121 FontIndex........................................................ 131 Height.............................................................. 141 HeightMethod.................................................. 142 Left.................................................................. 148 LeftMethod...................................................... 148 MinHeight ....................................................... 164 Right ............................................................... 234 RightMethod ................................................... 234 SetupSection .................................................. 254 TabIndex......................................................... 270 Top ................................................................. 282 TopMethod ..................................................... 282

327

TReportShell

Component

Unit: Parentage:

RPShell.pas TBaseShell > TDetailShell > TMasterShell > TReportShell

This shell component is very similar to a TMasterShell component, but adds report and page headers and footers.

Events

OnBodyAfter ................................................... 171 OnBodyBefore ................................................ 172 OnBodyFooter................................................. 172 OnBodyHeader ............................................... 172 OnDetailAfter .................................................. 175 OnDetailBefore ............................................... 175 OnGroupAfter.................................................. 177 OnGroupAfterLast........................................... 178 OnGroupBefore............................................... 178 OnGroupBeforeFirst........................................ 178 OnGroupFooter............................................... 178 OnGroupHeader ............................................. 178

OnPageAfter.................................................. 183 OnPageBefore............................................... 183 OnPageFooter............................................... 184 OnPageHeader.............................................. 184 OnReportAfter............................................... 189 OnReportBefore............................................ 189 OnReportFooter............................................ 189 OnReportHeader........................................... 189 OnRowAfter .................................................... 189 OnRowBefore ................................................. 190 OnRowPrint .................................................... 190

Methods
Execute........................................................... 122 PrintBodyFooter .............................................. 207 PrintBodyHeader............................................. 207 PrintDetail ....................................................... 210 PrintGroupFooter ............................................ 212 PrintGroupHeader........................................... 212 PrintPageFooter............................................ 219 PrintPageHeader........................................... 219 PrintReportFooter......................................... 219 PrintReportHeader........................................ 219 PrintRow ......................................................... 220

Properties
DetailReport.................................................... 116 Engine............................................................. 121 IsNewPage...................................................... 143 IsReprint.......................................................... 144 Reprint ............................................................ 229 SectionBodyFooter ......................................... 242 SectionBodyHeader ........................................ 242 SectionGroupFooter........................................ 243 SectionGroupHeader...................................... 243 SectionPageFooter....................................... 244 SectionPageHeader...................................... 244 SectionReportFooter.................................... 245 SectionReportHeader................................... 245 SectionRow .................................................... 246 StartNewPage ................................................ 259

328

TReportSystem

Component

Unit: Parentage:

RPSystem.pas TRPBaseComponent > TReportSystem

Incorporates the other four output components, TReportPrinter, TReportFiler, TFilePrinter and TFilePreview into a single, easy to use reporting system.

Events
OnAfterPrint .................................................... 170 OverridePreview ............................................. 196 OverrideSetup ................................................ 196 OverrideStatus................................................ 196

Methods

PIVar ............................................................... 201 SetPIVar.......................................................... 252

Properties
BaseReport ....................................................... 89 DefaultDest ..................................................... 113 GridHoriz......................................................... 140 GridPen........................................................... 140 GridVert........................................................... 140 LineHeightMethod........................................... 151 NoNTColorFix................................................. 167 SystemFiler..................................................... 266 SystemOptions ............................................... 267 SystemPreview............................................... 267 SystemPrinter ................................................. 268 TableColumn .................................................. 271 TSystemSetup ................................................ 287 TSystemSetups .............................................. 287

Types
TReportDest.................................................... 286 TSystemOption ............................................... 287 TSystemOptions ............................................. 287

329

TRPHTMLFiler

Component

Unit: Parentage:

RPHTFilr.pas TBaseReport > TRPHTMLFiler

The HTML component operates very similar to the TReportFiler, TRTFFiler and TTextFiler components. Basically, you define an OnPrint event that calls standard ReportPrinter commands and an HTML file is generated. Due to the inherent limitations of HTML not all ReportPrinter Pro methods are supported. It is recommended to create the report from the top to the bottom for best results. A true HTML table is generated when the SetTab and PrintTab command are used. An example program which demonstrates the use of the TRPHTMLFiler component is contained in the file HTMLDemo.Zip.

Methods
PrintData......................................................... 209 PrintHyperLink ................................................ 213 PrintHyperLinkEnd.......................................... 214 PrintHyperLinkStart ........................................ 214 PrintImage ...................................................... 215

Properties
FileName......................................................... 126 ParagraphAttribute.......................................... 199 ReplaceFileName ........................................... 227 ReplaceToken................................................. 227 ScreenDPI ...................................................... 240 TableAttributes ............................................... 271 Title................................................................. 279

330

TRPBarsBase
Unit: Parentage: RPBars.pas TRPBarsBase > TRPBarsXxxx Print .................................205 PrintXY.............................222 Center ................................97 CheckSum .........................97 Height ..............................141 Left...................................148 Position ............................204 PrintChecksum ................208 PrintReadable ..................219 PrintTop ...........................221

Class

Methods

Create ............................. 106 IsValidChar ..................... 144

Properties
BarBottom ......................... 87 BarCodeJustify.................. 87 BarCodeRotation .............. 88 BarHeight .......................... 88 BarTop .............................. 88 BarWidth ........................... 89 BaseReport ....................... 89 Bottom............................... 91 ReadableHeight...............223 Right ................................234 Text..................................276 TextJustify .......................277 Top ..................................282 UseChecksum .................290 WideFactor ......................291 Width ...............................292

TRPBars2of5
No unique Methods / Properties

Component Component Component


ExtendedText -- 124

TRPBarsCode128
Property: CodePage ---------100

TRPBarsCode39
Property: Extended -----------124

TRPBarsEAN
No unique Methods / Properties

Component Component
PrintFimB ------- 211 PrintFimC ------- 211

TRPBarsPostNet
Method: PrintFimA ----------211

TRPBarsUPC
No unique Methods / Properties

Component

331

TRPComponent TRPBaseComponent
Unit: RPDefine.pas > RPBase.pas Parentage: TRPComponent > TRPBaseComponent Descendants: TRPComponent > TRPBaseComponent This class is the base for all TRPComponent.

Class Class

Methods
Append.............................................................. 85 SetData........................................................... 250 Text................................................................. 276

Properties
BufferInc............................................................ 95 Size................................................................. 256

332

TRPCustomConnection

Component

Unit: Parentage:

RVData.pas TRaveDataField > TRaveDataView

The CustomConnection component provides a connection to the Rave Visual Designer

Method:
Close............................................................... 100 Execute ........................................................... 123 GetReportList.................................................. 137 Open ............................................................... 193 ReportDescToMemo ...................................... 228 Save ............................................................... 237 SelectReport................................................... 248

Property:

Active ................................................................ 83 Engine............................................................. 122 LocalFilter ....................................................... 156 ProjectFile ....................................................... 222

ReportDesc..................................................... 228 ReportFullName ............................................. 229 ReportName ................................................... 229 RuntimeVisibility ............................................. 237 OnNext ........................................................... 182 OnOpen .......................................................... 182 OnRestore ...................................................... 189 OnSetFilter ..................................................... 191 OnSetSort....................................................... 191 OnValidateRow............................................... 192

Event:
OnCreate ........................................................ 172 OnDestroy....................................................... 174 OnEOF............................................................ 175 OnFirst ............................................................ 175 OnGetCols ...................................................... 176 OnGetRow ...................................................... 177 OnGetSorts ..................................................... 177

333

TRPDataConnection

Component

Unit: Parentage:

RVData.pas TRaveDataField > TRaveDataView

The DataConnection component provides a connection to the Rave Visual Designer

Method:
ClearRaveBlob ----------------------------------------- 99 Close---------------------------------------------------- 100 Execute ------------------------------------------------ 123 GetReportList----------------------------------------- 137 LoadRaveBlob---------------------------------------- 155 Open ----------------------------------------------------193 ReportDescToMemo --------------------------------228 Save-----------------------------------------------------237 SaveRaveBlob ----------------------------------------238 SelectReport ------------------------------------------248 ReportDesc--------------------------------------------228 ReportFullName --------------------------------------229 ReportName-------------------------------------------229 StoreRAV ----------------------------------------------262 OnDesignerShow ------------------------------------174 OnDestroy ---------------------------------------------174

Property:
Active ----------------------------------------------------- 83 Engine-------------------------------------------------- 122 ProjectFile --------------------------------------------- 222 RaveBlobDateTime --------------------------------- 223

Event:
OnCreate ---------------------------------------------- 172 OnDesignerSave------------------------------------- 174

334

TRTFFiler

Component

Unit: Parentage:

RPRTFilr.pas TBaseReport > TRTFFiler

The RTFFiler component operates very similar to the TReportFiler, TRPHTMLFiler and TTextFiler components. Basically, you define an OnPrint event that calls standard ReportPrinter commands and an RTF file is generated. Due to the inherent limitations of the RTF format, not all commands are supported. It is recommended to create each page from the top to the bottom for best results. When using SetTab and PrintTab, ReportPrinter will format a table style report into a RTF file that closely resembles the printed output. Simple graphics such as MoveTo, LineTo, Rectangle and Ellipse are also supported.

Methods
NewPara ..................................................... 166

Properties

FileName..................................................... 126

335

TTableColumn
Unit: Parentage: RPTabCol.pas & RPTable.pas TTableItem > TTableColumn

Class

TTableColumn is the non-database counterparts to TDBTableColumn. One difference between the two sets of components is the obvious lack of database type properties in TTableColumn. The other difference is that the event handlers will be used quite a bit more extensively to provide the data to the table printer component from whatever data source it is coming from. The most common event handlers that will be overridden for TTablePrinter are OnInitTable and OnGetNextRow, and for TTableColumn they are OnAddTotal, OnRowSetup and OnRowHeight. For more information, look at the demo projects included with ReportPrinter Pro for a more detailed example of how to use TTablePrinter.

Events
OnAddTotal......................169 OnFooterAfter ..................175 OnFooterBefore ...............176 OnFooterHeight ...............176 OnFooterPrint ..................176 OnFooterSetup ................176 OnHeaderAfter.................179 OnHeaderHeight..............179 OnHeaderPrint.................179 OnInitMaster ....................179 OnInitPage.......................180 OnInitTable ......................180 PrintBox ...........................207
Margin................................... 158 Margin100............................. 158 MemoBuf .............................. 162 MinFontSize.......................... 163 OverflowAppend................... 195 OverflowMethod ................... 195 OverflowReplace .................. 196 PageTotal ............................. 198 Pen ....................................... 200 ReportPrinter ........................ 229

OnRowAfter .....................190 OnRowBefore..................190 OnRowHeight ..................190 OnRowPrint .....................191 OnRowSetup ...................191

Methods
CreateColumn..................109 PrintDefault......................210
ShadeColor........................... 255 ShadePercent ....................... 255 SplitRow................................ 258 SubTotal ............................... 265 TableItem.............................. 272 TablePrinter .......................... 272 Totals .................................... 283 UseParentFont...................... 290 UseParentPen ...................... 291 Width..................................... 292

Properties
AsFloat ....................................86 AsInteger .................................86 BoxLines..................................94 Description ............................114 DisplayFormat .......................117 Font .......................................128 GrandTotal ............................139 Heading .................................141 Justify ....................................145 JustifyVert..............................146

Types

TBoxLines........................275 TOverFlowMethod ...........284

TPrintJustify.....................284 TPrintJustifyVert ..............285

336

TTableItem
Unit: Parentage: RPTable.pas TTableItem

Class

This class is the base for all TTableItem components.

Methods

Append.............................................................. 85

SetData

250

Properties

BufferInc............................................................ 95 Size ................................................................. 256

Text................................................................. 276

337

TTablePrinter

Component

Unit: Parentage:

RPTable.pas TBaseShell > TTablePrinter OnInitTable.................................................... 180 OnValidateRow ............................................. 192 Execute........................................................... 122 StartPos......................................................... 260 TableColumn................................................. 271 TableColumns............................................... 271 TableSection ................................................. 272 TextBKMode.................................................. 277

Events

OnGetNextRow.............................................. 177 OnInitMaster.................................................. 180

Methods
Default............................................................ 113

Properties
DetailTablePrinter ......................................... 116 Engine............................................................. 121 Font ................................................................ 128 MasterTablePrinter ....................................... 161 Pen ................................................................. 200 ReprintHeader ............................................... 230

338

TTableSection
Unit: Parentage: RPTabSec.pas & RPTable.pas TTableItem > TTableSection

Class

This component, like TDBTableColumn, also has no icon and can only be created through the Table Editor. Once a TTableSection component is created, it can be selected by using the Object Inspector selection combo box or by clicking on the appropriate section in the Table Editor.

Events

OnAfter............................................................ 169 OnBefore......................................................... 170

OnPrint ........................................................... 186 OnSetup ......................................................... 191 Print Default.................................................... 210 Pen ................................................................. 200 ReportPrinter .................................................. 229 Section............................................................ 242 ShadeColor..................................................... 255 ShadePercent................................................. 255 TablePrinter .................................................... 272 Text................................................................. 276 UseParentFont ............................................... 290 UseParentPen ................................................ 291 Width .............................................................. 292

Methods
PrintBox .......................................................... 207

Properties
BoxLines ........................................................... 94 Description ...................................................... 114 Font................................................................. 128 Justify.............................................................. 145 JustifyVert ....................................................... 146 Margin............................................................. 158 Margin100....................................................... 158 MinFontSize .................................................... 163 OverflowMethod.............................................. 195 OverflowReplace............................................. 196 OutputType ..................................................... 195

Types
TBoxLines ....................................................... 275 TOutputType................................................... 284 TOverflow Method........................................... 284 TPrintJustify.................................................... 284 TPrintJustifyVert ............................................. 285

339

TTextFiler

Component

Unit: Parentage:

RPTxFilr.pas TBaseReport > TTextFiler

The TextFiler component operates very similar to the TReportFiler, TRPHTMLFiler and TRTFFiler components. Basically, you define an OnPrint event that calls standard ReportPrinter commands and a text file is generated. Due to the inherent limitations of the text format, most commands are not supported. You may also use this component to output text based reports directly to dot matrix printers, thereby bypassing the Windows print system for much quicker printing. To do this simply specify the printer port (e.g. LPT1, PRN) in the FileName property and execute as normal.

Method: Property:
CPI ------------------------------------------------------ 105 FileName ---------------------------------------------- 126 FormFeed --------------------------------------------- 134 FormFeedStr------------------------------------------ 134 LeftBorder --------------------------------------------- 148 LPI------------------------------------------------------- 157 MarginBottom----------------------------------------- 159 MarginLeft --------------------------------------------- 159 MarginRight .................................................... 160 MarginTop ...................................................... 160 StatusFormat .................................................. 260 StatusLabel..................................................... 261 StatusText ...................................................... 261 TopBorder....................................................... 282 Units ............................................................... 288 UnitsFactor ..................................................... 289 OnPrint ........................................................... 185 OnPrintFooter ................................................. 186 OnPrintHeader................................................ 187 OnPrintPage ................................................... 188

Event:
OnAfterPrint .................................................... 170 OnBeforePrint ................................................. 171 OnEndOfSection............................................. 175 OnNewColumn................................................ 181 OnNewPage.................................................... 181

340

Appendix

U
Units
The following is a list of the source files that make up ReportPrinter Pro along with a short description of what is contained within. WARNING The RVINFO.OBJ and RPRAVE.DCU files contain your ID and other pertinent information about the Rave system you purchased. As such, they are not to be distributed, released or shared by any other users.

Compression Methods RVCmXxxx


Filename RVCmHuff Classes / Components Compression functions Description

Project Editors RVWz####


Filename RVWzSimp RVWzMD Classes / Components Description Simple Table Listing Report Wizard Master-Detail Report Wizard

Property Editors RVPE####


Filename RVPEStrL RVPEBand RVPEImg RVPERLoc Classes / Components Description String list property editor Band property editor Image (Bitmap / Metafile) property editor ReprintLoc property editor

Rave Component Sets RVCsXxxx


Filename RVCsStd RVCsDraw RVCsRpt RVCsBars Classes / Components Standard Components Graphics Components Report Components Barcode Components Description

341

Rave Language Compiler RVL#Comp


Filename RVLDComp Classes / Components Delphi Syntax Compiler Description

Rave Language Engine RVLE####


Filename RVLEDef RVLEUtil RVLESys RVLEType RVLEID RVLECode RVLEMod RVLEExpr RVLERun Classes / Components Description Rave Language Engine Constants and Types Rave Language Engine Utility Functions Rave Language Engine System Functions Rave Language Engine Type Classes Rave Language Engine ID Classes Rave Language Engine Code Generators Rave Language Engine Module Classes Rave Language Engine Expression Classes Rave Language Engine Execution Engine

Rave Units
Filename RVDefine RVUtil RVClass Classes / Components Description Types and constants for Rave Class Library Utility functions for Rave Class Library Base and designer classes for all Rave components

RVData RVProj RVTool

TRaveObject TRaveComponent TRaveControl TRaveProjectItem TRavePage TRaveDesigner TRavePip TRaveDataField TRaveDataView TRaveReport TRaveProjectManager TRavePropertyEditor TRaveComponentEditor TRaveProjectEditor

DataView classes and property editors Report and Project components Editor classes for designer experts

342

ReportPrinter Units
Filename RPDefine RPBase RPCanvas RPFiler RPRTFilr RPTxFilr Rprinter RPFPrint Rpreview RPSystem RPSetFrm RPStaFrm RPPreFrm RPShell Classes / Components TRPComponent TBaseReport TCanvasReport TReportFiler TRTFFiler TTextFiler TReportPrinter TFilePrinter TFilePreview TReportSystem TRPSetupForm TRPStatusForm TRPPreviewForm TDetailShell TMasterShell TReportShell TLabelShell TTablePrinter TTableItem TTableColumn TTableSection TDBTablePrinter TMemoBuf TDBMemoBuf TReportSection TRPDevice Description Base class to all components + types and constants Base class for TCanvasReport and TReportFiler Base class for TReportPrinter and TFilePrinter Report file output component RTF (Rich Text Format) filer component Text filer component Printer output component Report file to printer output component Report file to screen output component Report system component Setup form for TReportSystem Status form for TReportSystem Preview form for TReportSystem Banded style report framework components

RPLabel RPTable RPTabItm RPTabCol RPTabSec RPDBTabl RPMemo RPDBUtil RPSect RPDevice RPRPTF RPReg RPSecFrm RPCedFrm RPAddFrm

Label style report framework components Table printer framework component Base class for TTableColumn and TTableSection Table column component Table header / footer component Database table printer framework component Memo buffer class Database memo buffer class and other DB utils Report section class Printer device manager class ReportPrinter Text Format utilities Component registration code for ReportPrinter Pro Property editor for TReportSection Component editor for TTablePrinter and TDBTablePrinter Add Fields dialog for above component editor

343

Appendix

X
Categorical Event/Method/Property Reference
Bar Code
BarBottom property............87 BarCodeJustify property ....87 BarCodeRotation property .88 BarHeight property.............88 BarTop property.................88 BarWidth property..............89 BaseReport property..........89 Bottom property .................91 Center property..................97 CheckSum property ...........97 CodePage property..........100 Create method.................106 Extended property ...........124 ExtendedText property ....124 Height property ................141 IsValidChar method .........144 Left property ....................148 Position property..............204 Print method ....................205 PrintChecksum property ..208 PrintFimA method............211 PrintFimB method............211 PrintFimC method............211 ColumnNum property.......102 Columns property ............103 ColumnStart property.......103 ColumnWidth property.....103 Finish method ..................126 FirstPage property ...........127 LastPage property ...........147 NewColumn method ........165 NewLine method..............165 NewPage method ............165 NewPara method.............166 OnAfterPrint event ...........170 OnBeforePrint event ........171 OnNewColumn event.......181 OnNewPage event...........181 OnOverFlow event...........182 OnPrint event...................185 OnPrintFooter event ........186 OnPrintHeader event.......187 PrintReadable property....219 PrintTop property.............221 PrintXY method ...............222 ReadableHeight property.223 Right property..................234 Text property ...................276 TextJustify property .........277 Top property ....................282 UseChecksum property...290 WideFactor property........291 Width property .................292 OnInitMaster....................179 SetColumns method........249 SetColumnWidth method.250 OnPrintPage event ..........188 OutputInvalid property .....194 PageInvalid property........197 Printing property ..............216 Reset method ..................230 ScaleX property...............240 ScaleY property...............240 Selection property............247 Start method....................259 Stream property...............262 StreamMode property......263 TAccuracyMethod type....274 TOrientation type.............283 TStreamMode type..........286

Column

ClearColumns method .......99 ColumnEnd property........101 ColumnLinesLeft method.102

Control

Abort method .....................81 Aborted property ................82 AbortPage method.............82 AccuracyMethod property..83 AllowAll method .................84 AllowPreviewOnly method .84 AllowPrinterOnly method ...85 BaseReport property..........89 CurrentPage property ......111 Engine property................121 Execute method (frame) ..122 Execute method (output)..122 ExecuteCustom method...123 FileName property ...........126

344

Font

AssignFont method ........... 87 Bold property..................... 91 CreateFont method......... 110 FontAlign property........... 129 FontCharset property...... 130 FontColor property.......... 130 FontHandle property ....... 130 FontHeight property ........ 131

FontName property..........131 FontPitch property ...........132 FontRotation property......132 FontSize property ............133 FontWidth property ..........134 Italic property ...................145 PopFont method ..............202 PushFont method ............222 RestoreFont method........232 FillRect method................126 FloodFill method ..............128 FrameMode method ........135 FrameRect method..........135 GraphicFieldToBitmap .....139 LineTo method.................153 MoveTo method...............164 NoBufferLine property......166 OnDecodeImage event....173 Pie method.......................200 Polygon method...............201 Polyline method ...............202 PrintBitmap method .........205 PrintBitmapRect method..206 PrintImageRect method ...215 PrintHyperLinkEnd meth..214 PrintHyperLinkStart meth.214 PrintImage method ..........215 ReplaceFileName prop ....227 ReplaceToken property ...227 LabelShape property .......147 LabelWidth property.........147 NumAcross property ........168 NumDown property..........169 OnLabelAfter event..........180 OnLabelBefore event.......180 OnLabelPrint event ..........180 PrintByRow property........207 Row property ...................235 ConstraintHeightLeft me ..104 Delete method .................113 Empty method..................121 Field property...................125 FreeSaved method ..........136 GetMemoLine method .....136

SaveFont method ............238 SetFont method...............250 Strikeout property ............264 Subscript property ...........264 Superscript property ........265 TFontAlign type ...............279 Underline property...........288

Graphics

Arc method........................ 85 BKColor property .............. 90 BrushCopy method ........... 95 CalcGraphicHeight meth... 96 CalcGraphicWidth meth .... 96 Chord method ................... 98 CopyRect method ........... 105 CreateBrush method....... 108 CreatePen method.......... 110 CreatePoint method ........ 111 CreateRect method......... 111 Draw method................... 118 DrawFocusRect method . 119 Ellipse method ................ 120

Rectangle method ...........224 RegisterGraphic method..225 ReuseGraphic method.....233 RoundRect method..........235 SetBrush method.............249 SetPen method................251 ShadeToColor method ....255 StretchDraw method........263 TBKMode type.................274 TextBKMode property......277 TextRect method .............278 TransparentBitmaps prop 285 UnregisterGraphic method289

HTML

FileName property .......... 126 ParagraphAttribute......... 199 PrintData method ............ 209 PrintHyperLink method ... 213

ScreenDPI property .........240 TableAttributes property ..271 Title property....................279

Label

Border property................. 91 Col property .................... 100 DrawExtents property ..... 118 DrawPen property ........... 119 DrawPreviewOnly prop ... 119 LabelBrand property ....... 146 LabelHeight property....... 146

SkipNum property............257 SpacingHeight property...257 SpacingLeft property .......257 SpacingTop property .......258 SpacingWidth property ....258 StartCol property .............259 StartRow property............260

Memo

Append method................. 85 AppendMemoBuf method . 85 BaseReport property......... 90 Buffer property .................. 95 BufferInc property ............. 95

GetNextLine method........136 Insert method...................143 InsertMemoBuf method ...143 Justify property ................145 LoadFromFile method .....154 LoadFromStream method155 345

MaxSize property.............161 Memo property.................162 MemoHeightLeft method..162 MemoLines method .........163 MemoLinesLeft method ...163 NoCRLF property.............167 NoNewLine property ........167 Pos property.....................204 PrintEnd property.............210 PrintHeight method ..........213 PrintLines method............217

PrintMemo method ..........217 PrintStart property............220 ReplaceAll method...........226 Reset method ..................230 RestoreBuffer method......232 RestoreState method.......232 RichEdit property .............233 RTFField property............235 RTFLoadFromFile method235 RTFLoadFromStream m..236 RTFText property ............236 LPI property .....................157 OnOverFlow event...........182 SoftLine method...............257 StatusFormat property.....260 StatusLabel property........261 StatusText property .........261 LeftBorder property..........148 LF method .......................150 LineBottom property ........150 LineHeight property .........150 LineHeightMethod prop ...151 LineMiddle property .........151 LineNum property ............152 LinesLeft method .............152 LinesPerInch property......153 LineTop property .............153 MarginBottom property ....159 MarginLeft property .........159 MarginRight property .......160 MarginTop property .........160 OriginX property...............193 OriginY property...............193 PopPos method ...............203 OnPageChange event .....183 OnPreviewSetup event....184 OnPreviewShow event ....185 OnZoomChange event ....192 PageInc property .............197 Pages property ................198 PrevPage method............204 PrintPage method............218 RedrawPage method.......224 RulerType property..........236

SaveBuffer method..........237 SaveState method...........239 SaveToStream method....239 SearchFirst method .........241 SearchNext method.........242 SetData method...............250 SetRTF method ...............252 Size property ...................256 Text property ...................276

Misc

CPI property.....................105 Create method .................107 CurrentPass property.......112 Destroy method................115 IgnoreFileSettings prop....142

Title property ...................279 TotalPasses property.......283 UpdateStatus method......290 Version property ..............291

Position

AdjustLine method .............83 AscentHeight property .......86 CR method.......................105 CursorXPos property .......112 CursorYPos property .......112 DescentHeight property ...114 FontBaseline property......129 FontBottom property ........129 FontTop property .............133 FormFeed property ..........134 FormFeedStr property .....134 GotoFooter method..........138 GotoHeader method ........138 GotoXY method ...............138 Home method ..................142

PushPos method .............222 ResetLineHeight method.230 ResetSection method ......231 RestorePos method.........232 SavePos method .............238 SectionBottom property...243 SectionLeft property ........244 SectionRight property......245 SectionTop property ........246 SetTopOfPage method....254 TextWidth method ...........278 TLineHeightMethod type .280 TopBorder property .........282 XPos property..................298 YPos property..................301

Preview

AccuracyMethod property..83 Clear method .....................98 GridHoriz property............140 GridPen property..............140 GridVert property .............140 MarginMethod property....159 MarginPercent property ...160 Monochrome property......164 NextPage method ............166 346

ScrollBox property ...........241 ShadowDepth property....255 TMarginMethod type .......281 ZoomFactor property.......302 ZoomIn method ...............302 ZoomInc property ............303 ZoomOut method ............303 ZoomPageFactor property303 ZoomPageWidthFactor....304

Printer

Bins property..................... 90 BottomWaste property ...... 92 Canvas property................ 97 Collate property............... 101 Copies property............... 104 DeviceName property ..... 116 DevMode property .......... 117 DriverName property....... 120 Duplex property............... 120 Fonts property................. 133 LeftWaste property.......... 149 MaxCopies property........ 161 NoNTColorFix property ... 167 NoPrinterPageHeight prop168 NoPrinterPageWidth prop168 NoPrinters method .......... 168

Orientation property.........193 OutputFileName property 194 OutputName property ......194 PageHeight property........197 PageWidth property .........198 Papers property ...............199 Port property....................203 PrintData method.............209 PrintDataStream method .209 PrinterIndex property .......211 Printers property ..............211 RecoverPrinter method....224 ReleasePrinter method ....226 ResetPrinter method........231 RightWaste property ........234 RPDev function................235 SelectBin method.............247 PrintFooter method..........212 PrintHeader method.........212 PrintJustify property .........216 PrintLeft method ..............217 PrintLn method ................217 PrintRight method ............220 PrintTab method ..............221 PrintXY method................221 OnBeforeClose event ......170 OnBeforeOpen event.......170 OnCreate event ...............172 OnDesignerSave method 174 OnDesignerSaveAs meth 174 OnDesignerShow method174 OnDestroy event..............174 OnEOF event...................175 OnFirst event ...................175 OnGetCols event .............176 OnGetRow event .............177 OnGetSorts event ............177 OnNext event...................182 OnOpen event .................182 OnRestore event..............189 OnSetFilter event.............191 OnSetSort event ..............191 OnValidateRow event ......192 Open method...................193 ProjectFile property..........222 Query property.................223

SelectPaper method........248 SelectPrinter method.......248 SetPaperSize method......251 ShowPrintDialog method .256 ShowPrinterSetupDialog .256 SupportBin method..........265 SupportCollate method....265 SupportDuplex method....266 SupportOrientation meth .266 SupportPaper method .....266 TDuplex type ...................275 TextRect method .............278 TopWaste property..........283 XDPI property ..................297 YDPI property ..................300

Printing

Macro method................. 157 MacroData property ........ 158 PIVar method .................. 201 Print method.................... 205 PrintBlock method........... 206 PrintCenter method......... 208 PrintCharJustify method.. 208

ReportDateTime property 228 SetPIVar method .............252 TruncateText property .....286 TMacroID type.................281 TPrintJustify type .............284 TPrintJustifyVert type ......285

Rave

Active property .................. 83 ClearRaveBlob method..... 99 Close method.................. 100 DataSet property............. 113 Design method................ 114 DesignReport method ..... 115 DLLFile property ............. 117 Engine property............... 122 Execute method .............. 123 ExecuteReport method ... 124 GetReportCategoryList m 137 GetReportList method..... 137 LoadDesigner property ... 154 LoadFromFile method..... 154 LoadFromStream method155 LoadRaveBlob method ... 155 LocalFilter property ......... 156 OnAfterClose event......... 169 OnAfterOpen event ......... 169

RaveBlobDateTime prop .223 ReportDesc property .......228 ReportDescToMemo meth228 ReportFullName property 229 ReportName property......229 RuntimeVisibility property 237 Save method ...................237 SaveRaveBlob property...238 SaveToFile method .........239 SaveToStream method....240 SelectReport method.......248 StoreRAV property ..........262 Table property .................271 UseSetRange property ....291 WriteBCDData method ....292 WriteBlobData method ....293 WriteBoolData method ....293 WriteCurrData method.....294 WriteDateTime method....294 WriteFloatData method....295 WriteIntData method........295 347

WriteNullData method......296

WriteStrData method .......296 HeightMethod property ....142 Left property ....................148 LeftMethod property ........148 MinHeight property ..........164 Right property ..................234 RightMethod property ......234 SystemFiler property........266 SystemOptions property ..267 SystemPreview property..267 SystemPrinter property....268 SystemSetups property ...268 TitlePreview property.......279 RTFLoadFromFile meth ..235 RTFLoadFromStream m..236 RTFText property ............236 SetRTF method ...............252 OnPageAfter event ..........183 OnPageBefore event .......183 OnPageFooter event .......184 OnPageHeader event......184 OnReportAfter event........189 OnReportBefore event.....189 OnReportFooter event.....189 OnReportHeader event....189 OnRowAfter event ...........189 OnRowBefore event ........190 OnRowPrint event............190 PrintBodyFooter method..207 PrintBodyHeader meth ....207 PrintDetail method ...........210 PrintGroupFooter meth....212 PrintGroupHeader meth...212 PrintPageFooter method..218 SetupSection method ......254 TabIndex property ...........270 Top property ....................282 TopMethod prop ..............282

ReportSection

Bottom property .................92 BottomMethod property .....92 Enabled property..............121 FontIndex property...........131 Height property ................141

ReportSystem

DefaultDest property........113 OverridePreview event.....196 OverrideSetup event........196 OverrideStatus event .......196 ReportDest property.........228

TitleSetup property ..........279 TitleStatus property .........280 TSystemOption type........287 TSystemSetup type .........287

RTF

ParaJustify property.........199 RichEdit property .............233 RTFField property............235

SoftLine method ..............257 TextRect method .............278

Shell

DetailReport property.......116 IsNewPage property ........143 IsReprint property ............144 OnBodyAfter event...........171 OnBodyBefore event........172 OnBodyFooter event........172 OnBodyHeader event ......172 OnDetailAfter event..........175 OnDetailBefore event.......175 OnEndOfSection event ....175 OnGroupAfter event.........177 OnGroupAfterLast event..178 OnGroupBefore event......178 OnGroupBeforeFirst ev....178 OnGroupFooter event......178 OnGroupHeader event.....178

PrintPageHeader method 218 PrintReportFooter meth...219 PrintReportHeader meth..219 PrintRow method.............220 Reprint property...............229 SectionBodyFooter prop..242 SectionBodyHeader prop 242 SectionGroupFooter prop 243 SectionGroupHeader pro.243 SectionPageFooter prop .244 SectionPageHeader prop 244 SectionReportFooter pro .245 SectionReportHeader pro 245 SectionRow property .......246 StartNewPage property ...259

348

TablePrinter

AsFloat property................ 86 AsInteger property ............ 86 BoxLines property ............. 94 CreateColumn method.... 109 DataSet property............. 112 Default method................ 113 Description property........ 114 DetailKey property .......... 115 DetailTablePrinter prop ... 116 DisplayFormat property... 117 FieldName property ........ 125 Font property................... 128 GrandTotal property........ 139 Heading property ............ 141 Justify property................ 145 JustifyVert property ......... 146 LookupDataSet property . 156 LookupDisplay property .. 156 LookupKey property........ 156 Margin property............... 158 Margin100 property......... 158 MasterKey property......... 160 MasterTablePrinter prop . 161 MemoBuf property .......... 162 MinFontSize property...... 163 OnAddTotal event ........... 169 OnAfter event.................. 169

OnBefore event................170 OnFooterAfter event ........175 OnFooterBefore event .....176 OnFooterHeight event .....176 OnFooterPrint event ........176 OnFooterSetup event ......176 OnGetNextRow event......177 OnHeaderAfter event.......179 OnHeaderBefore event....179 OnHeaderHeight event ....179 OnHeaderPrint event .......179 OnHeaderSetup event .....179 OnInitMaster event ..........180 OnInitPage event .............180 OnInitTable event ............180 OnOverFlow event...........182 OnPrint event...................186 OnRowAfter event ...........190 OnRowBefore event ........190 OnRowHeight event.........190 OnRowPrint event............191 OnRowSetup event..........191 OnSetup event.................191 OnValidateRow event ......192 OutputType property........195 OverflowAppend property 195 OverflowMethod property 195 OverflowReplace prop .....196 PopTabs method .............203 PushTabs method............223 ResetTabs method ..........231 RestoreTabs method .......233 SaveTabs method............239 SetTab method ................253 Tab method......................269 TabColor property............269 XI2D method....................297 XI2U method....................298 XU2D method ..................298 XU2I method....................299 YD2I method....................299 YD2U method ..................299

PageTotal property..........198 Pen property....................200 PrintBox method ..............207 PrintDefault method.........210 ReportPrinter property.....229 ReprintHeader property...230 Section property ..............242 SectionType property ......246 ShadeColor property .......255 ShadePercent property....255 SplitRow property ............258 StartPos property.............260 SubTotal property............265 TableColumn property.....271 TableColumns property ...271 TableItem property ..........272 TablePrinter property.......272 TableSection property .....272 TBoxLines type................275 Text property ...................276 Totals property.................283 TOutputType type............284 TOverFlowMethod type ...284 TReportDest type ............286 UseParentFont property ..290 UseParentPen property ...291 Width property .................292 TabEnd method...............270 TabJustify property..........270 TabShade property..........273 TabStart method..............273 TabWidth method ............274 TTabJustify type ..............288

Tabs

BoxLineColor property ...... 93 BoxLineXxxx constants..... 93 ClearAllTabs method ........ 98 ClearTabs method ............ 99 FinishTabBox method ..... 127 GetTab method............... 137

Units

TPrintUnits type .............. 285 Units property.................. 288 UnitsFactor property ....... 289 XD2I method ................... 296 XD2U method ................. 297

YI2D method....................300 YI2U method....................300 YU2D method ..................301 YU2I method....................301

349

Index
A Appendix Category Reference............................. 344 ReportPrinter Units ............................. 341 B Bar Code Reference ................................ 344 BaseReport................................................ 89 Bins........................................................... 90 Bitmap BrushCopy ............................................ 95 Convert GraphicField To Bitmap ....... 139 CreateBrush ........................................ 108 PrintBitmap......................................... 205 BKColor.................................................... 90 Bold .......................................................... 91 Border ....................................................... 91 BoxLineColor ........................................... 93 BoxLines................................................... 94 BoxLineXxxx ........................................... 93 BrushCopy ................................................ 95 C Canvas ...................................................... 97 Class Bar Code 128 .................................................. 331 2 of 5............................................... 331 Base ................................................ 331 Code39............................................ 331 EAN ................................................ 331 PostNet............................................ 331 UPC ................................................ 331 Base TBaseReport ................................... 307 TBaseShell...................................... 308 TCanvasReport ............................... 309 TRPBaseComponent....................... 332 TRPComponent .............................. 332 Framework TDetailShell.................................... 313 TLabelShell..................................... 316 TMasterShell................................... 317 TReportShell................................... 328 Memo 350 TDBMemoBuf.........................310, 337 TMemoBuf ......................................318 Output TFilePreview ...................................314 TFilePrinter......................................315 TReportFiler ....................................320 TReportPrinter .................................323 TReportSystem ................................329 TRPHTMLFiler ...............................330 TRTFFiler........................................335 TTextFiler........................................340 Rave Custom Connection .........................333 Data Connection ..............................334 Project..............................................319 Report TReportSection................................326 Table TDBTableColumn ...........................311 TDBTablePrinter .............................312 TTableColumn.................................336 TTablePrinter...................................338 TTableSection..................................339 Class Tree ................................................305 Color Background............................................90 Font......................................................130 Line......................................................251 Column Clear ......................................................99 Columns...............................................103 End.......................................................101 Justify ..................................................145 Lines Left.............................................102 Number ................................................102 Start .....................................................103 Width ...................................................103 Constants amAppearance .....................................274 amPositioning ......................................274 bkOpaque.....................................274, 277 bkTransparent ..............................274, 277 blAll...............................................94, 275 blBottom ..............................................275 blLeft ...................................................275 blLeftBottom .......................................275

blLeftRight ..........................................275 blLeftTop.............................................275 blNoBottom .........................................275 blNoLeft ..............................................275 blNone .................................................275 blNoRight ............................................275 blNoTop...............................................275 blRight .................................................275 blRightBottom .....................................275 blRightTop...........................................275 blTop ...................................................275 blTopBottom........................................275 BOXLINENONE...................................93 cpCodeA ..............................................100 cpCodeB ..............................................100 cpCodeC ..............................................100 DEFAULT_CHARSET.......................130 dtBCD..................................................292 dtBlob ..................................................293 dtBoolean.............................................293 dtDate ..................................................294 dtDateTime ..........................................294 dtFloat..........................................294, 295 dtGraphic .............................................293 dtInteger...............................................295 dtMemo................................................293 dtTime..................................................294 dupHorizontal ..............................120, 275 dupSimlex............................................120 dupSimplex..........................................275 dupVertical ..................................120, 275 faBaseline ....................................129, 279 faBottom ......................................129, 279 faTop ...........................................129, 279 fmInside...............................................135 fmOutside ............................................135 fmSplit .................................................135 GREEK_CHARSET............................130 lhmFont................................................280 lhmLinesPerInch..................................280 lhmUser ...............................................280 lsRect ...................................................147 lsRound................................................147 lsRoundRect ........................................147 midCurrDateInter.................................281 midCurrDateLong................................281 midCurrDateShort ...............................281

midCurrDateUS...................................281 midCurrentPage...................................281 midCurrTime24 ...................................281 midCurrTimeAMPM...........................281 midCurrTimeLong...............................281 midCurrTimeShort ..............................281 midDriverName...................................281 midFirstPage........................................281 midLastPage ........................................281 midPortName.......................................281 midPrinterName ..................................281 midTotalPages .....................................281 midUser00 ...........................................281 omReplace ...................................195, 284 omShrink .....................................195, 284 omTruncate..........................................284 omTruncateChar ..................................195 omTruncateWord.........................195, 284 omWrap .......................................195, 284 otGrandTotals......................................284 otHeadings...........................................284 otPageTotals ........................................284 otSubTotals..........................................284 otText ..................................................284 pjBlock ........................................145, 284 pjBottom..............................................285 pjCenter .................87, 145, 253, 277, 284 pjLeft .....................87, 145, 253, 277, 284 pjMiddle ......................................146, 285 pjRight ...................87, 145, 253, 277, 284 pjTop ...................................................285 poDefault .....................................193, 283 poLandscape................................193, 283 poPortrait.....................................193, 283 rdFile ...................................................286 rdPreview.............................................286 rdPrinter...............................................286 Rot0 .......................................................88 Rot180 ...................................................88 Rot270 ...................................................88 Rot90 .....................................................88 rtBothCm .............................................236 rtBothIn ...............................................236 rtDeveloper..........................................237 rtEndUser.............................................237 rtHorizCm............................................236 rtHorizIn ..............................................236 351

rtNone ......................................... 236, 237 rtVertCm............................................. 236 rtVertIn ............................................... 236 smFile ......................................... 263, 286 smMemory.................................. 263, 286 smTempFile ................................ 263, 286 smUser ........................................ 263, 286 soAllowPrintFromPreview ................. 267 soNoGenerate ..................................... 267 soPreviewModal ................................. 267 soShowStatus...................................... 267 soUseFiler ........................................... 267 soWaitForOK...................................... 267 ssAllowCopies .................................... 287 ssAllowDestFile.................................. 287 ssAllowDestPreview........................... 287 ssAllowDestPrinter ............................. 287 ssAllowPrinterSetup ........................... 287 ssAllowSetup ...................................... 287 ssCollate.............................................. 287 ssDuplex ............................................. 287 tjBlock ................................................ 288 tjCenter ............................................... 288 tjLeft ................................................... 288 tjNone ................................................. 288 tjRight ................................................. 288 unCM .......................................... 285, 288 unInch ......................................... 285, 288 unMM ......................................... 285, 288 unPoint........................................ 285, 288 unUser......................................... 285, 288 Control New Column....................................... 165 New Line ............................................ 165 New Page ............................................ 165 New Paragraph.................................... 166 CPI .......................................................... 105 CR........................................................... 105 Create...................................................... 107 CRLF ....................................... See NewLine D DataSet............................................ 112, 113 Destroy.................................................... 115 Device Mode................................................... 117 Name................................................... 116 352

Display Format ........................................117 DLL File ..................................................117 Draw Arc .........................................................85 Draw Line To X,Y...............................153 Ellipse ..................................................120 FillRect ................................................126 Move To Point.....................................164 No Buffer Line.....................................166 Draw Pen .................................................119 Driver Name ............................................120 E Ellipse ......................................................120 Engine..............................................121, 122 Event OnAddTotal.........................................169 OnAfter................................................169 OnAfterClose.......................................169 OnAfterOpen .......................................169 OnAfterPrint ........................................170 OnBefore .............................................170 OnBeforeClose ....................................170 OnBeforeOpen.....................................170 OnBeforePrint......................................171 OnBodyAfter .......................................171 OnBodyBefore.....................................172 OnBodyFooter .....................................172 OnBodyHeader ....................................172 OnCreate..............................................172 OnDecodeImage ..................................173 OnDesignerSave ..................................174 OnDesignerSaveAs..............................174 OnDesignerShow.................................174 OnDestroy............................................174 OnDetailAfter ......................................175 OnDetailBefore....................................175 OnEndOfSection..................................175 OnEOF.................................................175 OnFirst.................................................175 OnFooterAfter .....................................175 OnFooterBefore ...................................176 OnFooterHeight ...................................176 OnFooterPrint ......................................176 OnFooterSetup.....................................176 OnGetCols ...........................................176 OnGetNextRow ...................................177

OnGetRow...........................................177 OnGetSorts ..........................................177 OnGroupAfter......................................177 OnGroupAfterLast...............................178 OnGroupBefore ...................................178 OnGroupBeforeFirst ............................178 OnGroupFooter....................................178 OnGroupHeader...................................178 OnHeaderAfter ....................................179 OnHeaderBefore..................................179 OnHeaderHeight..................................179 OnHeaderPrint .....................................179 OnHeaderSetup....................................179 OnInitMaster................................179, 180 OnInitPage...........................................180 OnInitTable..........................................180 OnLabelAfter.......................................180 OnLabelBefore ....................................180 OnLabelPrint .......................................180 OnNewColumn....................................181 OnNewPage .........................................181 OnNext ................................................182 OnOpen................................................182 OnOverFlow ........................................182 OnPageAfter ........................................183 OnPageBefore......................................183 OnPageChange ....................................183 OnPageFooter ......................................184 OnPageHeader .....................................184 OnPreviewSetup ..................................184 OnPreviewShow ..................................185 OnPrint ........................................185, 186 OnPrintFooter ......................................186 OnPrintHeader .....................................187 OnPrintPage.........................................188 OnReportAfter .....................................189 OnReportBefore...................................189 OnReportFooter ...................................189 OnReportHeader..................................189 OnRestore ............................................189 OnRowAfter ................................189, 190 OnRowBefore......................................190 OnRowHeight......................................190 OnRowPrint .................................190, 191 OnRowSetup........................................191 OnSetFilter ..........................................191 OnSetSort ............................................191

OnSetup ...............................................191 OnValidateRow ...................................192 OnValidateRow ...................................192 OnZoomChange ..................................192 Override...............................................196 OverrideSetup......................................196 OverrideStatus .....................................196 Execute ............................................122, 123 F FieldName ...............................................125 FileName .................................................126 Finish .......................................................126 First Page.................................................127 FloodFill ..................................................128 Font Align....................................................129 Assign Font............................................87 Baseline ...............................................129 Bold attribute.........................................91 Bottom.................................................129 Bottom of Line ....................................150 Color....................................................130 Create ..................................................110 Font......................................................128 Fonts ....................................................133 Handle .................................................130 Height ..................................................131 Height of Line .....................................150 Index....................................................131 Italic attribute ......................................145 Line Height Method ............................151 Lines Per Inch......................................153 LPI.......................................................157 Middle of Line.....................................151 Minimum Font Size.............................163 Name ...................................................131 Pitch.....................................................132 Rotation ...............................................132 Size ......................................................133 Top ......................................................133 Top of Line..........................................153 Underline attribute...............................288 Width...................................................134 Fonts ........................................................133 Format Border Top ..........................................282 353

Frame Rectangle ..................................... 135 FrameMode............................................. 135 G Graphics Arc ........................................................ 85 Background Color................................. 90 BrushCopy ............................................ 95 Calculate Height ................................... 96 Calculate Width .................................... 96 Chord .................................................... 98 Convert GraphicField To Bitmap ....... 139 CopyRect ............................................ 105 CreateBrush ........................................ 108 CreatePen............................................ 110 CreatePoint ......................................... 111 CreateRect........................................... 111 Draw ................................................... 118 Draw Line To X,Y.............................. 153 DrawFocusRect................................... 119 Ellipse ................................................. 120 Fill....................................................... 128 FillRect ............................................... 126 Frame Rectangle ................................. 135 FrameMode......................................... 135 Move To Point .................................... 164 No Buffer Line.................................... 166 PrintBitmap......................................... 205 Register Graphic ................................. 225 Reuse .................................................. 233 StretchDraw ........................................ 263 UnregisterGraphic............................... 289 H Height Ascent ................................................... 86 Help Adding Context Sensitive ..................... 13 C++Builder ........................................... 14 Delphi 1 ................................................ 13 Delphi 2 ................................................ 13 Delphi 3 ................................................ 13 Delphi 4 ................................................ 13 Delphi 5 ................................................ 13 Home ...................................................... 142

L Label Border ....................................................91 Brand ...................................................146 Col .......................................................100 DrawExtents ........................................118 DrawPen ..............................................119 DrawPreviewOnly ...............................119 Height ..................................................146 Number Across ....................................168 Number Down .....................................169 Shape ...................................................147 Width ...................................................147 LeftBorder ...............................................148 Line Adjust ....................................................83 Lines Column Lines Left...............................102 M Macro.......................................................157 Margin .....................................................158 Memo.......................................................154 Append ..................................................85 Append to MemoBuf .............................85 Assign Memo to buffer........................162 BaseReport ............................................90 Buffer.....................................................95 Constrain Height..................................104 Current Position...................................204 Delete part of buffer ............................113 Empty Status........................................121 End Print Position................................210 Field.....................................................125 Free Memory .......................................136 Get Memo Line....................................136 Get Next Line ......................................136 Height of Memo Lines Left .................162 Increment Buffer Size............................95 Insert ....................................................143 Insert into Memobuf ............................143 Justification Style ................................145 Load buffer From Stream ....................155 Maximum Size.....................................161 No CRLF .............................................167 No New Line .......................................167 Number of Memo Lines.......................163

354

Number of Memo Lines Left ...............163 Replace All x with y ............................226 Reset Buffer.........................................230 Restore Buffer......................................232 Restore State ........................................232 RichEdit...............................................233 RTF Field.............................................235 RTF Load File .....................................235 RTF Load Stream ................................236 RTF output...........................................252 RTFText ..............................................236 Save Buffer ..........................................237 Save State ............................................239 Save To Stream....................................239 Search First ..........................................241 Search Next .........................................242 Set Data ...............................................250 Size in bytes.........................................256 Start Print Position...............................220 Text......................................................276 Method Abort......................................................81 AbortPage ..............................................82 AdjustLine .............................................83 AllowAll ................................................84 AllowPreviewOnly ................................84 AllowPrinterOnly ..................................85 Append ..................................................85 AppendMemoBuf ..................................85 Arc .........................................................85 AssignFont.............................................87 BrushCopy.............................................95 CalcGraphicHeight ................................96 CalcGraphicWidth .................................96 Chord .....................................................98 Clear ......................................................98 ClearAllTabs..........................................98 ClearColumns ........................................99 ClearRaveBlob ......................................99 ClearTabs...............................................99 Close ....................................................100 ColumnLinesLeft.................................102 ConstraintHeightLeft ...........................104 CopyRect .............................................105 CR........................................................105 Create...........................................106, 107 CreateBrush .........................................108

CreateColumn......................................109 CreateFont ...........................................110 CreatePen.............................................110 CreatePoint ..........................................111 CreateRect ...........................................111 Default .................................................113 Delete ..................................................113 Design..................................................114 DesignReport.......................................115 Destroy ................................................115 Draw ....................................................118 DrawFocusRect ...................................119 Ellipse..................................................120 Empty ..................................................121 Excecute ..............................................122 Execute ................................................123 ExecuteCustom....................................123 ExecuteReport .....................................124 FillRect ................................................126 Finish ...................................................126 FinishTabBox ......................................127 FloodFill ..............................................128 FrameRect ...........................................135 FreeSaved ............................................136 GetMemoLine .....................................136 GetNextLine ........................................136 GetReportCategoryList........................137 GetReportList ......................................137 GetTab.................................................137 GotoFooter ..........................................138 GotoHeader .........................................138 GotoXY ...............................................138 GraphicFieldToBitmap........................139 Home ...................................................142 Insert....................................................143 InsertMemoBuf....................................143 IsValidChar .........................................144 LF ........................................................150 LinesLeft .............................................152 LineTo .................................................153 LoadFromFile ......................................154 LoadFromStream.................................155 LoadRaveBlob.....................................155 Macro ..................................................157 MemoHeightLeft .................................162 MemoLines..........................................163 MemoLinesLeft ...................................163 355

MoveTo .............................................. 164 NewColumn........................................ 165 NewLine ............................................. 165 NewPage ............................................. 165 NewPara.............................................. 166 NextPage............................................. 166 NoPrinters........................................... 168 Open.................................................... 193 Pie ....................................................... 200 PIVar................................................... 201 Polygon............................................... 201 Polyline............................................... 202 PopFont............................................... 202 PopPos ................................................ 203 PopTabs .............................................. 203 PrevPage ............................................. 204 Print .................................................... 205 PrintBitmap......................................... 205 PrintBitmapRect ................................. 206 PrintBlock........................................... 206 PrintBodyFooter ................................. 207 PrintBodyHeader ................................ 207 PrintBox.............................................. 207 PrintCenter.......................................... 208 PrintCharJustify .................................. 208 PrintData............................................. 209 PrintDataStream.................................. 209 PrintDefault......................................... 210 PrintDetail........................................... 210 PrintFimA ........................................... 211 PrintFimB ........................................... 211 PrintFimC ........................................... 211 PrintFooter .......................................... 212 PrintGroupFooter................................ 212 PrintGroupHeader............................... 212 PrintHeader ......................................... 212 PrintHeight.......................................... 213 PrintHyperLink ................................... 213 PrintHyperLinkEnd............................. 214 PrintHyperLinkStart............................ 214 PrintImage........................................... 215 PrintImageRect ................................... 215 PrintJustify.......................................... 216 PrintLeft.............................................. 217 PrintLines............................................ 217 PrintLn ................................................ 217 PrintMemo .......................................... 218 356

PrintPage..............................................218 PrintPageFooter ...................................219 PrintPageHeader ..................................219 PrintReportFooter ................................219 PrintReportHeader ...............................219 PrintRight ............................................220 PrintRow..............................................220 PrintTab ...............................................221 PrintXY........................................221, 222 PushFont ..............................................222 PushPos................................................222 PushTabs..............................................223 RecoverPrinter .....................................224 Rectangle .............................................224 RedrawPage .........................................224 RegisterGraphic ...................................225 ReleasePrinter......................................226 ReplaceAll ...........................................226 ReportDescToMemo ...........................228 Reset ....................................................230 ResetLineHeight ..................................230 ResetPrinter .........................................231 ResetSection ........................................231 ResetTabs ............................................231 RestoreBuffer.......................................232 RestoreFont..........................................232 RestorePos ...........................................232 RestoreState .........................................232 RestoreTabs .........................................233 ReuseGraphic.......................................233 RoundRect ...........................................235 RTFLoadFromFile...............................235 RTFLoadFromStream..........................236 Save .....................................................237 SaveBuffer ...........................................237 SaveFont ..............................................238 SavePos................................................238 SaveRaveBlob .....................................238 SaveState .............................................239 SaveTabs..............................................239 SaveToFile...........................................239 SaveToStream..............................239, 240 SearchFirst...........................................241 SearchNext ..........................................242 SelectBin..............................................247 SelectPaper ..........................................248 SelectPrinter ........................................248

SelectReport ........................................248 SetBrush ..............................................249 SetColumns..........................................249 SetColumnWidth .................................250 SetData ................................................250 SetFont.................................................250 SetPaperSize ........................................251 SetPen ..................................................251 SetPIVar ..............................................252 SetRTF.................................................252 SetTab..................................................253 SetTopOfPage......................................254 SetupSection ........................................254 ShadeToColor......................................255 ShowPrintDialog .................................256 ShowPrinterSetupDialog .....................256 SoftLine ...............................................257 Start .....................................................259 StretchDraw.........................................263 SupportBin...........................................265 SupportCollate .....................................265 SupportDuplex.....................................266 SupportOrientation ..............................266 SupportPaper .......................................266 Tab.......................................................269 TabEnd ................................................270 TabStart ...............................................273 TabWidth.............................................274 TextRect ..............................................278 TextWidth............................................278 TruncateText........................................286 UnregisterGraphic ...............................289 UpdateStatus........................................290 WriteBCDData ....................................292 WriteBlobData.....................................293 WriteBoolData.....................................293 WriteCurrData .....................................294 WriteDateTime ....................................294 WriteFloatData ....................................295 WriteIntData ........................................295 WriteNullData .....................................296 WriteStrData........................................296 XD2I ....................................................296 XD2U ..................................................297 XI2D....................................................297 XI2U....................................................298 XU2D ..................................................298

XU2I....................................................299 YD2I....................................................299 YD2U ..................................................299 YI2D....................................................300 YI2U....................................................300 YU2D ..................................................301 YU2I....................................................301 ZoomIn ................................................302 ZoomOut .............................................303 N NewColumn.............................................165 NewLine ..................................................165 O OnAfterPrint............................................170 Output All options available..............................84 Preview Only.........................................84 Printer Only ...........................................85 P Page Abort......................................................82 Current.................................................111 Home ...................................................142 Lines Left ............................................152 Margin .................................................158 Margin 100ths of inch .........................158 Paragraph.................................................166 Position Bottom of Line ....................................150 CR........................................................105 Current Line Number ..........................152 Current Margin Bottom .......................159 Current Margin Left ............................159 Current Margin Right ..........................160 Current Margin Top.............................160 CursorXPos .........................................112 CursorYPos .........................................112 DescentHeight .....................................114 Font Top ..............................................133 FontBaseline........................................129 FontBottom..........................................129 Go to Position X,Y ..............................138 Goto Footer .........................................138 Goto Header ........................................138 357

Height of Line..................................... 150 LF........................................................ 150 Line Height Method............................ 151 Lines Left............................................ 152 Lines Per Inch ..................................... 153 Middle of Line .................................... 151 Top of Line ......................................... 153 Preview Clear...................................................... 98 Grid Horiz........................................... 140 Grid Pen.............................................. 140 Grid Vert............................................. 140 Margin Method ................................... 159 Margin Percent.................................... 160 Monochrome....................................... 164 Next Page............................................ 166 NoPrinterPageHeight .......................... 168 NoPrinterPageWidth........................... 168 PrevPage ............................................. 204 Preview Only - Draw .............................. 119 PrevPage ................................................. 204 Print ........................................................ 205 PrintBitmap............................................. 205 Printer Bins Available ...................................... 90 Canvas .................................................. 97 Collate................................................. 101 Copies ................................................. 104 DeviceName ....................................... 116 DevMode ............................................ 117 Driver Name ....................................... 120 Duplex ................................................ 120 ExecuteCustom ................................... 123 First Page ............................................ 127 Fonts ................................................... 133 Go to Position X,Y ............................. 138 Goto Footer......................................... 138 Goto Header........................................ 138 Justify.................................................. 145 Last Page............................................. 147 MaxCopies.......................................... 161 No Printers.......................................... 168 NoPrinterPageHeight .......................... 168 NoPrinterPageWidth........................... 168 OnAfterPrint ....................................... 170 Table BoxLines........................................... 94 358

CreateColumn..................................109 Default .............................................113 Description.......................................114 DetailKey.........................................115 DetailTablePrinter ...........................116 DisplayFormat .................................117 Execute ............................................123 Font..................................................128 Heading............................................141 Justify Vertical.................................146 Margin .............................................158 Margin 100ths of inch......................158 MemoBuf.........................................162 Minimum Font Size .........................163 OnAddTotal.....................................169 Waste .............................92, 149, 234, 283 Printing Macro...................................................157 MacroData ...........................................158 Property Aborted ..................................................82 AccuracyMethod ...................................83 Active ....................................................83 AscentHeight .........................................86 AsFloat ..................................................86 AsInteger ...............................................86 BarBottom .............................................87 BarCodeJustify ......................................87 BarCodeRotation ...................................88 BarHeight ..............................................88 BarTop...................................................88 BarWidth ...............................................89 BaseReport ......................................89, 90 Bins........................................................90 BKColor ................................................90 Bold .......................................................91 Border ....................................................91 Bottom .............................................91, 92 BottomMethod.......................................92 BottomWaste .........................................92 BoxLineColor ........................................93 BoxLines................................................94 Buffer.....................................................95 BufferInc................................................95 Canvas ...................................................97 Center ....................................................97 Checksum ..............................................97

CodePage.............................................100 Col .......................................................100 Collate..................................................101 ColumnEnd..........................................101 ColumnNum ........................................102 Columns...............................................103 ColumnStart.........................................103 ColumnWidth ......................................103 Copies ..................................................104 CPI.......................................................105 CurrentPage .........................................111 CurrentPass..........................................112 CursorXPos..........................................112 CursorYPos..........................................112 DataSet ........................................112, 113 DefaultDest..........................................113 DescentHeight .....................................114 Description ..........................................114 DetailKey.............................................115 DetailReport ........................................116 DetailTablePrinter ...............................116 DeviceName ........................................116 DevMode .............................................117 DisplayFormat .....................................117 DLLFile ...............................................117 DrawExtents ........................................118 DrawPen ..............................................119 DrawPreviewOnly ...............................119 DriverName .........................................120 Duplex .................................................120 Enabled ................................................121 Engine..........................................121, 122 Extended ..............................................124 ExtendedText.......................................124 Field.....................................................125 FieldAliasList ......................................125 FieldName ...........................................125 FileName .............................................126 FirstPage ..............................................127 Font......................................................128 FontAlign.............................................129 FontBaseline ........................................129 FontBottom..........................................129 FontCharset..........................................130 FontColor.............................................130 FontHandle ..........................................130 FontHeight...........................................131

FontIndex.............................................131 FontName ............................................131 FontPitch .............................................132 FontRotation........................................132 Fonts ....................................................133 FontSize...............................................133 FontTop ...............................................133 FontWidth............................................134 FormFeed.............................................134 FormFeedStr ........................................134 FrameMode .........................................135 GrandTotal ..........................................139 GridHoriz ............................................140 GridPen................................................140 GridVert ..............................................140 Heading ...............................................141 Height ..................................................141 HeightMethod......................................142 IgnoreFileSettings................................142 IsNewPage...........................................143 IsReprint ..............................................144 Italic.....................................................145 Justify ..................................................145 JustifyVert ...........................................146 LabelBrand ..........................................146 LabelHeight .........................................146 LabelShape ..........................................147 LabelWidth..........................................147 LastPage ..............................................147 Left ......................................................148 LeftBorder ...........................................148 LeftMethod..........................................148 LeftWaste ............................................149 LineBottom..........................................150 LineHeight...........................................150 LineHeightMethod ..............................151 LineMiddle ..........................................151 LineNum..............................................152 LinesPerInch........................................153 LineTop ...............................................153 LoadDesigner ......................................154 LocalFilter ...........................................156 LookupDataSet ....................................156 LookupDisplay ....................................156 LookupKey..........................................156 LPI.......................................................157 Margin .................................................158 359

Margin100 .......................................... 158 MarginBottom..................................... 159 MarginLeft.......................................... 159 MarginMethod .................................... 159 MarginPercent..................................... 160 MarginRight........................................ 160 MarginTop .......................................... 160 MasterKey........................................... 160 MasterTablePrinter ............................. 161 MaxCopies.......................................... 161 MaxSize .............................................. 161 Memo.................................................. 162 MemoBuf............................................ 162 MinFontSize ....................................... 163 MinHeight........................................... 164 Monochrome....................................... 164 NoBufferLine...................................... 166 NoCRLF ............................................. 167 NoNewLine......................................... 167 NoNTColorFix.................................... 167 NoPrinterPageHeight .......................... 168 NoPrinterPageWidth........................... 168 NumAcross ......................................... 168 NumDown........................................... 169 Orientation .......................................... 193 OriginX............................................... 193 OriginY............................................... 193 OutputFileName ................................. 194 OutputInvalid...................................... 194 OutputName........................................ 194 OutputType ......................................... 195 OverflowAppend ................................ 195 OverflowMethod................................. 195 OverflowReplace ................................ 196 PageHeight.......................................... 197 PageInc ............................................... 197 PageInvalid ......................................... 197 Pages................................................... 198 PageTotal ............................................ 198 PageWidth .......................................... 198 Papers ................................................. 199 ParagraphAttribute.............................. 199 ParaJustify........................................... 199 Pen ...................................................... 200 Port ..................................................... 203 Pos ...................................................... 204 Position ............................................... 204 360

PrintByRow .........................................207 PrintChecksum.....................................208 PrintEnd...............................................210 PrinterIndex .........................................211 Printers.................................................211 Printing ................................................216 PrintReadable ......................................219 PrintStart..............................................220 PrintTop...............................................221 ProjectFile............................................222 Query ...................................................223 RaveBlobDateTime .............................223 ReadableHeight ...................................223 ReplaceFileName.................................227 ReplaceToken ......................................227 ReportDateTime ..................................228 ReportDesc ..........................................228 ReportDest...........................................228 ReportFullName ..................................229 ReportName.........................................229 ReportPrinter .......................................229 Reprint .................................................229 ReprintHeader......................................230 RichEdit...............................................233 Right ....................................................234 RightMethod........................................234 RightWaste ..........................................234 Row......................................................235 RTFField..............................................235 RTFText ..............................................236 RulerType ............................................236 RuntimeVisibility ................................237 ScaleX..................................................240 ScaleY..................................................240 ScreenDPI............................................240 ScrollBox.............................................241 Section .................................................242 SectionBodyFooter ..............................242 SectionBodyHeader .............................242 SectionBottom .....................................243 SectionGroupFooter.............................243 SectionGroupHeader ...........................243 SectionLeft ..........................................244 SectionPageFooter ...............................244 SectionPageHeader ..............................244 SectionReportFooter............................245 SectionReportHeader...........................245

SectionRight ........................................245 SectionRow..........................................246 SectionTop...........................................246 SectionType.........................................246 Selection ..............................................247 ShadeColor ..........................................255 ShadePercent .......................................255 ShadowDepth.......................................255 Size ......................................................256 SkipNum..............................................257 SpacingHeight .....................................257 SpacingLeft..........................................257 SpacingTop..........................................258 SpacingWidth ......................................258 SplitRow ..............................................258 StartCol................................................259 StartNewPage ......................................259 StartPos................................................260 StartRow ..............................................260 StatusFormat........................................260 StatusLabel ..........................................261 StatusText ............................................261 StoreRAV ............................................262 Stream..................................................262 StreamMode ........................................263 Strikeout ..............................................264 Subscript ..............................................264 SubTotal ..............................................265 Superscript...........................................265 SystemFiler..........................................266 SystemOptions.....................................267 SystemPreview ....................................267 SystemPrinter ......................................268 SystemSetups.......................................268 TabColor..............................................269 TabIndex..............................................270 TabJustify ............................................270 Table....................................................271 TableAttributes ....................................271 TableColumn .......................................271 TableColumns......................................271 TableItem.............................................272 TablePrinter .........................................272 TableSection ........................................272 TabShade .............................................273 Text......................................................276 TextBKMode.......................................277

TextJustify ...........................................277 Title .....................................................279 TitlePreview ........................................279 TitleSetup ............................................279 TitleStatus............................................280 Top ......................................................282 TopBorder ...........................................282 TopMethod ..........................................282 TopWaste ............................................283 TotalPasses ..........................................283 Totals...................................................283 TransparentBitmaps.............................285 Underline .............................................288 Units ....................................................288 UnitsFactor ..........................................289 UseChecksum......................................290 UseParentFont .....................................290 UseParentPen.......................................291 UseSetRange .......................................291 Version ................................................291 WideFactor ..........................................291 Width...................................................292 XDPI....................................................297 XPos ....................................................298 YDPI....................................................300 YPos ....................................................301 ZoomFactor .........................................302 ZoomInc ..............................................303 ZoomPageFactor .................................303 ZoomPageWidthFactor........................304 Q Quit............................................................81 R Rave Abort......................................................81 Active ....................................................83 ClearRaveBlob ......................................99 Close....................................................100 DataSet ................................................113 Design..................................................114 DesignReport.......................................115 DLLFile ...............................................117 Engine..................................................122 Execute ................................................123 ExecuteReport .....................................124 361

FieldAliasList ..................................... 125 GetReportCategoryList....................... 137 GetReportList ..................................... 137 LoadDesigner...................................... 154 LoadFromFile ..................................... 154 LoadFromStream ................................ 155 LoadRaveBlob .................................... 155 LocalFilter .......................................... 156 OnAfterClose...................................... 169 OnAfterOpen ...................................... 169 OnBeforeClose ................................... 170 OnBeforeOpen.................................... 170 OnCreate ............................................. 172 OnDesignerSave ................................. 174 OnDesignerSaveAs............................. 174 OnDesignerShow................................ 174 OnDestroy........................................... 174 OnEOF................................................ 175 OnFirst ................................................ 175 OnGetCols .......................................... 176 OnGetRow .......................................... 177 OnGetSorts ......................................... 177 OnNext................................................ 182 OnOpen............................................... 182 OnRestore ........................................... 189 OnSetFilter.......................................... 191 OnSetSort............................................ 191 OnValidateRow .................................. 192 Open.................................................... 193 ProjectFile........................................... 222 Query .................................................. 223 RaveBlobDateTime ............................ 223 ReportDesc ......................................... 228 ReportDescToMemo........................... 228 ReportFullName ................................. 229 ReportName........................................ 229 RuntimeVisibility................................ 237 Save .................................................... 237 SaveRaveBlob..................................... 238 SaveToFile.......................................... 239 SaveToStream..................................... 240 SelectReport........................................ 248 StoreRAV ........................................... 262 Table ................................................... 271 UseSetRange....................................... 291 WriteBCDData ................................... 292 WriteBlobData.................................... 293 362

WriteBoolData.....................................293 WriteCurrData .....................................294 WriteDateTime ....................................294 WriteFloatData ....................................295 WriteIntData ........................................295 WriteNullData .....................................296 WriteStrData........................................296 ReadableHeight .......................................223 Rectangle Fill...........................................126 Reference Bar Code..............................................344 Column ................................................344 Control.................................................344 Font......................................................345 Graphics...............................................345 HTML..................................................345 Label ....................................................345 Memo...................................................345 Misc .....................................................346 Position ................................................346 Preview................................................346 Printer ..................................................347 Printing ................................................347 Rave.....................................................347 ReportSection ......................................348 ReportSystem.......................................348 RTF......................................................348 Shell.....................................................348 TablePrinter .........................................349 Tabs .....................................................349 Units ....................................................349 ReportSection Bottom ...................................................92 Left ......................................................148 RTF..........................................................154 S Set AsFloat ..................................................86 AsInteger ...............................................86 Shell DetailReport ........................................116 Execute ................................................123 IsReprint ..............................................144 New Page flag......................................143 Status CurrentPass..........................................112

Format..................................................260 TotalPasses ..........................................283 System - DefaultDest...............................113 T Table DataSet ................................................112 FieldName ...........................................125 GrandTotal...........................................139 Lookup DataSet Name.........................156 Lookup Display ...................................156 Lookup Key .........................................156 MasterKey ...........................................160 MasterTablePrinter ..............................161 Tabs BoxLineColor ........................................93 BoxLineXxxx ........................................93 Clear ......................................................99 Clear All ................................................98 Finish TabBox .....................................127 Get Tab ................................................137 TextFiler CPI.......................................................105 FileName .............................................126 FormFeed.............................................134 FormFeed String ..................................134 LeftBorder ...........................................148 TextFiler ..............................................340 Tutorial 01 Introduction ......................................16 02 TReportPrinter component ...............20 03 TReportFiler component...................23 04 TFilePrinter component ....................25 05 TFilePreview ....................................26 06 TReportSystem component...............28 07 TDetailShell component ...................31 08 TReportSection component ..............34 09 TMasterShell component..................36 10 TReportShell component ..................40 11 TLabelShell component....................44 12 TMemoBuf / TDBMemoBuf ............47 13 TDBTablePrinter component............50 14 TDBTableColumn ............................53 15 TTableSection component ................57 16 TTablePrinter / TTableColumn ........59 17 Fonts and the Text Line ....................60

18 Margins, Sections and Waste Areas .61 19 Columns............................................62 20 Printing Bitmaps and Graphics.........63 21 Setting up the Printer ........................64 22 Using Streams...................................65 23 Exporting to RTF..............................66 Rave 24 Quick start ....................................68 25 Data Connections..........................70 26 Customizing data connections ......71 27 Overview of TRaveProject ...........75 28 End User support ..........................77 29 Files ..............................................79 Type BoxLineXxxx ........................................93 TBKMode............................................274 TBoxLines ...........................................275 TDuplex...............................................275 TFontAlign ..........................................279 TLineHeightMethod ............................280 TMacroID............................................281 TMarginMethod ..................................281 TOrientation ........................................283 TOutputType .......................................284 TOverflowMethod...............................284 TPrintJustify ........................................284 TPrintJustifyVert .................................285 TPrintUnits ..........................................285 TReportDest ........................................286 TStreamMode......................................286 TSystemOption....................................287 TSystemOptions ..................................287 TSystemSetup......................................287 TSystemSetups ....................................287 TTabJustify..........................................288 U Underline .................................................288 W Waste Bottom...................................................92 Left ......................................................149 Right ....................................................234 Top ......................................................283

363

You might also like