Вы находитесь на странице: 1из 368

Integration Guide

Component Suite for Delphi/C++Builder

Borland

Tutorial and Reference

This manual and all material accompanying it is Copyright , 1995-2001, Nevrona Designs, All Rights Reserved. (rev BIG4A)

Table of Contents
Limited Warranty..........................................................................................................9 Technical Support...................................................................................................... 10 Tutorials .................................................................................................................... 13 Tutorial 1: Introduction to ReportPrinter Pro..........................................................14

Tutorial 2:

The TReportPrinter component ............................................................18

Tutorial 3:

The TReportFiler component................................................................21

Tutorial 4:

The TFilePrinter component.................................................................23

Tutorial 5:

The TFilePreview component...............................................................24

Tutorial 6:

The TReportSystem component............................................................26

Tutorial 7:

The TDetailShell component................................................................29

Tutorial 8:

The TReportSection class.....................................................................32

Tutorial 9:

The TMasterShell component...............................................................34

Tutorial 10: The TReportShell component...............................................................38

Tutorial 11: The TLabelShell component.................................................................42

Tutorial 12: The TMemoBuf/TDBMemoBuf classes................................................45

Tutorial 13: The TDBTablePrinter component ........................................................ 48

Tutorial 14: The TDBTableColumn component ...................................................... 51

Tutorial 15: The TTableSection component ............................................................ 55

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

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

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

Tutorial 19: Columns.............................................................................................. 60

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

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

Tutorial 22: Using Streams ..................................................................................... 63

Tutorial 23: Exporting to RTF ................................................................................ 64

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

Tutorial 25: RAVE Data Connections..................................................................... 68

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

Tutorial 27: Overview of TRaveProject................................................................... 73

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

Tutorial 29: Rave Files............................................................................................77

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

79 309

Class

Class Tree ..................................................................................................................... 309 TBaseReport ................................................................................................................. 311 TBaseShell.................................................................................................................... 312 TCanvasReport.............................................................................................................. 313 TDBMemoBuf .............................................................................................................. 314 TDBTableColumn ......................................................................................................... 315 TMemoBuf ................................................................................................................... 322 TReportSection ............................................................................................................. 330 TRPBarsBase ................................................................................................................ 335 TRPBars2of5.......................................................................................................... 335 TRPBarsCode128................................................................................................... 335 TRPBarsCode39..................................................................................................... 335 TRPBarsEAN......................................................................................................... 335 TRPBarsPostNet..................................................................................................... 335 TRPBarsUPC ......................................................................................................... 335 TRPBaseComponent ..................................................................................................... 336 TRPComponent............................................................................................................. 336 TRTFFiler..................................................................................................................... 339 TTableColumn .............................................................................................................. 340 5

TTableItem....................................................................................................................341 TTableSection ...............................................................................................................343 TTextFiler .....................................................................................................................344

Components
TDBTablePrinter ....................................................................................................316

TDetailShell ..........................................................................................................317

TFilePreview ..........................................................................................................318

TFilePrinter ............................................................................................................319

TLabelShell ............................................................................................................320

TMasterShell ..........................................................................................................321

TReportFiler ...........................................................................................................324

TReportPrinter ........................................................................................................327

TReportShell ..........................................................................................................332

TReportSystem .......................................................................................................333

TRPHTMLFiler ......................................................................................................334

TRTFFiler ..............................................................................................................339

TTablePrinter ......................................................................................................... 342

TTextFiler .............................................................................................................. 344

Appendix - Units Appendix Cross Reference by Categories Index

345 348 354

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 Rave. For fastest service contact us by e-mail or fax. Please include the product serial number (found on the disk or manual) and version of Rave along with any information related to the problem. Internet: Web page: Fax Phone: Mailing Address: tech@nevrona.com http://www.nevrona.com (602) 530-4823 Nevrona Designs 1930 South Alma School Road #B-201 Mesa, Arizona 85210-3041 news://news.nevrona.com

News Groups:

Several newsgroups are provided free of charge to assist you in getting help with our products. When you visit our newsgroups you will be connected to other users with similar interests. If you have a question, just post it to the newsgroups and others reading the newsgroups will see the message and be able to respond to it. You'll also see questions and solutions from other users as they are posted. The Nevrona Designs newsgroups are available at news://news.nevrona.com. To access the Nevrona Designs newsgroups, create a new server entry in your newsgroup reader with the Host address of news.nevrona.com and open that server. You should then see several newsgroups that you can subscribe to.

Sales Support
Internet: Phone: sales@nevrona.com (480) 491-5492

10

Connecting Rave Help File To Delphi/C++Builder's IDE By connecting Rave's Help file into Delphi's IDE, you can get context sensitive help for any Rave 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:

For Delphi 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" step. 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.

11

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 ..\RAVE4\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). Rave has completely replaced TPrinter with the TRPDevice class found in RPDEVICE.PAS (\RAVE4\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 Rave. Normally Delphi will include all necessary units when using components, however, if you try to recompile your project created with ReportPrinter 1.1 under Rave 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 Rave 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 Rave.

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 Rave. WARNING! Rave 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)

12

Upgrading from ReportPrinter Pro 3.0


If you are upgrading from ReportPrinter Pro 3.0, you should not need to make many changes to your code. Only note the following: A new DataView type has been created called TRaveSQLDataView. This is the only dataview type supported by the new Rave report server. TRaveDataView has been moved from the RVData unit to the RVDirectDataView unit.

Tutorials
Rave 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 Rave 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 Rave provides. Tutorials 2-23 are designed for those who wish to learn about the code based side of Rave 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 Rave inside and out. So, enjoy this powerful new addition to your Delphi component library and welcome to Rave!

13

Tutorial

Introduction to Rave
There are 3 different types of objects in Rave, 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 noncomponent classes that manage other reporting tasks.

Output Components TReport Printer The 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.

14

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

15

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.

16

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.

17

Tutorial

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 Rave components.

18

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.

19

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 \RAVE4\TUTOR\02 or wherever your Rave 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 Rave report. It doesn't do much, but as you can see it doesn't take much to get some quick output.

20

Tutorial

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.

21

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 \RAVE4\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 \RAVE4\SOURCE.

22

Tutorial

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 \RAVE4\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.

23

Tutorial

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. 24

Step 1: Use the project from the previous tutorial topic or load up the project TUTOR05 located in \RAVE4\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 \RAVE4\SOURCE. This is actually the preview screen used by the TReportSystem component which well get to next.

25

Tutorial

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.

26

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 Rave 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 \RAVE4\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 \RAVE4\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

27

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.

28

Tutorial

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. 29

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 \RAVE4\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 30 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 Rave 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.

31

Tutorial

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 32

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.

33

Tutorial

TMasterShell component
The TMasterShell component is the next shell component in Rave 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. 34

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 \RAVE4\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

35

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 }

36

OnRowPrint

OnGroupAfter

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;

Step 9: Initialize DetailShell1 as follows: Property SectionRow. MinHeight SectionRow. TabIndex SectionRow. FontIndex OnBodyBefore 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

OnRowAfter

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 Rave 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.

37

Tutorial

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.

10

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.

38

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 \RAVE4\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

39

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

40

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.

41

Tutorial

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.

11

42

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 Rave 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 \RAVE4\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);

43

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 Rave 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. 44

Tutorial

TMemoBuf/TDBMemoBuf component

12

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 \RAVE4\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

45

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.

46

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 \RAVE4\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.

47

Tutorial

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. 48

13

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 \RAVE4\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

49

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 Value Table3 OrderNo Times New Roman 10 OrderNo 2.0

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.

50

Tutorial

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.

14

51

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 52 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 53

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.

54

Tutorial

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.

15

55

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. 56

Tutorial

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 Rave for a more detailed example of how to use TTablePrinter.

16

57

Tutorial

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.

17

58

Tutorial

Margins, Sections and Waste Areas


Margins, Sections and Waste may appear to be similar, but there are significant differences.

18

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.

59

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):

60

Tutorial

Printing Bitmaps and Graphics

20

Printing graphics is also one of the unique features of Rave 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.

61

Tutorial

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. Rave 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.

21

62

Tutorial

Using Streams

22

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 Rave for more examples.

63

Tutorial

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 }

23

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. 64

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 }

65

Tutorial

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 66

24

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.

67

Tutorial

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

25

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.

68

Tutorial

Customizing data connections

26

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 69

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 70

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 }

71

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;

72

Tutorial

Overview of TRaveProject component

27

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: 73

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.

74

Tutorial

Providing End User design support

28

One of the more powerful features of Rave 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

75

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).

76

Tutorial

Rave Files

29

Now that Rave 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.

77

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

78

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 Rave 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

{Rave}

Declaration: procedure Abort; Category: Control Components: TReportFiler, TReportPrinter Description: 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. See Also: Aborted, Execute Example (Delphi)
procedure TRPStatusForm.CancelButtonClick(Sender:TObject); begin ReportPrinter1.Abort; end;

Example (C++ Builder)


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

79

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();

80

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();

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

( read/write )

property Active: boolean read FActive write FActive true Render TRender From the Print Setup dialog box, select the option to print to file. File types may then be selected from the combobox. Setting the active property to true, which is the default, will cause the component to be listed as one of the file formats to print to. DisplayName

81

AdjustLine method
Declaration: procedure AdjustLine; Category: Position Components: TReportFiler, TReportPrinter Description: 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. See Also: ResetLineHeight 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: procedure AllowAll; Category: Control Components: TReportFiler, TReportPrinter Description: This method will reset the valid destinations to all after they have been modified by AllowPreviewOnly or AllowPrinterOnly. See Also: 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();

82

AllowPreviewOnly method
Declaration: procedure AllowPreviewOnly; Category: Control Components: TReportFiler, TReportPrinter Description: 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). See Also: AllowAll, AllowPrinterOnly Example: See AllowAll

AllowPrinterOnly method
Declaration: procedure AllowPrinterOnly; Category: Control Components: TReportFiler, TReportPrinter Description: 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. See Also: AllowAll, AllowPreviewOnly Example: 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);

83

Arc method
Declaration: procedure Arc(X1,Y1,X2,Y2,X3,Y3,X4,Y4: double); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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). See Also: Ellipse, Pie Example (Delphi)
ReportPrinter1.Arc(1.0,1.0,3.0,3.0,3.0,2.0,0.0,0.0);

Example (C++ Builder)


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

AscentHeight property

(read only)

Declaration: property AscentHeight: double; Category: Position Components: TReportFiler, TReportPrinter Description: Returns the height of the line font above the baseline. NOTE: This applies to the line font only and not to the current textfont. See Also: 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;

84

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;

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

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

Example (C++ Builder)


ReportPrinter1->AssignFont( FontDialog1->Font );

BarBottom property

( read/write )

Declaration: property BarBottom: double; Category: Bar Code Components: TRPBarsBase Description: 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. See Also: BarTop, Bottom, PrintReadable, PrintTop Example: see Create { bar code }

85

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;

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 }

86

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;

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

87

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);

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;

88

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;

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 }

89

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

{Bar Code}

( read/write )

Declaration: property Bottom: double; Category: Bar Code Components: TRPBarsBase Description: 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. See Also: BarBottom, PrintReadable, PrintTop

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;

90

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

(read only)

Declaration: property BottomWaste: double; Category: Printer Components: TReportFiler, TReportPrinter Description: 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. See Also: LeftWaste , MarginBottom , RightWaste , TopWaste Example: See LeftWaste

91

BoxLineXxxx
Declaration: const BOXLINEXxxx; Category: Tabs Components: TReportFiler, TReportPrinter Description: 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 See Also: SetTab Example: See SetTab

constants

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;

92

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;

93

BrushCopy method
procedure BrushCopy(const Dest: TRect; Bitmap: TBitmap; const Source: TRect; Color: TColor); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: CreateRect, TBitmap, TRect, TColor Example (Delphi)
ReportPrinter1.BrushCopy(DestRect, UserBMP, SrcRect, clBlack);

Declaration:

Example (C++ Builder)


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

Buffer property

(read only)

Declaration: property Buffer: ^Array[ 0..MaxBufSize ] of Char; Category: Memo Components: TMemoBuf Description: This property is a pointer to memory buffer used by TMemoBuf. NOTE: Not normally necessary to access this property. See Also: 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;

94

CacheDir property
Declaration:

( read/write )

property CacheDir: string read FCacheDir write FCacheDir; Category: Render Components: TRenderHTML Description: If you are running the HTML component from a server, setting the CacheDir will allow you to specify where the temporary image files will be stored. See Also: ServerMode

CalcGraphicHeight method
function CalcGraphicHeight(Width: double; Graphic: TGraphic): double; Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: CalcGraphicWidth, PrintBitmap, PrintBitmapRect, StretchDraw, TBitmap Example (Delphi)
Bitmap := TBitmap.Create; Bitmap.LoadFromFile('RPDEMO.BMP'); PrintBitmapRect(X1, Y1, X1 + 3.0, CalcGraphicHeight(3.0,Bitmap),Bitmap); Bitmap.Free;

Declaration:

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;

95

CalcGraphicWidth method
Declaration: function CalcGraphicWidth(Height: double; Graphic: TGraphic): double; Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: 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;

Canvas property

(read only)

Declaration: property Canvas: TCanvas; Category: Printer Components: TReportFiler, TReportPrinter Description: 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). See Also: RPDev, TCanvas Example (Delphi)
{ Save the current canvas } ReportPrinter1.Canvas.Pen := SavePen;

Example (C++ Builder)


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

96

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

( read only )

Declaration: property CheckSum: boolean; Category: Bar Code Components: TRPBarsBase Description: 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. See Also: UseChecksum

Chord method
Declaration: procedure Chord(X1,Y1,X2,Y2,X3,Y3,X4,Y4: double); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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). See Also: Ellipse 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);

97

Clear method
Declaration: procedure Clear; Category: Preview Components: TFilePreview Description: 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. See Also: ScrollBox Example (Delphi)
FilePreview1.Clear; { Clear the preview screen }

Example (C++ Builder)


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

ClearAllTabs method
Declaration: procedure ClearAllTabs; Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: SaveTabs, ClearTabs Example (Delphi)
ClearAllTabs; { Clear all tabs, including saved tabs }

Example (C++ Builder)


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

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();

98

ClearRaveBlob method

{Rave}

Declaration: procedure ClearRaveBlob; Category: Rave Components: TRaveProject Description: 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. See Also: LoadRaveBlob, RaveBlobDateTime, SaveRaveBlob, StoreRAV Example (Delphi)
RaveProject1.ClearRaveBlob;

Example (C++ Builder)


RaveProject1->ClearRaveBlob();

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

Example (C++ Builder)


ReportPrinter1->ClearTabs();

Close method

{Rave}

Declaration: procedure Close; Category: Rave Components: TRaveProject Description: 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. See Also: Active, OnAfterClose, OnAfterOpen, OnBeforeClose, OnBeforeOpen, Open Example (Delphi)
RaveProject1.Close;

Example (C++ Builder)


RaveProject1->Close();

99

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));

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 }

100

Example (C++ Builder)


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

ColumnEnd property

(read only)

Declaration: property ColumnEnd: double; Category: Column Components: TReportFiler, TReportPrinter Description: This property will return the horizontal ending position of the current column. This can be useful for printing memo buffers inside of a column. See Also: 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);

ColumnLinesLeft method
Declaration: function ColumnLinesLeft: integer; Category: Column Components: TReportFiler, TReportPrinter Description: 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. See Also: 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 }

101

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;

Columns property

(read only)

Declaration: property Columns: integer; Category: Column Components: TReportFiler, TReportPrinter Description: This property returns the number of columns that are available from the last call to SetColumns or SetColumnWidth. See Also: SetColumns, SetColumnWidth, ColumnNum Example (Delphi)
CurrColumns := ReportPrinter1.Columns;

Example (C++ Builder)


CurrColumns = ReportPrinter1->Columns;

ColumnStart property

(read only)

Declaration: property ColumnStart: double; Category: Column Components: TReportFiler, TReportPrinter Description: This property will return the horizontal starting position of the current column. This can be useful for printing memo buffers inside of a column. See Also: ColumnNum, SetColumns, SetColumnWidth Example (Delphi)
CurrColStart := ReportPrinter1.ColumnStart;

Example (C++ Builder)


CurrColStart := ReportPrinter1->ColumnStart;

102

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;

ConstraintHeightLeft method
Declaration: function ConstraintHeightLeft(Constraint: double): double; Category: Memo Components: TMemoBuf Description: 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. NOTE: You must initialize the TMemoBuf.BaseReport before calling this method. See Also: 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;

103

Example (C++ Builder)


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

CopyRect method
Declaration: procedure CopyRect(const Dest: TRect; Canvas: TCanvas; const Source: TRect); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: 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

104

CR method
Declaration: procedure CR; Category: Position Components: TReportFiler, TReportPrinter Description: 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. See Also: LF, ColumnStart, NewLine, SectionLeft Example (Delphi)
With ReportPrinter1 do begin SectionLeft := 3.0; Println(This text is 3 inches from left); SectionLeft := 1.0; CR; end; { with }

Example (C++ Builder)


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

Create method

{Bar Code}

Declaration: constructor Create( BaseRpt: TBaseReport ); Category: Bar Code Components: TRPBarsBase Description: This constructor is called to create an instance of the Bar Code Class. The current reporting object should be passed into the BaseRpt parameter. See Also: 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;

105

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;

Create method
Declaration: constructor Create(AOwner: TComponent); Category: Misc Components: TReportFiler, TReportPrinter, TFilePrinter, TFilePreview Description: 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. See Also: 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

106

CreateBrush method
function CreateBrush(NewColor: TColor; NewStyle: TBrushStyle; NewBitmap: TBitmap): TBrush; Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: SetBrush, TBrush, TBrushStyle, TColor, TBitmap Example (Delphi)
var MyBrush: TBrush; begin MyBrush := CreateBrush(clRed, bsSolid, nil); end;

Declaration:

Example (C++ Builder)


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

107

CreateColumn method
Declaration: function CreateColumn(Description: TComponentName): TTableColumn; Category: TablePrinter Components: Column, TTableColumn, TDBTableColumn Description: 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

108

CreateFont method
function CreateFont(NewName: string; NewSize: integer): TFont; Category: Font Components: TReportFiler, TReportPrinter Description: 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. See Also: SetFont, SaveFont, RestoreFont, TFont Example (Delphi)
var MyFont: TFont; begin MyFont := CreateFont(Times New Roman,8.00); end;

Declaration:

Example (C++ Builder)


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

CreatePen method
function CreatePen(NewColor: TColor; NewStyle: TPenStyle; NewWidth: integer; NewMode: TPenMode): TPen; Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: SetPen, TPen, TPenStyle, TColor, TPenMode Example (Delphi)
MyPen := CreatePen(clBlack,psSolid,1,pmBlack);

Declaration:

Example (C++ Builder)


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

109

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: function CreateRect(X1,Y1,X2,Y2: double): TRect; Category: Graphics Components: TReportFiler, TReportPrinter Description: This method will return a TRect record initialized to the rectangle defined by the points (X1,Y1) and (X2,Y2). See Also: 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: property CurrentPage: integer; Category: Control Components: TReportFiler, TFilePreview, TReportPrinter Description: This property returns the current page number. Example (Delphi)
WITH FilePreview1 do begin PageEdit.Text := IntToStr(CurrentPage); PageLabel.Caption := 'Page ' + IntToStr(CurrentPage-FirstPage+1) + ' of ' + IntToStr(Pages); end; { with }

(read only)

Example (C++ Builder)


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

110

CurrentPass property

(read/write)

Declaration: property CurrentPass: Integer; Category: Misc Components: TReportFiler, TReportPrinter Description: 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. See Also: 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:

(read only) (read only)

property CursorXPos: longint; property CursorYPos: longint; Category: Position Components: TReportFiler, TReportPrinter Description: These properties return the horizontal and vertical text cursor position in printer units (dots). See Also: 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;

111

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: procedure Default(var Valid: boolean); Category: TablePrinter Components: TTablePrinter, TDBTablePrinter Description: This method will call the original code that would have executed if the OnGetNextRow, OnInitMaster, OnInitTable and OnValidateRow events are not overridden. See Also: 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
procedure Delete(BufPos: longint; DelLen: longint); Category: Memo Components: TDBMemoBuf, TMemoBuf Description: This method will delete DelLen characters starting at BufPos in the memo buffer. See Also: Insert Example (Delphi)
{ Delete 5 characters at current position } MemoBuf.Delete(MemoBuf.Pos,5);

Declaration:

112

Example (C++ Builder)


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

DescentHeight property

(read only)

Declaration: property DescentHeight: double; Category: Position Components: TReportFiler, TReportPrinter Description: 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. See Also: 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

{Rave}

Declaration: procedure Design; Category: Rave Components: TRaveProject Description: This method will start the execution of the Rave visual designer for the currently selected report. See Also: DesignReport, Execute, ExecuteReport, SelectReport Example (Delphi)
RaveProject1.Design;

Example (C++ Builder)


RaveProject1->Design();

113

DesignReport method

{Rave}

Declaration: procedure DesignReport(ReportName: string); Category: Rave Components: TRaveProject Description: 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. See Also: Design, Execute, ExecuteReport Example (Delphi)
RaveProject1.DesignReport(CustomerListing);

Example (C++ Builder)


RaveProject1->DesignReport(Customer Listing);

Destroy method
Declaration: destructor Destroy; Category: Misc Components: TReportFiler, TReportPrinter, TFilePrinter, TFilePreview Description: The Destroy destructor should never be called directly. To destroy a component created with Create, call the Free method. See Also: Create
Example: 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";

114

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;

115

DevMode property

(read/write)

Declaration: property DevMode: PDevMode; Category: Printer Components: TReportFiler, TReportPrinter Description: This property provides access to the TDevMode structure for the current printer. After any changes to DevMode are made, ResetPrinter should be called. See Also: 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

116

DisplayName property
Declaration:

( read/write )

property DisplayName: string read FDisplayName write SetDisplayName; Category: Render Components: TRender Description: When the Active property is set to true on a TRender component, the component will be listed in the Print to File format options. The text that will show in the dropdown list that allows you to select the component will be the same as that listed in the DisplayName property. See Also: Active

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

{Rave}

(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";

Draw method
procedure Draw(X,Y: double; Graphic: TGraphic); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: 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;

Declaration:

117

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;

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

118

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;

DriverName property

(read only)

Declaration: property DriverName: string; Category: Printer Components: TReportFiler, TReportPrinter Description: 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;

119

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: procedure Ellipse(X1,Y1,X2,Y2: double); Category: Graphics Components: TReportFiler, TReportPrinter Description: This method draws an ellipse bounded by the rectangle defined by (X1,Y1) and (X2,Y2). See Also: 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);

Empty method
Declaration: function Empty: boolean; Category: Memo Components: TDBMemoBuf, TMemoBuf Description: 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. See Also: Pos, Size Example (Delphi)
If not MemoBuf1.Empty then begin PrintMemo(MemoBuf1,0,false); end; { if }

120

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);

Example (C++ Builder)


DBTablePrinter1->Execute(NULL);

121

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

{ Output components }

Declaration: procedure Execute; Category: Control Components: TFilePreview, TFilePrinter, TReportFiler, TReportPrinter, TReportSystem Description: 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. See Also: Abort, Printing, All printing event handlers Example (Delphi)
ReportPrinter1.Execute;

Example (C++ Builder)


ReportPrinter1->Execute();

122

Execute method

{ Framework components }

Declaration: procedure Execute(Report: TBaseReport); Category: Control Components: TDetailShell, TLabelShell, TMasterShell, TReportShell, TDBTablePrinter. TTablePrinter Description: 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). See Also: 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

{Rave}

Declaration: procedure Execute; Category: Rave Components: TRaveProject Description: 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. See Also: ExecuteReport, SelectReport Example (Delphi)
RaveProject1.Execute;

Example (C++ Builder)


RaveProject1->Execute();

ExecuteCustom method
Declaration: procedure ExecuteCustom(NewFirstPage: integer; NewLastPage: integer; NewCopies: integer); Category: Control Components: TFilePrinter Description: 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. See Also: 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: procedure ExecuteReport(ReportName: string); Category: Rave Components: TRaveProject Description: 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. See Also: 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

( read only )

Declaration: property ExtendedText: string; Category: Bar Code Components: TRPBarsCode39 Description: When Extended is true, this property will contain the converted Code39 text that will be printed in the bar code. See Also: 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

(write only)

Declaration: property Field: TMemoField; Category: Memo Components: TDBMemoBuf Description: This property will assign the contents of a TMemoField component to the memo buffer. See Also: Pos, Size, TMemoField Example (Delphi)
MemoBuf1.Field := MyMemoField;

Example (C++ Builder)


MemoBuf->Field = MyMemoField;

FieldAliasList property

{Rave}

(read/write/pub)

Declaration: property FieldAliasList: TStrings; Default: (blank) Components: All TRaveDataConnection components Description: 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: procedure Finish; Category: Control Components: TFilePreview, TReportFiler, TReportPrinter Description: 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. See Also: Start Example (Delphi)
FilePreview1.Finish;

Example (C++ Builder)


FilePreview1->Finish();

126

FinishTabBox method
Declaration: procedure FinishTabBox(Width: integer); Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: SetTab 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
procedure FloodFill(X,Y: double; Color: TColor; FillStyle: TFillStyle); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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.) See Also: PageInvalid, TColor Example (Delphi)
FloodFill(2.0,3.0,clRed,fsBorder);

Declaration:

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)
SetFont( Wingdings, 10 ); FontCharSet := SYMBOL_CHARSET;

Example (C++ Builder)


rp->SetFont( Wingdings, 10 ); rp->FontCharSet = SYMBOL_CHARSET;

FontColor property
Declaration: Default: Category: Components: Description: See Also: property FontColor: TColor; clBlack Font TReportFiler , TReportPrinter Returns or sets the font color. Other FontXxxx properties, SetFont, TColor

(read/write)

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

(read only)

Declaration: property FontHandle: HFont; Category: Font Components: TReportFiler, TReportPrinter Description: 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: procedure FrameRect(const Rect: TRect); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: 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: procedure FreeSaved; Category: Memo Components: TDBMemoBuf, TMemoBuf Description: 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. See Also: SaveBuffer, RestoreBuffer Example (Delphi)
MemoBuf1.FreeSaved;

Example (C++ Builder)


MemoBuf1->FreeSaved();

GetMemoLine method
function GetMemoLine( MemoBuf: TMemoBuf; var EOL: boolean): string; Category: Memo Components: TReportFiler, TReportPrinter Description: 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. See Also: PrintMemo, MemoLines, TMemoBuf Example (Delphi)
Println(GetMemoLine(MemoBuf, EOL));

Declaration:

Example (C++ Builder)


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

GetNextLine method
Declaration: function GetNextLine(var EOL: boolean): string; Category: Memo Components: TReportFiler, TReportPrinter Description: 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. NOTE: You must initialize the TMemoBuf.BaseReport before calling this method. See Also: PrintMemo, MemoLines, TMemoBuf Example (Delphi)
Println(GetNextLine(EOL));

136

Example (C++ Builder)


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

GetReportCategoryList method
Declaration:

{Rave}

procedure GetReportCategoryList(ReportList: TStrings; Categories: string); FullName: boolean); Category: Rave Components: TRaveProject Description: 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. Note: The double "; ;" at the end of the category list is to include all reports where the category is not defined (the default value). See Also: SelectReport

GetReportList method
Declaration:

{Rave}

procedure GetReportList(ReportList: TStrings; FullName: boolean); Category: Rave Components: TRaveProject Description: 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. See Also: SelectReport

GetTab method
Declaration: function GetTab(Index: integer): PTab; Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: TabIndex

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
procedure GotoXY(NewXPos: double; NewYPos: double); Category: Position Components: TReportFiler, TReportPrinter Description: This method will move the text cursor to the position NewXPos, NewYPos. See Also: 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');

Declaration:

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:
procedure GraphicFieldToBitmap(GraphicField: TGraphicField; Bitmap: TBitmap);

Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: 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

{Bar Code}

( read only )

Declaration: property Height: double; Category: Bar Code Components: TRPBarsBase Description: 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. See Also: 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: procedure Home; Category: Position Components: TReportFiler, TReportPrinter Description: 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

ImageQuality property
Declaration:

( read/write )

property ImageQuality: TimageQualityRange read FimageQuality write FImageQuality Default: JPGS image quality set to 90. Category: Render Components: TRPRenderPDF Description: When sending images out to PDF, the bitmaps, metafiles, etc., are converted to JPGs in order to allow PDF to print them. By default the image quality for JPGs is set to 90. If you need to change the image quality, you can do this by setting the ImageQuality property. Valid values are 1 to 100 with 100 being the absolute best quality available. See Also: MetafileDPI

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

Declaration:

Example (C++ Builder)


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

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

Declaration:

Example (C++ Builder)


MemoBuf1->InsertMemoBuf(10,MemoBuf2);

143

IsNewPage property

(read only)

Declaration: property IsNewPage: boolean; Category: Shell Components: TDetailShell, TMasterShell, TReportShell Description: 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;

Example (C++ Builder)


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

IsReprint property

(read only)

Declaration: property IsReprint: boolean; Category: Shell Components: TDetailShell, TMasterShell, TReportShell Description: 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). See Also: 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();

144

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

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;

145

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 }

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;

146

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

(read/write/pub)

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

Example (Delphi)
LabelShell1.LabelHeight := 0.75;

Example (C++ Builder)


LabelShell1->LabelHeight = 0.75;

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;

147

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;

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

148

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: property LeftMethod: TDistanceMethod; dmMargin (except TopMethod is dmSpecial) ReportSection TReportSection BottomMethod (for description and example), Left

(read/write/pub)

LeftWaste property

(read only)

Declaration: property LeftWaste: double; Category: Printer Components: TReportFiler, TReportPrinter Description: 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. See Also: 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 }

149

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

LF method
Declaration: procedure LF; Category: Position Components: TReportFiler, TReportPrinter Description: 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. See Also: CR, LineHeight, LineNum, NewLine, SectionBottom, SectionTop 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;

150

LineHeight property

(read/write)

Declaration: property LineHeight: double; Category: Position Components: TReportFiler, TReportPrinter Description: 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. See Also: 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

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: function LinesLeft: integer; Category: Position Components: TReportFiler, TReportPrinter Description: This method will return the number of lines that can be printed above the current SectionBottom including the current line. See Also: 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: procedure LineTo(X,Y: double); Category: Graphics Components: TReportFiler, TReportPrinter Description: This method will draw a line using the current pen from the previous graphic cursor position to the point specified by (X,Y). See Also: 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

Memo

Declaration: function LoadFromFile( FileName: String); Category: Memo Components: TDBMemoBuf, TMemoBuf Description: This method will load a memo buffer with the contents of a text file. To load RTF text, use RTFLoadFile. See Also: LoadFromStream, RTFLoadFromFile, SaveToStream Example (Delphi)
MemoBuf1.LoadFromFile(Letter.Txt);

Example (C++ Builder)


MemoBuf1->LoadFromFile(Letter.Txt);

LoadFromFile method

{Rave}

Declaration: procedure LoadFromFile(FileName: string); Category: Rave Components: TRaveProject Description: This method will load the report project file specified by the FileName parameter as the current Rave project. See Also: LoadFromStream, SaveToFile, SaveToStream Example (Delphi)
RaveProject1.LoadFromFile(Project1.Rav);

Example (C++ Builder)


RaveProject1->LoadFromFile(Project1.Rav);

154

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

Declaration:

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

{Rave}

Declaration: procedure LoadRaveBlob(Stream: TStream); Category: Rave Components: TRaveProject Description: 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. See Also: ClearRaveBlob, RaveBlobDateTime, SaveRaveBlob, StoreRAV Example (Delphi)
RaveProject1.LoadRaveBlob( MyStream );

Example (C++ Builder)


RaveProject1->LoadRaveBlob( MyStream );

155

LocalFilter property
Declaration: Default:

{Rave}

(read/write/pub)

property LocalFilter: Boolean; False TRPQueryConnection and TRPTableConnection True TRPCustomConnection and TRPDataSetConnection Category: Rave Components: TRPCustomConnection Description: 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: function Macro(MacroID: TMacroID): string; Category: Printing Components: TReportFiler, TReportPrinter Description: 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. See Also: TMacroID, MacroData 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: function MemoHeightLeft: double; Category: Memo Components: TMemoBuf Description: This method will return the height necessary to print the memo buffer for the current font between PrintStart and PrintEnd. NOTE: You must initialize the TMemoBuf.BaseReport before calling this method. See Also: 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: function MemoLines(MemoBuf: TMemoBuf): longint; Category: Memo Components: TReportFiler, TReportPrinter Description: This method will return the number of lines necessary to print the memo buffer MemoBuf for the current font between PrintStart and PrintEnd. See Also: 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: function MemoLinesLeft: longint; Category: Memo Components: TMemoBuf Description: This method will return the number of lines necessary to print the memo buffer for the current font between PrintStart and PrintEnd. NOTE: You must initialize the TMemoBuf.BaseReport before calling this method. See Also: PrintEnd, PrintMemo, PrintStart, TMemoBuf, MemoHeightLeft Example (Delphi)
MemoBuf.BaseReport := Sender as TBaseReport; LinesLeft := MemoBuf.MemoLinesLeft;

Example (C++ Builder)


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

MetafileDPI property
Declaration:

( read/write )

property MetafileDPI: integer read FMetafileDPI write FMetafileDPI Default: 300 Category: Render Components: TRPRenderPDF Description: The MetafileDPI property can be used to increase or decrease the dots per inch used when saving the images in the PDF file. The higher the dots per inch the better quality the image will appear to have. The down side to a higher dots per inch is that the file size of the PDF will increase. See Also: ImageQuality

163

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;

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;

164

MoveTo method
Declaration: procedure MoveTo(X,Y: double); Category: Graphics Components: TReportFiler, TReportPrinter Description: This method will move the current graphic cursor position to the point specified by (X,Y). See Also: LineTo Example (Delphi)
ReportPrinter1.MoveTo( NewX, NewY );

Example (C++ Builder)


ReportPrinter1->MoveTo( NewX, NewY );

NewColumn method
Declaration: Category: Components: Description: See Also: procedure NewColumn; Control TReportFiler, TReportPrinter This method will move the cursor to top of the next column. SetColumns, SetColumnWidth

Example (Delphi)
ReportPrinter1.NewColumn;

Example (C++ Builder)


ReportPrinter1->NewColumn();

NewLine method
Declaration: procedure NewLine; Category: Position Components: TReportFiler, TReportPrinter Description: This method performs a carriage return (CR) followed by a line feed (LF), then resets the tabs. See Also: ColumnStart, CR, LF, ResetTabs Example (Delphi)
ReportPrinter1.NewLine;

Example (C++ Builder)


ReportPrinter1->NewLine();

165

NewPage method
Declaration: procedure NewPage; Category: Control Components: TReportFiler, TReportPrinter Description: 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. See Also: AbortPage, OnNewPage, OnPrintHeader, OnPrintFooter Example (Delphi)
ReportPrinter1.NewPage;

Example (C++ Builder)


ReportPrinter1->NewPage();

NewPara method
Declaration: procedure NewPara; Category: Control Components: TRPHTMLFiler, TRTFFiler Description: 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. See Also: NewLine Example (Delphi)
RTFFiler1.NewPara;

Example (C++ Builder)


RTFFiler1->NewPara();

NextPage method
Declaration: procedure NextPage; Category: Preview Components: TFilePreview Description: 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. See Also: PrevPage, CurrentPage, OnPageChange Example (Delphi)
FilePreview1.NextPage;

Example (C++ Builder)


FilePreview1->NextPage();

166

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;

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;

167

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, Rave 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;

NoPrinterPageHeight property NoPrinterPageWidth


Declaration:

(read/write) (read/write)

property NoPrinterPageHeight: double; property NoPrinterPageWidth: double; Default: 11.0 and 8.5 Category: Printer Components: TReportFiler Description: These properties define the page width and height for the print preview screen if no printers are defined for the current Windows system. See Also: NoPrinters
Example: See NoPrinters

NoPrinters method
Declaration: function NoPrinters: boolean; Category: Printer Components: TReportFiler, TReportPrinter Description: 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. See Also: NoPrinterPageHeight, NoPrinterPageWidth Example (Delphi)
IF NoPrinters then begin NoPrinterPageHeight := 8.5; NoPrinterPageWidth := 11.0; end; { if }

{ Set up for landscape paper }

168

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;

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

(read/write/pub)

Declaration: procedure OnAddTotal(TableColumn: TTableColumn); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event is called to update the totals, GrandTotal, PageTotal and SubTotal for a table column. See Also: 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 169

OnAfterClose event
Declaration: Category: Components: Description: See Also:

{Rave}

(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

OnAfterPrint event

(read/write/pub)

Declaration: procedure OnAfterPrint(Sender: TObject) Category: Control Components: TReportFiler, TReportPrinter, TReportSystem Description: 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. See Also: 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

170

OnBeforeClose event
Declaration: Category: Components: Description: See Also:

{Rave}

(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

OnBeforePrint event

(read/write/pub)

Declaration: procedure OnBeforePrint(Sender: TObject); Category: Control Components: TReportFiler, TReportPrinter, TReportSystem Description: 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). See Also: 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 }

171

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:

(read/write/pub)

procedure OnBodyAfter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Category: Shell Components: TDetailShell, TMasterShell, TReportShell Description: This is where you de-initialize resources used in the body of the report. See Also: OnBodyBefore, OnBodyFooter, OnBodyHeader

OnBodyBefore event
Declaration:

(read/write/pub)

procedure OnBodyBefore(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Category: Shell Components: TDetailShell, TMasterShell, TReportShell Description: This is where you initialize resources for use in the body of the report. See Also: OnBodyAfter, OnBodyFooter, OnBodyHeader

OnBodyFooter event OnBodyHeader event


Declaration:

(read/write/pub) (read/write/pub)

procedure OnBodyFooter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); procedure OnBodyHeader(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Category: Shell Components: TDetailShell, TMasterShell, TReportShell Description: These events are called to print the body header or footer for a shell report. See Also: SectionBodyHeader, SectionBodyFooter, PrintBodyHeader, PrintBodyFooter

172

OnCompress property
Declaration:

( read/write )

property OnCompress: TcompressEvent read FonCompress write FonCompress; Default: Category: Render Components: TRPRenderPDF Description: This property that can be assigned to an event. The event must be defined if you want to compress the page stream in the PDF file. You will also need to set the UseCompression property to true if you want the page stream compressed. Typically the code defined inside the OnCompress event will be something similar to this: See Also: UseCompression Example Typically, the code defined inside the OnCompress event will be something similar to this: With TCompressionStream.Create(clMax, OutStream) do try CopyFrom(InStream, InStream.Size); finally Free; end; { with }

OnCreate event

{Rave}

(read/write/pub)

Declaration: procedure OnCreate(Sender: TObject); Category: Rave Components: TRaveProject Description: 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. See Also: OnDestroy

173

OnDecodeImage event
Declaration:

(read/write/pub)

procedure OnDecodeImage( Sender: TObject); ImageStream: TStream; ImageType: String; Bitmap: TBitmap ); Category: Graphics Components: TReportFiler , TReportPrinter Description: This event is called when Rave 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. See Also: 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

174

OnDesignerSave event

{Rave}

(read/write/pub)

Declaration: procedure OnDesignerSave(Sender: TObject); Category: Rave Components: TRaveProject Description: 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. See Also: OnDesignerSaveAs, OnDesignerShow, SaveToStream

OnDesignerSaveAs event

{Rave}

(read/write/pub)

Declaration: procedure OnDesignerSaveAs(Sender: TObject); Category: Rave Components: TRaveProject Description: 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. See Also: OnDesignerSave, OnDesignerShow, SaveToStream

OnDesignerShow event

{Rave}

(read/write/pub)

Declaration: procedure OnDesignerShow(Sender: TObject); Category: Rave Components: TRaveProject Description: 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. See Also: OnDesignerSave

OnDestroy event

{Rave}

(read/write/pub)

Declaration: procedure OnDestroy(ReportPrinter: TRave); Category: Rave Components: TRaveProject Description: 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. See Also: OnCreate

175

OnDetailAfter event OnDetailBefore event


Declaration:

(read/write/pub) (read/write/pub)

procedure OnDetailAfter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); procedure OnDetailBefore(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Default: nil Category: Shell Components: TMasterShell, TReportShell Description: These events are called before and after the detail section of a shell report is printed. See Also: 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:

(read/write/pub)

procedure OnEOF(Connection: TRPCustomConnection; var Eof: Boolean); Category: Rave Components: DataConnection Description: 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. See Also: OnFirst, OnNext

OnFirst event

{Rave}

(read/write/pub)

Declaration: procedure OnFirst(Connection: TRPCustomConnection); Category: Rave Components: DataConnection Description: 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. See Also: 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

176

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:

(read/write/pub)

procedure OnFooterHeight( TableColumn: TTableColumn; var Height,MinHeight: Double); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event acts much like OnRowHeight except that it is called to override the height of a footer row box. See Also: OnHeaderHeight, OnRowHeight

OnFooterPrint event
Declaration:

(read/write/pub)

procedure OnFooterPrint( TableColumn: TTableColumn; var Height, MinHeight: Double); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event is called to print the contents of a column footer. See Also: OnFooterSetup

OnFooterSetup event

(read/write/pub)

Declaration: procedure OnFooterSetup(TableColumn: TTableColumn); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event is called to setup the contents of a column footer after it is initialized but before it is printed. See Also: OnFooterPrint

OnGetCols event

{Rave}

(read/write/pub)

Declaration: procedure OnGetCols(Connection: TRPCustomConnection); Category: Rave Components: DataConnection Description: 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. See Also: OnGetRow

177

OnGetNextRow event
Declaration:

(read/write/pub)

procedure OnGetNextRow( TablePrinter: TTablePrinter; var Valid: Boolean); Category: TablePrinter Components: TTablePrinter, TDBTablePrinter Description: 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. See Also: OnValidateRow
{Rave}

OnGetRow event

(read/write/pub)

Declaration: procedure OnGetRow(Connection: TRPCustomConnection); Category: Rave Components: DataConnection Description: 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. See Also: OnFirst, OnNext

OnGetSorts event

{Rave}

(read/write/pub)

Declaration: procedure OnGetSorts(Connection: TRPCustomConnection); Category: Rave Components: DataConnection Description: 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. See Also: 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

178

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:

(read/write/pub)

procedure OnGroupFooter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Default: nil Category: Shell Components: TMasterShell, TReportShell Description: This event is called to print the group footer for a shell report. See Also: SectionGroupHeader, SectionGroupFooter

OnGroupHeader event
Declaration:

(read/write/pub)

procedure OnGroupHeader(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Default: nil Category: Shell Components: TMasterShell, TReportShell Description: This event is called to print the group header for a shell report. See Also: SectionGroupHeader, SectionGroupFooter 179

OnHeaderAfter event OnHeaderBefore event


Declaration:

(read/write/pub) (read/write/pub)

procedure OnHeaderAfter(TableColumn: TTableColumn); procedure OnHeaderBefore(TableColumn: TTableColumn); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: These events are called before and after a table column header prints. See Also: OnHeaderPrint

OnHeaderHeight event
Declaration:

(read/write/pub)

procedure OnHeaderHeight( TableColumn: TTableColumn; var Height,MinHeight: Double); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event acts much like OnRowHeight except that it is called to override the height of a header row box. See Also: OnFooterHeight, OnRowHeight

OnHeaderPrint event
Declaration:

(read/write/pub)

procedure OnHeaderPrint( TableColumn: TTableColumn; var Height, MinHeight: Double); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event is called to print the contents of a table column header. See Also: 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 { Table Column } (read/write/pub)

OnInitMaster event

Declaration: procedure OnInitMaster(TableColumn: TTableColumn); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: 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.

180

OnInitMaster event
Declaration:

{ Table Printer } (read/write/pub)

procedure OnInitMaster( TablePrinter: TTablePrinter; var Valid: Boolean); Category: TablePrinter Components: TTablePrinter, TDBTablePrinter Description: 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). See Also: 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:

(read/write/pub)

procedure OnInitTable( TablePrinter: TTablePrinter; var Valid: Boolean); Category: TablePrinter Components: TTablePrinter, TDBTablePrinter Description: 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)

ReportPrinter: TBaseReport; LabelShell: TLabelShell; var Valid: Boolean); procedure OnLabelBefore( ReportPrinter: TBaseReport; LabelShell: TLabelShell; var Valid: Boolean); Category: Label Components: TLabelShell Description: This is where you would initialize or de-initialize any resources for a label See Also: OnLabelPrint

OnLabelPrint event
Declaration: procedure OnLabelPrint(

(read/write/pub)
ReportPrinter: TBaseReport; LabelShell: TLabelShell; var Valid: Boolean);

Category: Label Components: TLabelShell Description: This event is called to print the contents of each label. See Also: Col, Row

181

OnNewColumn event

(read/write/pub)

Declaration: procedure OnNewColumn(Sender: TObject); Category: Control Components: TReportFiler, TReportPrinter, TReportSystem Description: 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. See Also: 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

(read/write/pub)

Declaration: procedure OnNewPage(Sender: TObject); Category: Control Components: TReportFiler, TReportPrinter, TReportSystem Description: This event will be called whenever a new page is generated. This can be useful to initialize page related items. See Also: 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;

182

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

{Rave}

(read/write/pub)

Declaration: procedure OnNext(Connection: TRPCustomConnection); Category: Rave Components: DataConnection Description: 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. See Also: OnFirst, OnEOF

OnOpen event

{Rave}

(read/write/pub)

Declaration: procedure OnOpen(Connection: TRPCustomConnection); Category: Rave Components: DataConnection Description: 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. See Also: OnRestore

OnOverFlow event

(read/write/pub)

Declaration: procedure OnOverflow(TableColumn: TTableColumn); Category: TablePrinter Components: TDBTableColumn, TTableColumn Description: 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. See Also: OverflowMethod

183

OnPageAfter event OnPageBefore event


Declaration:

(read/write/pub) (read/write/pub)

procedure OnPageAfter(ReportPrinter: TBaseReport; LabelShell: TLabelShell); procedure OnPageBefore(ReportPrinter: TBaseReport; LabelShell: TLabelShell); Default: nil Category: Shell Components: TReportShell, TLabelShell Description: These events are called before and after each page of a shell report.

OnPageChange event

(read/write/pub)

Declaration: procedure OnPageChange(Sender: TObject); Category: Preview Components: TFilePreview Description: 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. See Also: 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); }

184

OnPageFooter event OnPageHeader event


Declaration:

(read/write/pub) (read/write/pub)

procedure OnPageFooter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); procedure OnPageHeader(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Default: nil Category: Shell Components: TReportShell Description: These events are called to print the page header and footer for a shell report. See Also: SectionPageHeader, SectionPageFooter, PrintPageHeader PrintPageFooter

OnPreviewSetup event

( read/write/pub )

Declaration: procedure OnPreviewSetup( Sender: TObject ); Category: Preview Components: TReportSystem Description: 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. See Also: 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; }

185

OnPreviewShow event

( read/write/pub )

Declaration: procedure OnPreviewShow( Sender: TObject ); Category: Preview Components: TFilePreview, TReportSystem Description: 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. See Also: 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

{ Output }

(read/write/pub)

Declaration: procedure OnPrint(Sender: TObject); Category: Control Components: TReportFiler, TReportPrinter, TReportSystem Description: 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. See Also: 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 }

186

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

(read/write/pub)

Declaration: procedure OnPrintFooter(Sender: TObject); Category: Control Components: TReportFiler, TReportPrinter, TReportSystem Description: 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. See Also: 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; }

187

OnPrintHeader event

(read/write/pub)

Declaration: procedure OnPrintHeader(Sender: TObject); Category: Control Components: TReportFiler, TReportPrinter, TReportSystem Description: 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. See Also: 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; }

188

OnPrintPage event
Declaration:

(read/write/pub)

function OnPrintPage( Sender: TObject; var PageNum: Integer): Boolean; Category: Control Components: TReportFiler, TReportPrinter, TReportSystem Description: 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. See Also: 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(); }

189

OnReportAfter event OnReportBefore event


Declaration:

(read/write/pub) (read/write/pub)

procedure OnReportAfter(ReportPrinter: TBaseReport; LabelShell: TLabelShell); procedure OnReportBefore(ReportPrinter: TBaseReport; LabelShell: TLabelShell); Default: nil Category: Shell Components: TReportShell, TLabelShell Description: These events are called before and after a shell report.

OnReportFooter event OnReportHeader event


Declaration:

(read/write/pub) (read/write/pub)

procedure OnReportFooter(ReportPrinter: TBaseReport; ReportShell: TDetailShell); procedure OnReportHeader(ReportPrinter: TBaseReport; ReportShell: TDetailShell); Default: nil Category: Shell Components: TReportShell Description: This is where you put the output that goes into the report header or footer. See Also: SectionReportHeader, SectionReportFooter, PrintReportHeader, PrintReportFooter

OnRestore event

{Rave}

(read/write/pub)

Declaration: procedure OnRestore(Connection: TRPCustomConnection); Category: Rave Components: DataConnection Description: 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. See Also: OnOpen

OnRowAfter event
Declaration: Category: Components: Description: See Also:

{ Shell }

(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

190

OnRowAfter event
Declaration:

{ Table Printer }

(read/write/pub)

property OnRowBefore: TTableColumnEvent; property OnRowAfter: TTableColumnEvent; Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event is called after each table column row prints. See Also: OnRowBefore, OnRowPrint

OnRowBefore event
Declaration: Category: Components: Description: See Also:

{ Shell }

(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:

(read/write/pub)

procedure OnRowHeight( TableColumn: TTableColumn; var Height, MinHeight: Double); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event allows the programmer to override the default height for a column row. See Also: OnRowPrint

OnRowPrint event
Declaration: procedure OnRowPrint(

{ Shell }

(read/write/pub)

ReportPrinter: TBaseReport; ReportShell: TDetailShell; var Valid: Boolean);

Category: Shell Components: TDetailShell, TMasterShell, TReportShell Description: 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. See Also: PrintRow, SectionRow

191

OnRowPrint event
Declaration:

{ Table Printer }

(read/write/pub)

procedure OnRowPrint( TableColumn: TTableColumn; var Height, MinHeight: Double); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event is called to print the contents of the current column. See Also: OnRowSetup

OnRowSetup event

(read/write/pub)

Declaration: procedure OnRowSetup(TableColumn: TTableColumn); Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This event is called after the contents for the current column have been initialized, but before it is printed. See Also: MemoBuf, OnRowPrint

OnSetFilter event

{Rave}

(read/write/pub)

Declaration: procedure OnSetFilter(Connection: TRPCustomConnection); Category: Rave Components: DataConnection Description: 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. See Also: OnSetSort

OnSetSort event

{Rave}

(read/write/pub)

Declaration: procedure OnSetSort(Connection: TRPCustomConnection); Category: Rave Components: DataConnection Description: This event is called when the Rave data system wants to sort the data. See the tutorial on customizing data connections for more information. See Also: 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

192

OnValidateRow event
Declaration:

{Rave}

(read/write/pub)

procedure OnValidateRow(Connection: TRPCustomConnection; var ValidRow: boolean);

Category: Rave Components: DataConnection Description: 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. See Also: OnSetFilter

OnValidateRow event
Declaration:
procedure OnValidateRow(

(read/write/pub)
TablePrinter: TTablePrinter; var Valid: Boolean);

Category: TablePrinter Components: TTablePrinter Description: 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. See Also: OnGetNextRow

OnZoomChange event

(read/write/pub)

Declaration: procedure OnZoomChange(Sender: TObject); Category: Preview Components: TFilePreview Description: 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. See Also: 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(); }

193

Open method

{Rave}

Declaration: procedure Open; Category: Rave Components: TRaveProject Description: This method will open the report project file defined by ProjectFile to make it available for printing or modification. See Also: 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


property OriginX: double; property OriginY: double; Default: 0.0 Category: Position Components: TReportFiler, TReportPrinter Description: These properties return or set the currently defined origin. Declaration:

(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;

194

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;

195

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

196

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:

(read/write)

procedure OnOverridePreview(ReportSystem: TReportSystem; OverrideMode: TOverrideMode; var OverrideForm: TForm);

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.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:
procedure OnOverrideStatus(

(read/write)
ReportSystem: TReportSystem; OverrideMode: TOverrideMode; var OverrideForm: TForm);

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.OverrideStatusProc

197

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

(read only)

Declaration: property PageInvalid: boolean; Category: Control Components: TReportFiler, TReportPrinter Description: 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. See Also: 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

198

Pages property

(read only)

Declaration: property Pages: integer; Category: Preview Components: TFilePreview Description: This property returns the total number of pages that exist inside the report file for a preview screen. See Also: 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;

199

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");

200

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: procedure Pie(X1,Y1,X2,Y2,X3,Y3,X4,Y4: double); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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). See Also: Arc, Ellipse 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);

201

PIVar method
Declaration: function PIVar(PIVarName: String): String; Category: Printing Components: TReportFiler , TReportPrinter , TReportSystem Description: 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. See Also: SetPIVar 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: procedure Polygon(const Points: array of TPoint); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: 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);

202

Polyline method
Declaration: procedure Polyline(const Points: array of TPoint); Category: Graphics Components: TReportFiler, TReportPrinter Description: This method will draw a series of lines using the current pen connecting the points defined in the open array Points. See Also: CreatePoint, TPoint 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); -1 ); 0.81); -0.31); -0.31); 0.81); -1);

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: function PopFont: boolean; Category: Font Components: TReportFiler, TReportPrinter Description: 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. See Also: 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();

203

PopPos method
Declaration: function PopPos: boolean; Category: Position Components: TReportFiler, TReportPrinter Description: 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. See Also: 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: function PopTabs: boolean; Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: 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();

204

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

( read/write )

Declaration: property Position: double; Category: Bar Code Components: TRPBarsBase Description: 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. See Also: 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: procedure PrevPage; Category: Preview Components: TFilePreview Description: 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. See Also: NextPage, CurrentPage, OnPageChange Example (Delphi)
FilePreview1.PrevPage;

Example (C++ Builder)


FilePreview1->PrevPage();

205

Print method
Declaration: procedure Print(Text: string); Category: Printing Components: TReportFiler, TReportPrinter Description: 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. See Also: all other print functions Example (Delphi)
ReportPrinter1.Print(Hello World!);

Example (C++ Builder)


ReportPrinter1->Print(Hello World!);

Print method

{ Bar Code }

Declaration: procedure Print; Category: Bar Code Components: TRPBarsBase Description: 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. See Also: GotoXY, PrintReadable, PrintTop, PrintXY, Text Example (Delphi)
BarCode1.Text := 12345; BarCode1.Print;

Example (C++ Builder)


BarCode1->Text = 12345; BarCode1->Print();

PrintBitmap method
Declaration: procedure PrintBitmap(X,Y: double; ScaleX, ScaleY: double; Bitmap: TBitmap); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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 );

206

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
procedure PrintBitmapRect(X1,Y1,X2,Y2: double; Bitmap: TBitmap); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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). See Also: 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;

Declaration:

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
procedure PrintBlock(Text: string; Pos: double; Width: double); Category: Printing Components: TReportFiler, TReportPrinter Description: This method will print Text on the current line starting The text will be block justified within the area defined by Width. See Also: All other print functions Example (Delphi)
PrintBlock('This is block justified text',0.5,4.0);

Declaration:

at

Pos.

Example (C++ Builder)


Rp->PrintBlock(This is block justified text,0.5,4.0);

207

PrintBodyFooter method PrintBodyHeader method


procedure PrintBodyHeader; procedure PrintBodyFooter; Category: Shell Components: TDetailShell, TMasterShell, TReportShell Description: These methods will reprint the body header or footer by calling the OnBodyHeader or OnBodyFooter events with IsReprint set to true. See Also: OnBodyHeader, OnBodyFooter Example (Delphi)
MasterShell1.PrintBodyHeader;

Declaration:

Example (C++ Builder)


MasterShell1->PrintBodyHeader();

PrintBox method
Declaration: procedure PrintBox; Category: TablePrinter Components: TTableColumn, TDBTableColumn, TTableSection Description: 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. See Also: 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;

208

PrintCenter method
procedure PrintCenter(Text: string; Pos: double); Category: Printing Components: TReportFiler, TReportPrinter Description: This method will print the string, Text, on the current line centered horizontally at the position, Pos. See Also: all other print functions Example (Delphi)
PrintCenter('Text centered at 2.0', 2.0);

Declaration:

Example (C++ Builder)


rp->PrintCenter(Text centered at 2.0, 2.0);

PrintCharJustify method
procedure PrintCharJustify(Text: string; Ch: char; Pos: double); Category: Printing Components: TReportFiler, TReportPrinter Description: 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. See Also: PrintLeft, PrintRight Example (Delphi)
{ Print the number justified by the decimal point PrintCharJustify(NumStr,.,4.25); }

Declaration:

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

209

PrintData method
Declaration: procedure PrintData(Value: string); Category: Printer Components: TRPHTMLFiler, TReportFiler, TReportPrinter Description: 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
procedure PrintDataStream(Stream: TStream; BufSize: longint); Category: Printer Components: TReportFiler, TReportPrinter Description: 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. See Also: PrintData Example (Delphi)
MyFileStream := TFileStream.Create('PAGE.PCL', fmOpenRead); PrintDataStream(MyFileStream,0); MyFileStream.Free;

Declaration:

Example (C++ Builder)


MyFileStream = new TFileStream(PAGE.PCL, fmOpenRead); rp->PrintDataStream(MyFileStream,0); delete MyFileStream;

210

PrintDefault method

{ Table }

Declaration: procedure PrintDefault; Category: TablePrinter Components: TTableColumn, TDBTableColumn, TTableSection Description: 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. See Also: PrintBox

PrintDetail method
Declaration: procedure PrintDetail Category: Shell Components: TMasterShell, TReportShell Description: This method will reprint the detail section of the group by calling OnDetailBefore, DetailReport.Execute and then OnDetailAfter with IsReprint set to true. See Also: 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;

211

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: procedure PrintFimA( X,Y: double ); procedure PrintFimB( X,Y: double ); procedure PrintFimC( X,Y: double ); Category: Bar Code Components: TRPBarsPostNet Description: 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);

212

PrintFooter method
procedure PrintFooter(Text: string; Justify: TPrintJustify); Category: Printing Components: TReportFiler, TReportPrinter Description: This method will print the string, Text, just above the current SectionBottom justified by, Justify, between the current SectionLeft and SectionRight. See Also: All other print functions, GotoFooter Example (Delphi)
PrintFooter('Date 01/20/95', pjRight);

Declaration:

Example (C++ Builder)


PrintFooter(Date 01/20/95, pjRight);

PrintGroupFooter method PrintGroupHeader method


Declaration: procedure PrintGroupFooter; procedure PrintGroupHeader; Category: Shell Components: TMasterShell, TReportShell Description: These methods will reprint the group header or footer by calling the OnGroupHeader or OnGroupFooter events with IsReprint set to true. See Also: OnGroupHeader, OnGroupFooter Example (Delphi)
MasterShell1.PrintGroupHeader;

Example (C++ Builder)


MasterShell1->PrintGroupHeader();

PrintHeader method
procedure PrintHeader(Text: string; Justify: TPrintJustify); Category: Printing Components: TReportFiler, TReportPrinter Description: This method will print the string, Text, just below the current SectionTop justified by, Justify, between the current SectionLeft and SectionRight. See Also: All other print functions, GotoHeader Example (Delphi)
PrintHeader( 'Report Header Text', pjCenter);

Declaration:

Example (C++ Builder)


PrintHeader( Report Header Text, pjCenter);

213

PrintHeight method
procedure PrintHeight(Height:double; PrintTabs: boolean); Category: Memo Components: TMemoBuf Description: 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. NOTE: You must initialize the TMemoBuf.BaseReport before calling this method. See Also: TMemoBuf, MemoHeightLeft, BaseReport Declaration:

PrintHyperLink method
procedure PrintHyperLink(URL: string Attributes: string Text: string); Category: HTML Components: TRPHTMLFiler Description: 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. See Also: PrintHyperLinkEnd, PrintHyperLinkStart, PrintImage Example (Delphi)
With HTMLFiler1 do begin PrintHyperLink(http://www.nevrona.com,, Nevrona Designs Web Site); end; { with }

Declaration:

Example (C++ Builder)


HTMLFiler1->PrintHyperLink(http://www.nevrona.com,, Nevrona Designs Web Site);

214

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
procedure PrintHyperLinkStart(URL: string Attributes: string); Category: HTML Components: TRPHTMLFiler Description: 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. See Also: 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 }

Declaration:

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();

215

PrintImage method
procedure PrintImage(URL: string; Width; double Height: double; Attributes: string); Category: HTML Components: TRPHTMLFiler Description: 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. See Also: PrintHyperLink, PrintHyperLinkEnd, PrintHyperLinkStart Example
See PrintHyperLineStart for example

Declaration:

PrintImageRect method
procedure PrintImageRect(X1,Y1,X2,Y2: double; ImageStream: Tstream; ImageType: string); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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). See Also: 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}

Declaration:

216

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

(read only)

Declaration: property Printing: boolean; Category: Control Components: TReportFiler, TReportPrinter Description: This property will be set to true after a call to Execute has been made and will remain true until the report has finished. See Also: 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); Category: Printing Components: TReportFiler, TReportPrinter Description: 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. See Also: PrintBlock, PrintCenter, PrintLeft, PrintRight Example (Delphi)
PrintJustify(Centered Text, SectionLeft,pjCenter,0.0,SectionRight SectionLeft); { Same as PrintCenter(Centered Text, (SectionLeft + SectionRight) / 2.0); }

217

Example (C++ Builder)


rp->PrintJustify(Centered Text, SectionLeft,pjCenter,0.0,SectionRight SectionLeft); /* Same as PrintCenter(Centered Text, (SectionLeft + SectionRight) / 2.0); */

PrintLeft method
procedure PrintLeft(Text: string; Pos: double); Category: Printing Components: TReportFiler, TReportPrinter Description: This method will print the string Text on the current line left justified at the position Pos. See Also: All other print functions Example (Delphi)
ReportPrinter1.PrintLeft( Text left at 4.0, 4.0);

Declaration:

Example (C++ Builder)


ReportPrinter1->PrintLeft( Text left at 4.0, 4.0);

PrintLines method
procedure PrintLines(Lines: longint; PrintTabs: boolean); Category: Memo Components: TMemoBuf Description: 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. NOTE: You must initialize the TMemoBuf.BaseReport before calling this method. See Also: TMemoBuf, MemoLinesLeft, BaseReport Declaration:

PrintLn method
Declaration: procedure PrintLn(Text: string); Category: Printing Components: TReportFiler, TReportPrinter Description: This method will print the string Text just like the Print method does; however, it also calls NewLine to go to the next line. See Also: NewLine, All other print functions Example (Delphi)
ReportPrinter1.Println( Text on a line); ReportPrinter1.Println( Text on another line);

218

Example (C++ Builder)


ReportPrinter1->Println( Text on a line); ReportPrinter1->Println( Text on another line);

PrintMemo method
procedure PrintMemo(MemoBuf: TMemoBuf; Lines: longint; PrintTabs: boolean); Category: Memo Components: TReportFiler, TReportPrinter Description: 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. See Also: TMemoBuf, MemoLines Example 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. Declaration:

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: procedure PrintPage(PageNum: word); Category: Preview Components: TFilePreview Description: 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. See Also: RedrawPage, OnPageChange Example (Delphi)
FilePreview1.PrintPage( 2);

Example (C++ Builder)


FilePreview1->PrintPage( 2);

219

PrintPageFooter method PrintPageHeader method


procedure PrintPageFooter; procedure PrintPageHeader Category: Shell Components: TReportShell Description: These methods will reprint the page header or footer by calling the OnPageHeader or OnPageFooter events with IsReprint set to true. See Also: OnPageHeader, OnPageFooter Example (Delphi)
ReportShell1.PrintPageHeader;

Declaration:

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


procedure PrintReportFooter; procedure PrintReportHeader; Category: Shell Components: TReportShell Description: These methods will reprint the report header or footer by calling the OnReportHeader or OnReportFooter events with IsReprint set to true. See Also: OnReportHeader, OnReportFooter Example (Delphi)
ReportShell2.PrintReportFooter;

Declaration:

Example (C++ Builder)


ReportShell2->PrintReportFooter();

220

PrintRight method
procedure PrintRight(Text: string; Pos: double); Category: Printing Components: TReportFiler, TReportPrinter Description: This method will print the string, Text, on the current line right justified at the position, Pos. See Also: all other print functions Example (Delphi)
ReportPrinter1.PrintRight(Right justified at 3.0,3.0 );

Declaration:

Example (C++ Builder)


ReportPrinter1->PrintRight(Right justified at 3.0,3.0 );

PrintRow method
Declaration: procedure PrintRow; Category: Shell Components: TDetailShell, TMasterShell, TReportShell Description: This method will reprint the row section of the group by calling OnRowBefore, OnRowPrint. Execute() and then OnRowAfter with IsReprint set to true. See Also: 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;

221

PrintTab method
Declaration: procedure PrintTab(Text: string); Category: Printing Components: TReportFiler, TReportPrinter Description: 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. See Also: 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
procedure PrintXY(X,Y: double; Text: string); Category: Printing Components: TReportFiler, TReportPrinter Description: 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. See Also: All other print functions, GotoXY Example (Delphi)
ReportPrinter1.PrintXY( 1.0, 2.0, Text above (1.0, 2.0));

Declaration:

Example (C++ Builder)


ReportPrinter1->PrintXY( 1.0, 2.0, Text above (1.0, 2.0));

222

PrintXY method

{ Bar Code }

Declaration: procedure PrintXY( X,Y: double ); Category: Bar Code Components: TRPBarsBase Description: 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. See Also: 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: function PushFont: boolean; Category: Font Components: TReportFiler, TReportPrinter Description: This method will push the current font onto an internal stack for later retrieval by PopFont. See Also: PopFont Example: see PopFont

PushPos method
Declaration: function PushPos: boolean; Category: Position Components: TReportFiler, TReportPrinter Description: This method will push the current text cursor position onto an internal stack for later retrieval by PopPos. See Also: PopPos Example: see PopPos

223

PushTabs method
Declaration: function PushTabs: boolean; Category: Tabs Components: TReportFiler, TReportPrinter Description: This method will push the current tab settings onto an internal stack for later retrieval by PopTabs. See Also: PopTabs

Query property

{Rave}

(read/write/pub)

Declaration: property Query: TQuery; Category: Rave Components: TRPQueryConnection Description: Specifies the TQuery component that is connected to the TRPQueryConnection component. Example (Delphi)
CustOrdCXN.Query := CustOrdQuery;

Example (C++ Builder)


CustOrdCXN->Query = CustOrdQuery;

RaveBlobDateTime property

{Rave}

(read/write/pub)

Declaration: property RaveBlobDateTime: TDateTime; Category: Rave Components: TRaveProject Description: 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. See Also: 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)

224

RecoverPrinter method
Declaration: procedure RecoverPrinter; Category: Printer Components: TReportFiler, TReportPrinter Description: This method will recover the printer handle that was released by a prior call to ReleasePrinter. See Also: ReleasePrinter
Example: See ReleasePrinter

Rectangle method
Declaration: procedure Rectangle(X1,Y1,X2,Y2: double); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: 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();

225

RegisterGraphic method
Declaration: procedure RegisterGraphic( index: integer); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: ReuseGraphic, UnregisterGraphic 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

226

ReleasePrinter method
Declaration: procedure ReleasePrinter; Category: Printer Components: TReportFiler, TReportPrinter Description: 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. See Also: RecoverPrinter Example (Delphi)
ReportPrinter1.ReleasePrinter; PrinterSetupDialog1.Execute; ReportPrinter1.RecoverPrinter;

Example (C++ Builder)


ReportPrinter1->ReleasePrinter(); PrinterSetupDialog1->Execute(); ReportPrinter1->RecoverPrinter();

ReplaceAll method
procedure ReplaceAll(SearchText: string; ReplaceText: string; CaseMatters: boolean); Category: Memo Components: TDBMemoBuf, TMemoBuf Description: 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. See Also: SearchFirst, SearchNext Example (Delphi)
MemoBuf.ReplaceAll('%name%', Name, false); MemoBuf.ReplaceAll('%address%', Address, false);

Declaration:

Example (C++ Builder)


MemoBuf->ReplaceAll(%name%, Name, false); MemoBuf->ReplaceAll(%address%, Address, false);

227

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

228

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

{Rave}

(read only)

Declaration: property ReportDesc: string; Category: Rave Components: TRaveProject Description: 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. See Also: ReportFullName, ReportName, ReportDescToMemo, SelectReport

ReportDescToMemo method

{Rave}

Declaration: procedure ReportDescToMemo(Memo: TCustomMemo); Category: Rave Components: TRaveProject Description: Initializes the memo component, Memo, to the contents of the currently selected report description. See Also: ReportDesc, SelectReport

ReportDest property

(read only)

Declaration: property ReportDest: TReportDest; Category: ReportSystem Components: TReportSystem Description: 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). See Also: DefaultDest

229

ReportFullName property

{Rave}

(read only)

Declaration: property ReportFullName: string; Category: Rave Components: TRaveProject Description: 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. See Also: ReportDesc, ReportName, SelectReport

ReportName property

{Rave}

(read only)

Declaration: property ReportName: string; Category: Rave Components: TRaveProject Description: 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. See Also: ReportFullName, ReportDesc, SelectReport

ReportPrinter property

(read/write)

Declaration: property ReportPrinter: TBaseReport; Category: TablePrinter Components: TTableColumn, TDBTableColumn, TTableSection Description: 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;

230

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: procedure Reset; Category: Control Components: TReportFiler, TReportPrinter Description: This method will reset certain settings (Pen, Brush, Origins, Columns, Tabs, Sections and Text Cursor position) to their default values. See Also: ResetPrinter Example (Delphi)
ReportPrinter1.Reset;

Example (C++ Builder)


ReportPrinter1->Reset();

Reset method

{MemoBuf}

Declaration: procedure Reset; Category: Memo Components: TDBMemoBuf, TMemoBuf Description: 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. See Also: Pos Example (Delphi)
MemoBuf1.Reset;

Example (C++ Builder)


MemoBuf1->Reset();

ResetLineHeight method
Declaration: procedure ResetLineHeight; Category: Position Components: TReportFiler, TReportPrinter Description: 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. See Also: LineHeight, LineHeightMethod Example (Delphi)
ReportPrinter1.ResetLineHeight;

231

Example (C++ Builder)


ReportPrinter1->ResetLineHeight();

ResetPrinter method
Declaration: procedure ResetPrinter; Category: Printer Components: TReportFiler, TReportPrinter Description: 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. See Also: DevMode Example (Delphi)
ReportPrinter1.ResetPrinter;

Example (C++ Builder)


ReportPrinter1->ResetPrinter();

ResetSection method
Declaration: procedure ResetSection; Category: Position Components: TReportFiler, TReportPrinter Description: This method will reset the section values, SectionLeft, SectionRight, SectionTop and SectionBottom to be equal to the current margin settings. See Also: All Margin and Section properties Example (Delphi)
ReportPrinter1.ResetSection;

Example (C++ Builder)


ReportPrinter1->ResetSection();

ResetTabs method
Declaration: procedure ResetTabs; Category: Tabs Components: TReportFiler, TReportPrinter Description: This method resets the current tab to the beginning. NewLine calls this function to reset the current tab. See Also: ClearTabs, SetTab Example (Delphi)
ReportPrinter1.ResetTabs

Example (C++ Builder)


ReportPrinter1->ResetTabs()

232

RestoreBuffer method
Declaration: procedure RestoreBuffer; Category: Memo Components: TDBMemoBuf, TMemoBuf Description: This method will restore the memo buffer to the state it was in during the last call to SaveBuffer. See Also: SaveBuffer Example: see Tutorial 12

RestoreFont method
Declaration: function RestoreFont(Index: integer): boolean; Category: Font Components: TReportFiler, TReportPrinter Description: 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. See Also: 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: function RestorePos(Index: byte): boolean; Category: Position Components: TReportFiler, TReportPrinter Description: 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. See Also: SavePos Example (Delphi)
ReportPrinter.RestorePos(1);

Example (C++ Builder)


ReportPrinter->RestorePos(1);

RestoreState method
Declaration: procedure RestoreState; Category: Memo Components: TDBMemoBut, TMemoBuf Description: 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. See Also: Pos, RestoreBuffer, SaveState

233

RestoreTabs method
Declaration: function RestoreTabs(Index: integer): boolean; Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: 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: procedure ReuseGraphic; Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: RegisterGraphic, UnregisterGraphic Example: See RegisterGraphic

RichEdit property

( write only )

Declaration: property RichEdit: string Category: Memo Components: TDBMemoBuf, TMemoBuf Description: Imports the RTF contents stored in a TRichEdit component into a memo buffer. NOTE: This property does not exist in Delphi 1.0. See Also: RTFLoadFromStream, RTFText Example (Delphi)
MemoBuf1.RichEdit := RichEdit1;

Example (C++ Builder)


MemoBuf1->RichEdit = RichEdit1;

234

Right property

{Bar Code}

( read/write )

Declaration: property Right: double; Category: Bar Code Components: TRPBarsBase Description: 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. See Also: 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

(read only)

Declaration: property RightWaste: double; Category: Printer Components: TReportFiler, TReportPrinter Description: 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. See Also: BottomWaste , LeftWaste , MarginRight , TopWaste Example: See LeftWaste

235

RoundRect method
Declaration: procedure RoundRect(X1,Y1,X2,Y2,X3,Y3: double); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: Rectangle, Ellipse 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: function RPDev: TRPDevice; Category: Printer Components: RPDevice unit Description: 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);

236

Example (C++ Builder)


MemoBuf1->RTFLoadFromFile(Letter.RTF);

RTFLoadFromStream method
procedure RTFLoadFromStream( stream: Tstream; BufSize: longint); Category: Memo Components: TDBMemoBuf, TMemoBuf Description: 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. See Also: LoadFromFile, RTFLoadFromFile Declaration:

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;

237

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

{Rave}

Declaration: procedure Save; Category: Rave Components: TRaveProject Description: This method will save the current report project to the file specified by the ProjectFile property. See Also: Close, Open, ProjectFile

SaveBuffer method
Declaration: procedure SaveBuffer; Category: Memo Components: TDBMemoBuf, TMemoBuf Description: 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. See Also: FreeSaved, RestoreBuffer Example (Delphi)
MemoBuf.SaveBuffer; { Save original contents }

Example (C++ Builder)


MemoBuf->SaveBuffer(); // Save original contents

238

SaveFont method
Declaration: function SaveFont(Index: integer): boolean; Category: Font Components: TReportFiler, TReportPrinter Description: 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. See Also: 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: function SavePos(Index: byte): boolean; Category: Position Components: TReportFiler, TReportPrinter Description: This method will store the current text cursor position into an array at index, Index. The valid values for Index are 1 to 10. See Also: RestorePos Example (Delphi)
ReportPrinter1.SavePos(1);

Example (C++ Builder)


ReportPrinter1->SavePos(1);

SaveRaveBlob method

{Rave}

Declaration: function SaveRaveBlob(Stream: TStream); Category: Rave Components: TRaveProject Description: 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. See Also: ClearRaveBlob, LoadRaveBlob, RaveBlobDateTime, StoreRAV Example (Delphi)
RaveProject1.SaveRaveBlob( MyStream );

Example (C++ Builder)


RaveProject1->SaveRaveBlob( MyStream );

239

SaveState method
Declaration: procedure SaveState; Category: Memo Components: TMemoBuf Description: This method saves the current cursor position, Pos, and other state information. You can restore the memo buffer state back by calling RestoreState. See Also: Pos, RestoreState, SaveBuffer

SaveTabs method
Declaration: function SaveTabs(Index: integer): boolean; Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: 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 );

240

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:

(read/write/pub) (read/write/pub)

property ScaleX: double; property ScaleY: double; Default: 100 Category: Control Components: TReportFiler, TReportPrinter Description: 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. See Also: 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

241

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
function SearchFirst(SearchText: string; CaseMatters: boolean): boolean; Category: Memo Components: TDBMemoBuf, TMemoBuf Description: 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. See Also: Pos, SearchNext 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 }

Declaration:

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

242

SearchNext method
Declaration: function SearchNext: boolean; Category: Memo Components: TDBMemoBuf, TMemoBuf Description: 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. See Also: Pos, SearchFirst
Example: 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:

(read/write/pub) (read/write/pub)

property SectionBodyFooter: TReportSection; property SectionBodyHeader: TReportSection; Default: Standard section values Category: Shell Components: TDetailShell, TMasterShell, TReportShell Description: Brings up the section editor, which you can use to define the section settings for the body header or footer. See Also: OnBodyHeader, OnBodyFooter Example (Delphi)
SectionBodyHeader.Lines := 1;

Example (C++ Builder)


SectionBodyHeader->Lines = 1;

243

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:

(read/write/pub) (read/write/pub)

property SectionGroupFooter: TReportSection; property SectionGroupHeader: TReportSection; Default: Standard section values Category: Shell Components: TMasterShell, TReportShell Description: Brings up the section editor, which you can use to define the section settings for the group header or footer See Also: OnGroupHeader, OnGroupFooter Example (Delphi)
SectionGroupHeader.FontIndex := 5;

Example (C++ Builder)


SectionGroupHeader->FontIndex = 5;

244

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:

(read/write/pub) (read/write/pub)

property SectionPageHeader: TReportSection; property SectionPageFooter: TReportSection; Default: Standard section values Category: Shell Components: TReportShell Description: Brings up the section editor, which you can use to define the section settings for the page header or footer. See Also: OnPageHeader, OnPageFooter Example (Delphi)
SectionPageFooter.BottomMethod := dmPage; SectionPageFooter.Bottom := 0.25;

Example (C++ Builder)


SectionPageFooter->BottomMethod = dmPage; SectionPageFooter->Bottom = 0.25;

245

SectionReportFooter property SectionReportHeader property


Declaration:

(read/write/pub) (read/write/pub)

property SectionReportHeader: TReportSection; property SectionReportFooter: TReportSection; Default: Standard section values Category: Shell Components: TReportShell Description: Brings up the section editor, which you can use to define the section settings for the report header or footer. See Also: 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:

246

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

(read only)

Declaration: property SectionType: TSectionType; Category: TablePrinter Components: TTableSection Description: This property defines the type of section that this table section is. This will control when it is called during the report. See Also: OutputType

247

SelectBin method
Declaration: function SelectBin(BinName: string): boolean; Category: Printer Components: TReportPrinter Description: 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. See Also: 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;

248

SelectPaper method
Declaration: function SelectPaper(PaperName: string): boolean; Category: Printer Components: TReportPrinter Description: This method will select a paper size containing PaperName in its description and return a boolean value of whether it was successful or not. See Also: Papers, SupportPaper Example (Delphi)
SelectPaper(LEGAL);

Example (C++ Builder)


SelectPaper(LEGAL);

SelectPrinter method
Declaration: function SelectPrinter(SubStr: string): boolean; Category: Printer Components: TReportFiler, TReportPrinter Description: 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. See Also: PrinterIndex Example (Delphi)
SelectPrinter(Laser);

Example (C++ Builder)


SelectPrinter(Laser);

SelectReport method
Declaration:

{Rave}

function SelectReport(ReportName: string; FullName: boolean): boolean; Category: Rave Components: TRaveProject Description: 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. See Also: GetReportList, ReportFullName, ReportName

249

ServerMode property
Declaration:

( read/write )

property ServerMode: Boolean read FserverMode write FserverMode; Default: false Category: Render Components: TRenderHTML Description: This property specifies whethere the HTML is being generated dynamically from the report server or is being run locally. This affects things like whether the image files will be given a .tmp file type, which is the case for servermode, or whether they are given the .jpg file type needed when running locally, which enables the browser to determine th file type and display the image correctly. See Also: CacheDir

SetBrush method
Declaration: procedure SetBrush(NewColor: TColor; NewStyle: TBrushStyle; NewBitmap: TBitmap); Category: Graphics Components: TReportFiler, TReportPrinter Description: This method will set the current brush for the given parameters. If a bitmap is not desired, pass in the value of nil. See Also: CreateBrush, TBitmap, TBrushStyle, TColor

Example (Delphi)
ReportPrinter1.SetBrush(clBlack, bsClear, nil);

Example (C++ Builder)


ReportPrinter1->SetBrush(clBlack, bsClear, NULL);

SetColumns method
procedure SetColumns(NewColumns: integer; Between: double); Category: Column Components: TReportFiler, TReportPrinter Description: 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. See Also: 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 }

Declaration:

250

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

SetColumnWidth method
procedure SetColumnWidth(Width: double; Between: double); Category: Column Components: TReportFiler, TReportPrinter Description: 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. See Also: SetColumns, Columns, SectionLeft, SectionRight. Example (Delphi)
{ Create columns 2 inches wide and a half of an inch apart } ReportPrinter1.SetColumnWidth( 2.0, 0.5 );

Declaration:

Example (C++ Builder)


// Create columns 2 inches wide and a half of an inch apart ReportPrinter1->SetColumnWidth( 2.0, 0.5 );

SetData method
procedure SetData(var Buffer; BufSize: longint); Category: Memo Components: TDBMemoBuf, TMemoBuf Description: 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. See Also: Text Example (Delphi)
{ Assign a PChar to a memo buffer } MemoBuf.SetData(PCharVar^, StrLen(PCharVar));

Declaration:

251

SetFont method
procedure SetFont(NewName: string; NewSize: integer); Category: Font Components: TReportFiler, TReportPrinter Description: This method will set the current font for the given parameters. NewSize is the point size of the font (1/72nds of an inch). See Also: AssignFont , CreateFont , FontCharSet Note: If you are using a symbol set, be sure to use FontCharSet after the SetFont method. Example (Delphi)
ReportPrinter1.SetFont( Arial, 10 );

Declaration:

Example (C++ Builder)


ReportPrinter1->SetFont( Arial, 10 );

SetPaperSize method
Declaration: function SetPaperSize(Size: integer; Width: double; Height: double):boolean;

Category: Printer Components: TReportFiler, TReportPrinter Description: 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.

It returns true or false based on whether the call was successful or not.
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);

252

SetParam method
Declaration:

{Rave}

procedure SetParam(NewName: string; NewSize: integer); Category: Rave ??? Components: TRaveProject Description: This method will set the current font for the given parameters. NewSize is the point size of the font (1/72nds of an inch). See Also: AssignFont , CreateFont , FontCharSet Note: If you are using a symbol set, be sure to use FontCharSet after the SetFont method. Example (Delphi)
ReportPrinter1.SetFont( Arial, 10 );

Example (C++ Builder)


ReportPrinter1->SetFont( Arial, 10 );

SetPen method
procedure SetPen(NewColor: TColor; NewStyle: TPenStyle; NewWidth: integer; NewMode: TPenMode); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: CreatePen, TPenMode, TPenStyle, TColor Example (Delphi)
ReportPrinter1.SetPen(clBlack,psSolid,-2,pmCopy);

Declaration:

Example (C++ Builder)


ReportPrinter1->SetPen(clBlack,psSolid,-2,pmCopy);

SetPIVar method
procedure SetPIVar(PIVarName: string; PIVarValue: string); Category: Printing Components: TReportFiler , TReportPrinter , TReportSystem Description: 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. See Also: PIVar Example
See PIVar

Declaration:

253

SetRTF method
Declaration: procedure SetRTF(var Buffer; BufSize: longint); Category: Memo Components: TRTFFiler Description: Works exactly like SetData, except the data stored in Buffer is RTF text. See Also: RTFText, SetData

SetTab method
procedure SetTab(NewPos: double; NewJustify: TPrintJustify; NewWidth: double; NewMargin: double; NewLines: byte; NewShade: byte); Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: ClearTabs, ResetTabs Declaration:

254

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);

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();

255

SetupSection method
Declaration: function SetupSection(BaseReport: TBaseReport): boolean; Category: ReportSection Components: TReportSection Description: 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. See Also: Enabled Example (Delphi)
ReportSection.SetupSection(Sender as TBaseReport);

Example (C++ Builder)


ReportSection->SetupSection( dynamic_cast<TBaseReport*>(Sender));

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
function ShadeToColor(ShadeColor: TColor; ShadePercent: byte): TColor; Category: Graphics Components: N/A Description: This function will create a color that only has ShadePercent amount of Shadecolor. See Also: SetBrush, TColor Declaration:

256

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;

ShowPrintDialog method
Declaration: function ShowPrintDialog: boolean; Category: Printer Components: TReportFiler, TReportPrinter Description: Brings up the standard Windows PrintDialog. Use this function instead of Delphis TPrintDialog component. See Also: ShowPrinterSetupDialog Example (Delphi)
If ReportPrinter1.ShowPrintDialog then begin ReportPrinter1.Execute; end; { if }

Example (C++ Builder)


if (ReportPrinter1->ShowPrintDialog()) { ReportPrinter1->Execute(); }// if

ShowPrinterSetupDialog method
Declaration: function ShowPrinterSetupDialog: boolean; Category: Printer Components: TReportFiler, TReportPrinter Description: Brings up the standard Windows PrinterSetupDialog. Use this function instead of Delphis TPrinterSetupDialog component. See Also: ShowPrintDialog Example (Delphi)
If ReportPrinter1.ShowPrinterSetupDialog then begin ReportPrinter1.Execute; end; { if }

Example (C++ Builder)


if (ReportPrinter1->ShowPrinterSetupDialog()) { ReportPrinter1->Execute(); }// if

257

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;

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: procedure SoftLine; Category: RTF Components: TRTFFiler Description: 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. See Also: 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;

258

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;

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;

259

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.

Start method
Declaration: procedure Start; Category: Control Components: TFilePreview, TReportFiler, TReportPrinter Description: 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. See Also: Finish, Execute 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;

260

Example (C++ Builder)


ReportShell1->StartNewPage = true;

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

261

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)';

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;

262

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();

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

263

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

264

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
procedure StretchDraw(const Rect: TRect; Graphic: TGraphic); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: CreateRect, Draw, PrintBitmap, PrintBitmapRect, TGraphic, TRect Declaration:

265

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;

266

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: function SupportBin(BinNum: integer): boolean; Category: Printer Components: TReportPrinter Description: 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. See Also: SelectBin, SupportXxxx methods, TDevMode in Windows API help

SupportCollate method
Declaration: function SupportCollate: boolean; Category: Printer Components: TReportPrinter Description: This method will return true if the printer supports collation, otherwise it will return false. See Also: SupportXxxx methods 267

SupportDuplex method
Declaration: function SupportDuplex: boolean; Category: Printer Components: TReportPrinter Description: This method will return true if the current printer supports duplex (double sided) printing. See Also: 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: function SupportPaper(PaperNum: integer): boolean; Category: Printer Components: TReportPrinter Description: 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. See Also: SupportXxxx methods, TDevMode in Windows API help

SystemFiler property

(read/write/pub)

Declaration: property SystemFiler: TSystemFiler; Category: ReportSystem Components: TReportSystem Description: 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. See Also: Other SystemXxxx options Example (Delphi)
ReportSystem1.SystemFiler.AccuracyMethod := amAppearance;

Example (C++ Builder)


ReportSystem1->SystemFiler->AccuracyMethod = amAppearance;

268

SystemOptions property

(read/write/pub)

Declaration: property SystemOptions: TSystemOptions; Category: ReportSystem Components: TReportSystem Description: 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. See Also: 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

(read/write/pub)

Declaration: property SystemPreview: TSystemPreview; Category: ReportSystem Components: TReportSystem Description: 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 or maximized) of the ReportSystem report preview form. FormWidth defines the width of the ReportSystem report preview form. See Also: Other SystemXxxx options Example (Delphi)
ReportSystem1.SystemPreview.FormState := wsMaximized;

Example (C++ Builder)


ReportSystem1->SystemPreview->FormState = wsMaximized;

269

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:

(read/write/pub)

property SystemSetups: TSystemSetups; [ssAllowSetup, ssAllowCopies, ssAllowCollate, ssAllowDuplex, ssAllowDestPreview, ssAllowDestPrinter, ssAllowDestFile, ssAllowPrinterSetup] Category: ReportSystem Components: TReportSystem Description: 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. See Also: TSystemSetup Example (Delphi)
{ Disable the setup screen } ReportSystem1.SystemSetups := ReportSystem1.SystemSetups - [ssAllowSetup];

Example (C++ Builder)


// Disable the setup screen ReportSystem1->SystemSetups = ReportSystem1->SystemSetups >> ssAllowSetup;

270

Tab method
procedure Tab(LeftWidth: integer; RightWidth: integer; TopWidth: integer; BottomWidth: integer; ShadeOverride: integer); Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: SetTab, TabShade 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 }

Declaration:

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

271

TabEnd method
Declaration: function TabEnd(Index: integer): double; Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: GetTab, TabStart, TabWidth 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;

272

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

(read/write/pub)

Declaration: property TableAttributes: String; Category: HTML Components: TRPHTMLFiler Description: 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]. See Also: 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

273

TableItem property

(read/write)

Declaration: property TableItem: TTableItem; Category: TablePrinter Components: TTableColumn, TDBTableColumn Description: This property will define the TableItem item (a TTableSection or TTableColumn component) that is to be used for formatting options. See Also: Common properties between TableSection and TableColumn

TablePrinter property

(read/write)

Declaration: property TablePrinter: TTablePrinter; Category: TablePrinter Components: TTableColumn, TDBTableColumn, TTableSection Description: This property returns the parent table printer for a table section or table column component. See Also: ReportPrinter

TableSection property
Declaration:

(read only)

property TableSection[Index: TSectionType]: TTableSection; Category: TablePrinter Components: TTablePrinter, TDBTablePrinter Description: 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. See Also: TableColumn

274

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: function TabStart(Index: integer): double; Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: GetTab, TabEnd, TabWidth Example (Delphi)
{ Start of current tab region } CurrStart := ReportPrinter1.TabStart( 0);

Example (C++ Builder)


// Start of current tab region CurrStart = ReportPrinter1->TabStart( 0);

275

TabWidth method
Declaration: function TabWidth(Index: integer): double; Category: Tabs Components: TReportFiler, TReportPrinter Description: 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. See Also: 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

type

Declaration: TAccuracyMethod = (amPositioning, amAppearance); Category: Control Components: TReportFiler Description: 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

type

Declaration: TBKMode = (bkTransparent, bkOpaque); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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

276

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: TDuplex = (dupSimplex, dupHorizontal, dupVertical); Category: Printer Components: TReportPrinter Description: dupSimplex: Simplex mode (Duplex mode is not initialized) dupHorizontal: Duplex mode initialized print head to toe dupVertical: Duplex mode initialized print head to head See Also: Duplex, SupportDuplex Example: See Duplex

type

277

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

{Bar Code}

( read/write )

Declaration: property Text: string; Category: Bar Code Components: TRPBarsBase Description: 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. See Also: 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;

278

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

279

TextRect method
Declaration: procedure TextRect( Rect: TRect; X,Y: double; const Text: string);

Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: CreateRect, All print methods, TRect Example (Delphi)
var TxtRect: TxtXPos: TxtYPos: Txt: TRect; double; double; string;

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: function TextWidth(Text: string): double; Category: Position Components: TReportFiler, TReportPrinter Description: 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?);

280

TFontAlign
Declaration: TFontAlign = (faBaseline, faTop, faBottom); Category: Font Components: TReportFiler, TReportPrinter Description: 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

281

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

type

Declaration: TLineHeightMethod = (lhmLinesPerInch, lhmFont); Category: Position Components: TReportFiler, TReportPrinter Description: 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

282

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

type

Declaration: TMarginMethod = (mmScaled, mmFixed); Category: Preview Components: TFilePreview Description: 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

283

Top property

{Bar Code}

(read/write)

Declaration: property Top: double; Category: Bar Code Components: TRPBarsBase Description: 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. See Also: 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

284

TopWaste property

(read only)

Declaration: property TopWaste: double; Category: Printer Components: TReportFiler, TReportPrinter Description: 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. See Also: BottomWaste , LeftWaste , MarginTop ,RightWaste Example: See LeftWaste

TOrientation

type

Declaration: TOrientation = (poPortrait, poLandscape, poDefault); Category: Control Components: TReportFiler, TReportPrinter Description: poPortrait: Portrait mode. poLandscape: Landscape mode. poDefault: Default mode on the current printer. See Also: Orientation Example:See Orientation example

TotalPasses property

(read/write)

Declaration: property TotalPasses: Integer; Category: Misc Components: TReportFiler, TReportPrinter Description: This is the value that will be returned when a %s is encountered in a StatusFormat string. See Also: 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

285

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

type

Declaration: TPrintJustify = (pjCenter, pjLeft, pjRight, pjBlock); Category: Printing Components: TReportFiler, TReportPrinter, TTableColumn, TDBTableColumn, TTableSection Description: 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

286

TPrintJustifyVert
Declaration: TPrintJustifyVert = (pjTop, pjMiddle, pjBottom); Category: Printing Components: TTableColumn, TDBTableColumn, TTableSection Description: 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

type

TPrintUnits

type

Declaration: TPrintUnits = (unInch, unMM, unCM, unPoint, unUser); Category: Units Components: TReportFiler, TReportPrinter Description: 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;

287

TReportDest
Declaration: TReportDest = (rdPreview, rdPrinter, rdFile); Category: TablePrinter Components: TReportSystem Description: 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. See Also: DefaultDest Example: See DefaultDest

type

TRPRenderPDF
Declaration: Default: Category: Components: TReportSystem Description: 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. See Also: DefaultDest Example: See DefaultDest

type

property UseCompression: Boolean read fUseCompression write fUseCompression; false

TruncateText method
function TruncateText(Value: String; Width: Double): String; Category: Printing Components: TReportFiler, TReportPrinter Description: 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. See Also: PrintTab, SetFont Example (Delphi)
ReportPrinter1.SetFont( Arial, 14 ); TruncateText(This text is too long to fit within 2 inches, 2.0);

Declaration:

Example (C++ Builder)


ReportPrinter1->SetFont( Arial, 14 ); TruncateText(This text is too long to fit within 2 inches, 2.0);

288

TStreamMode

type

Declaration: TStreamMode = (smMemory, smTempFile, smFile, smUser); Category: Control Components: TReportFiler, TFilePrinter, TFilePreview Description: 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. See Also: StreamMode, Stream Example: See StreamMode

TSystemOption TSystemOptions
Declaration:

type type

TSystemOption = (soUseFiler, soWaitForOK, soShowStatus, soAllowPrintFromPreview, soPreviewModal); TSystemOptions = Set of TSystemOption; Category: ReportSystem Components: TReportSystem Description: See SystemOptions See Also: SystemOptions Example: See SystemOptions

289

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

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

290

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;

291

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: procedure UnregisterGraphic( index: integer ); Category: Graphics Components: TReportFiler, TReportPrinter Description: 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. See Also: RegisterGraphic, ReuseGraphic Example: See RegisterGraphic

292

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

UseCompression property
Declaration:

( read/write )

property UseCompression: boolean read fUseCompression write fUseCompression; Default: false Category: Render Components: TRPRenderPDF Description: This property determines whether you want to compress the page stream when sendng the report out to PDF. The code that actually provides the compression must be defined in the OnCompress event. See Also: OnCompress

293

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;

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: property Version: String; Components: All Description: Returns the current release version of ReportPrinter Pro.

(read/write/pub)

294

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

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

{Bar Code}

(read only)

Declaration: property Width: double; Category: Bar Code Components: TRPBarsBase Description: This property will return the calculated width of the entire bar code for the current value of Text. See Also: 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

295

WriteBCDData method
Declaration:

{Rave}

function WriteBCDData(FormatData: String; NativeData: Currency): String; Category: Rave Components: Any Data Connection Component Description: 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 Tutorial: See tutorial 26 (customizing data connections) for more information. See Also: OnGetCols, OnGetRow, other WriteXxxxData methods Example (Delphi)
Connection.WriteBCDData( ,InvoiceAmount );

Example (C++ Builder)


Connection->WriteBCDData( ,InvoiceAmount );

WriteBlobData method
Declaration:

{Rave}

function WriteBlobData(var: Buffer; Len: Longint): String; Category: Rave Components: Any Data Connection Component Description: 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. Tutorial: See tutorial 26 (customizing data connections) for more information. See Also: OnGetCols, OnGetRow, other WriteXxxxData methods Example (Delphi)
Connection.WriteBlobData( ,CustomerPict );

Example (C++ Builder)


Connection->WriteBlobData( ,CustomerPict );

296

WriteBoolData method
Declaration:

{Rave}

function WriteBoolData(FormatData: String; NativeData: Boolean): String; Category: Rave Components: Any Data Connection Component Description: 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 Tutorial: See tutorial 26 (customizing data connections) for more information. See Also: OnGetCols, OnGetRow, other WriteXxxxData methods Example (Delphi)
Connection.WriteBoolData( ,CustomerActive );

Example (C++ Builder)


Connection->WriteBoolData( ,CustomerActive );

WriteCurrData method
Declaration:

{Rave}

function WriteCurrData(FormatData: String; NativeData: Currency): String; Category: Rave Components: Any Data Connection Component Description: 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 Tutorial: See tutorial 26 (customizing data connections) for more information. See Also: OnGetCols, OnGetRow, other WriteXxxxData methods Example (Delphi)
Connection.WriteCurrData( ,InvoiceAmount );

Example (C++ Builder)


Connection->WriteCurrData( ,InvoiceAmount );

297

WriteDateTime method
Declaration:

{Rave}

function WriteDateTime(FormatData: String; NativeData: TDateTime); Category: Rave Components: Any Data Connection Component Description: 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 Tutorial: See tutorial 26 (customizing data connections) for more information. See Also: OnGetCols, OnGetRow, other WriteXxxxData methods Example (Delphi)
Connection.WriteDateTime( ,Now );

Example (C++ Builder)


Connection->WriteDateTime( ,Now );

WriteFloatData method
Declaration:

{Rave}

function WriteFloatData(FormatData: String; NativeData: Extended): String; Category: Rave Components: Any Data Connection Component Description: 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 Tutorial: See tutorial 26 (customizing data connections) for more information. See Also: OnGetCols, OnGetRow, other WriteXxxxData methods Example (Delphi)
Connection.WriteFloatData( ,CustomerBudget );

Example (C++ Builder)


Connection->WriteFloatData( ,CustomerBudget );

298

WriteIntData method
Declaration:

{Rave}

function WriteIntData(FormatData: String; NativeData: Integer): String; Category: Rave Components: Any Data Connection Component Description: 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 Tutorial: See tutorial 26 (customizing data connections) for more information. See Also: OnGetCols, OnGetRow, other WriteXxxxData methods Example (Delphi)
Connection.WriteIntData( ,CustomerCount );

Example (C++ Builder)


Connection->WriteIntData( ,CustomerCount );

WriteNullData method

{Rave}

Declaration: function WriteNullData( no parameters ); Category: Rave Components: Any Data Connection Component Description: 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. Tutorial: See tutorial 26 (customizing data connections) for more information. See Also: OnGetCols, OnGetRow, other WriteXxxxData methods Example (Delphi)
Connection.WriteNullData( );

Example (C++ Builder)


Connection->WriteNullData( );

299

WriteStrData method
Declaration:

{Rave}

function WriteStrData(FormatData: String; NativeData: String): String; Category: Rave Components: Any Data Connection Component Description: 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 Tutorial: See tutorial 26 (customizing data connections) for more information. See Also: OnGetCols, OnGetRow, other WriteXxxxData methods Example (Delphi)
Connection.WriteStrData( ,CustomerName );

Example (C++ Builder)


Connection->WriteStrData( ,CustomerName );

XD2I method
Declaration: function XD2I(Pos: longint): double; Category: Units Components: TFilePrinter, TFilePreview Description: This method will convert horizontal printer canvas measurements (dots) to inch measurements. See Also: All other units conversion functions Example (Delphi)
{ With Units currently set to unInch } XPos := ReportPrinter1.XD2I( LastXDots );

Example (C++ Builder)


// With Units currently set to unInch XPos = ReportPrinter1->XD2I( LastXDots );

XD2U method
Declaration: function XD2U(Pos: longint): double; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert horizontal printer canvas measurements (dots) to unit measurements (defined by Units and UnitsFactor). See Also: Units, UnitsFactor, All other units conversion functions Example (Delphi)
XPos := ReportPrinter1.XD2U( LastXDots );

Example (C++ Builder)


XPos = ReportPrinter1->XD2U( LastXDots );

300

XDPI property

(read only)

Declaration: property XDPI: integer; Category: Printer Components: TReportFiler, TReportPrinter Description: 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: function XI2D(Pos: double): longint; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert horizontal inch measurements to printer canvas measurements (dots). See Also: 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 );

XI2U method
Declaration: function XI2U(Pos: double): double; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert horizontal inch measurements to unit measurements (defined by Units and UnitsFactor). See Also: Units, UnitsFactor, All other units conversion functions Example (Delphi)
XPos := ReportPrinter1.XI2U( LastXInch );

Example (C++ Builder)


XPos = ReportPrinter1->XI2U( LastXInch );

301

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: function XU2D(Pos: double): longint; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert horizontal unit measurements (defined by Units and UnitsFactor) to printer canvas measurements (dots). See Also: Units, UnitsFactor, All other units conversion functions Example (Delphi)
CurrXDots := ReportPrinter1.XU2D( ReportPrinter1.XPos );

Example (C++ Builder)


CurrXDots = ReportPrinter1->XU2D(ReportPrinter1->XPos );

XU2I method
Declaration: function XU2I(Pos: double): double; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert horizontal unit measurements (defined by Units and UnitsFactor) to inch measurements. See Also: 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 );

302

YD2I method
Declaration: function YD2I(Pos: longint): double; Category: Units Components: TFilePrinter, TFilePreview Description: This method will convert vertical printer canvas measurements (dots) to inch measurements. See Also: 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: function YD2U(Pos: longint): double; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert vertical printer canvas measurements (dots) to unit measurements (defined by Units and UnitsFactor). See Also: Units, UnitsFactor, All other units conversion functions Example (Delphi)
ReportPrinter1.YPos = ReportPrinter1.YD2U( LastYDots );

Example (C++ Builder)


ReportPrinter1->YPos = ReportPrinter1->YD2U( LastYDots );

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;

303

YI2D method
Declaration: function YI2D(Pos: double): longint; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert vertical inch measurements to printer canvas measurements (dots). See Also: 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: function YI2U(Pos: double): double; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert vertical inch measurements to unit measurements (defined by Units and UnitsFactor). See Also: Units, UnitsFactor, All other units conversion functions Example (Delphi)
ReportPrinter1.YPos := ReportPrinter1.YI2U( LastYInch );

Example (C++ Builder)


ReportPrinter1->YPos = ReportPrinter1->YI2U( LastYInch );

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 ));

304

YU2D method
Declaration: function YU2D(Pos: double): longint; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert vertical unit measurements (defined by Units and UnitsFactor) to printer canvas measurements (dots). See Also: 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: function YU2I(Pos: double): double; Category: Units Components: TReportFiler, TReportPrinter Description: This method will convert vertical unit measurements (defined by Units and UnitsFactor) to inch measurements. See Also: 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 );

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;

305

Example (C++ Builder)


AnsiString S1; S1 = FloatToStrF(FilePreview1->ZoomFactor, ffGeneral,1,1); ZoomEdit->Text = S1; FilePreview1->RedrawPage();

ZoomIn method
Declaration: procedure ZoomIn; Category: Preview Components: TFilePreview Description: 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. See Also: ZoomOut, ZoomInc, ZoomFactor, OnZoomChange Example { This code causes the ZoomFactor to be incremented by ZoomInc percent. } Example (Delphi)
FilePreview1.ZoomIn;

Example (C++ Builder)


FilePreview1->ZoomIn();

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;

306

ZoomOut method
Declaration: procedure ZoomOut; Category: Preview Components: TFilePreview Description: 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. See Also: ZoomIn, ZoomInc, ZoomFactor, OnZoomChange Example (Delphi)
FilePreview1.ZoomOut;

Example (C++ Builder)


FilePreview1->ZoomOut();

ZoomPageFactor property

(read only)

Declaration: property ZoomPageFactor: double; Category: Preview Components: TFilePreview Description: 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. See Also: ShadowDepth, ZoomFactor, ZoomPageWidthFactor Example { use an OnPreviewShow event with the following } Example (Delphi)
With Sender As TFilePreview do begin ZoomFactor := ZoomPageFactor (ShadowDepth + 5) / 10; end; { with }

Example (C++ Builder)


TFilePreview* fp = dynamic_cast<TFilePreview*>(Sender); fp->ZoomFactor = fp->ZoomPageFactor - (fp->ShadowDepth + 5) / 10;

307

ZoomPageWidthFactor property

(read only)

Declaration: property ZoomPageWidthFactor: double; Category: Preview Components: TFilePreview Description: 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. See Also: ShadowDepth, ZoomFactor, ZoomPageFactor Example { 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;

308

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

309

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.

310

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 .......................................................83 SetData.....................................................251

Properties
BufferInc ........................................................ 94 Size ............................................................. 258 Text..............................................................278

311

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

312

TCanvasReport
Unit: Parentage: See Also: RPCanvas.pas TBaseReport > TCanvasReport TFilePreview, TFilePrinter, TReportPrinter

Class

This class is the base for all TCanvasReport components.

Constants
BoxLineXxxx .................................................. 92

Events
No Common.......................................................

Properties
No Common.......................................................

Methods
No Common.......................................................

313

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 .......................................................... 83 AppendMemoBuf............................................ 83 Delete .......................................................... 112 Empty .......................................................... 120 FreeSaved ................................................... 136 Insert............................................................ 143 InsertMemoBuf............................................. 143 LoadFromFile............................................... 154 LoadFromStream ......................................... 155 ReplaceAll.................................................... 227 Reset............................................................231 RestoreBuffer ...............................................233 RTFLoadFromFile.........................................236 RTFLoadFromStream ...................................237 SaveBuffer....................................................238 SaveToStream..............................................240 SearchFirst ...................................................242 SearchNext...................................................243 SetData ........................................................251

Properties
Buffer............................................................. 94 BufferInc ........................................................ 94 Field ............................................................ 125 Justify .......................................................... 145 MaxSize....................................................... 161 Memo........................................................... 162 MemoBuf .................................................... 162 NoCRLF .......................................................167 NoNewLine...................................................167 Pos...............................................................205 PrintEnd .......................................................211 PrintStart ......................................................221 Size..............................................................258 Text..............................................................278

314

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 ................ 176 OnFooterBefore.............. 177 OnFooterHeight.............. 177 OnFooterPrint................. 177 OnFooterSetup............... 177 OnHeaderAfter ............... 180 OnHeaderHeight ............ 180 OnHeaderPrint ............... 180 OnInitMaster .................. 180 OnInitPage..................... 181 OnInitTable .................... 181 PrintBox ......................... 208 LookupDataSet............. 156 LookupDisplay.............. 156 LookupKey ................... 156 Margin............................ 158 Margin100...................... 158 MemoBuf ....................... 162 MinFontSize................... 164 OverflowAppend............. 196 OverflowMethod ............. 196 OverflowReplace............ 197 PageTotal ...................... 199 Pen................................ 201 TPrintJustify ................... 286 TPrintJustifyVert............. 287 OnRowAfter ................... 191 OnRowBefore................. 191 OnRowHeight................. 191 OnRowPrint.................... 192 OnRowSetup.................. 192

Methods
CreateColumn................ 108 PrintDefault 211

Properties
AsFloat ............................ 84 AsInteger ......................... 85 BoxLines.......................... 93 DataSet ......................... 111 Description..................... 113 DisplayFormat ................ 116 FieldName..................... 125 Font ............................... 128 GrandTotal..................... 139 Heading ......................... 141 Justify ............................ 146 JustifyVert ...................... 146 ReportPrinter.................. 230 ShadeColor.................... 256 ShadePercent ................ 256 SplitRow......................... 260 SubTotal ........................ 267 TableItem....................... 274 TablePrinter ................... 274 Totals............................. 285 UseParentFont ............... 294 UseParentPen................ 294 Width ............................. 295

Types
TBoxLines...................... 277 TOverFlowMethod.......... 286

315

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 ............................................ 178 OnInitMaster ................................................ 181 OnInitTable...................................................181 OnValidateRow.............................................193 Execute ........................................................122

Methods
Create ......................................................... 106 Default ......................................................... 112

Properties
DataSet ....................................................... 111 DetailKey .................................................... 114 DetailTablePrinter......................................... 115 Engine ......................................................... 121 Font ............................................................. 128 MasterKey................................................... 160 MasterTablePrinter....................................... 161 Pen ..............................................................201 ReprintHeader ..............................................231 StartPos .......................................................261 TableColumn ................................................273 TableColumns...............................................273 TableSection.................................................274 TextBKMode.................................................279

316

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 ................................................ 172 OnBodyBefore.............................................. 172 OnBodyFooter.............................................. 172 OnBodyHeader............................................. 172 OnRowAfter..................................................190 OnRowBefore ...............................................191 OnRowPrint ..................................................191

Methods
Execute........................................................ 122 PrintBodyFooter ........................................... 208 PrintBodyHeader...........................................208 PrintRow.......................................................221 SectionBodyHeader ......................................243 SectionRow ..................................................247 StartNewPage...............................................260

Properties
Engine ......................................................... 121 IsNewPage................................................... 144 IsReprint ...................................................... 144 SectionBodyFooter....................................... 243

317

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............. 184 OnZoomChange ........... 193 NextPage ...................... 166 PrevPage ...................... 205 PrintPage ...................... 219 RedrawPage.................. 225 Start .............................. 260 XD2I .............................. 300 MarginPercent .............. 160 Monochrome................. 164 PageInc......................... 198 Pages............................ 199 ScrollBox ...................... 242 Stream........................... 264 TMacroID....................... 283 TOrientation ................... 285 TPrintJustify ................... 286 TPrintUnits..................... 287 XD2U............................. 300 YD2I .............................. 303 YD2U............................. 303 ZoomIn.......................... 306 ZoomOut....................... 307

Methods
Clear................................ 98 Create............................ 106 Destroy .......................... 114 Execute.......................... 122 ExecuteCustom.............. 123 Finish............................ 126

Properties
FileName ....................... 126 GridHoriz ...................... 140 GridPen......................... 140 GridVert ........................ 140 IgnoreFileSettings........... 142 MarginMethod............... 159 StreamMode .................. 265 ZoomFactor .................. 305 ZoomInc........................ 306 ZoomPageFactor .......... 307 ZoomPageWidthFactor. 308

Types
TAccuracyMethod........... 276 TBKMode....................... 276 TFontAlign...................... 281 TLineHeightMethod ........ 282 TransparentBitmaps ....... 287 TStreamMode ................ 289 TTabJustify .................... 290 TMarginMethod............. 283

318

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.......................................................... 106 Destroy ........................................................ 114 Execute........................................................ 122 ExecuteCustom............................................ 123 XD2I.............................................................300 XD2U ...........................................................300 YD2I.............................................................303 YD2U ...........................................................303 Stream..........................................................264 StreamMode.................................................265 TPrintJustify..................................................286 TPrintUnits....................................................287 TransparentBitmaps......................................287 TStreamMode...............................................289 TTabJustify...................................................290

Properties
FileName ..................................................... 126 IgnoreFileSettings......................................... 142

Types
TAcuracyMethod .......................................... 276 TBKMode..................................................... 276 TFontAlign.................................................... 281 TLineHeightMethod ...................................... 282 TMacrold...................................................... 283 TOrientation ................................................. 285

319

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................................................ 181 OnLabelBefore ............................................. 181 OnLabelPrint.................................................181

Methods
Execute........................................................ 122

Properties
Border............................................................ 90 Col............................................................... 100 DrawExtents................................................. 118 DrawPen...................................................... 119 DrawPreviewOnly......................................... 119 Engine ......................................................... 121 LabelBrand................................................... 146 LabelHeight.................................................. 147 LabelShape.................................................. 147 LabelWidth ...................................................147 NumAcross...................................................169 NumDown.....................................................169 PrintByRow...................................................208 Row..............................................................236 SpacingHeight ..............................................258 SpacingLeft...................................................259 SpacingTop ..................................................259 SpacingWidth ...............................................259

320

TMasterShell

Component

Unit: Parentage:

RPShell.pas TBaseShell > TDetailShell > TMasterShell

This component is the next shell component in Rave 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 ................................................ 172 OnBodyBefore.............................................. 172 OnBodyFooter.............................................. 172 OnBodyHeader............................................. 172 OnDetailAfter .............................................. 176 OnDetailBefore ........................................... 176 OnGroupAfter ............................................. 178 OnGroupAfterLast ...................................... 179 OnGroupBefore...........................................179 OnGroupBeforeFirst ...................................179 OnGroupFooter...........................................179 OnGroupHeader..........................................179 OnRowAfter..................................................190 OnRowBefore ...............................................191 OnRowPrint ..................................................191

Methods
Execute........................................................ 122 PrintBodyFooter ........................................... 208 PrintBodyHeader.......................................... 208 PrintDetail................................................... 211 PrintGroupFooter........................................213 PrintGroupHeader.......................................213 PrintRow.......................................................221

Properties
DetailReport ................................................. 115 Engine ......................................................... 121 IsNewPage................................................... 144 IsReprint ...................................................... 144 Reprint ........................................................ 230 SectionBodyFooter....................................... 243 SectionBodyHeader ......................................243 SectionGroupFooter ...................................244 SectionGroupHeader ..................................244 SectionRow ..................................................247 StartNewPage...............................................260

321

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 .......................................................... 83 AppendMemoBuf............................................ 83 ContraintHeightLeft....................................... 103 Delete .......................................................... 112 Empty .......................................................... 120 FreeSaved ................................................... 136 GetNextLine................................................. 136 Insert............................................................ 143 InsertMemoBuf............................................. 143 LoadFromFile............................................... 154 LoadFromStream ......................................... 155 MemoHeightLeft........................................... 162 MemoLinesLeft............................................. 163 PrintHeight....................................................214 PrintLines .....................................................218 ReplaceAll ....................................................227 Reset............................................................231 RestoreBuffer ...............................................233 RTFLoadFromFile.........................................236 RTFLoadFromStream ...................................237 SaveBuffer....................................................238 SaveToStream..............................................240 SearchFirst ...................................................242 SearchNext...................................................243 SetData ........................................................251

Properties
Buffer............................................................. 94 BufferInc ........................................................ 94 Justify .......................................................... 145 MaxSize....................................................... 161 Memo........................................................... 162 NoCRLF....................................................... 167 NoNewLine...................................................167 Pos...............................................................205 PrintEnd .......................................................211 PrintStart ......................................................221 Size..............................................................258 Text..............................................................278

322

TRaveProject

Component

Unit: Parentage:

RVProj.pas TRaveReport > TRaveProjectManager

The RaveProject component provides a connection to the Rave Visual Designer

Method:
ClearRaveBlob............................................... 99 Close ............................................................. 99 Design ......................................................... 113 DesignReport ............................................... 114 Execute........................................................ 123 ExecuteReport ............................................. 124 GetReportCategoryList ................................. 137 GetReportList............................................... 137 LoadFromFile............................................... 154 LoadFromStream ......................................... 155 LoadRaveBlob.............................................. 155 OnDesignerSave.......................................... 175 OnDesignerShow ......................................... 175 Open............................................................ 194 ReportDescToMemo..................................... 229 Save.............................................................238 SaveToFile ...................................................240 SaveToStream..............................................241 SelectReport.................................................249 SetParam .....................................................??? WriteBCDData..............................................296 WriteBlobData...............................................296 WriteBoolData...............................................297 WriteCurrData...............................................297 WriteDateTime..............................................298 WriteFloatData..............................................298 WriteIntData..................................................299 WriteNullData ...............................................299 WriteStrData.................................................300

Property:
Active............................................................. 81 DataSet........................................................ 111 DLLFile ........................................................ 117 Engine ......................................................... 122 LoadDesigner............................................... 154 LocalFilter .................................................... 156 ProjectFile.................................................... 223 Query........................................................... 224 RaveBlobDateTime.......................................224 ReportDesc...................................................229 ReportFullName............................................230 ReportName .................................................230 RuntimeVisibility ...........................................238 StoreRAV .....................................................263 Table............................................................273 UseSetRange ...............................................294 OnFirst .........................................................176 OnGetCols....................................................177 OnGetRow....................................................178 OnGetSorts...................................................178 OnNext.........................................................183 OnOpen........................................................183 OnRestore....................................................190 OnSetFilter ...................................................192 OnSetSort.....................................................192 323

Event:
OnAfterClose................................................ 170 OnAfterOpen................................................ 170 OnBeforeClose............................................. 171 OnBeforeOpen............................................. 171 OnCreate ..................................................... 173 OnDesignerSave.......................................... 175 OnDesignerSaveAs...................................... 175 OnDesignerShow ......................................... 175 OnDestroy.................................................... 175 OnEOF ........................................................ 176

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 .................... 92

Events
OnAfterPrint OnBeforePrint OnDecodeImage 170 171 174 OnNewColumn 182 OnNewPage 182 OnPrintFooter................. 187 DrawFocusRect.............. 118 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.......................... 165 NewColumn ................... 165 NewLine......................... 165 NewPage ....................... 166 NoPrinterPageHeight...... 168 NoPrinterPageWidth....... 168 OnPrintHeader ............... 188 OnPrintPage .................. 189

Methods
Abort................................ 79 AbortPage........................ 80 AdjustLine........................ 82 AllowAll............................ 82 AllowPreviewOnly............. 83 AllowPrinterOnly............... 83 Arc................................... 84 AssignFont....................... 85 BrushCopy ....................... 94 CalcGraphicHeight ........... 95 CalcGraphicWidth............. 96 Chord............................... 97 ClearAllTabs .................... 98 ClearColumns .................. 98 ClearTabs ........................ 99 ColumnLinesLeft ............ 101 CopyRect ....................... 104 CR ................................. 105 Create............................ 106 CreateBrush................... 107 CreateFont..................... 109 CreatePen...................... 109 CreatePoint .................... 110 CreateRect..................... 110 Destroy .......................... 114 Draw .............................. 117 324 NoPrinters...................... 168 Pie ................................. 201 PIVar.............................. 202 Polygon.......................... 202 Polyline.......................... 203 PopFont ......................... 203 PopPos .......................... 204 PopTabs ........................ 204 Print ............................... 206 PrintBitmap .................... 206 PrintBitmapRect ............. 207 PrintBlock....................... 207 PrintCenter..................... 209 PrintCharJustify.............. 209 PrintData........................ 210 PrintDataStream............. 210 PrintFooter ..................... 213 PrintHeader.................... 213 PrintImageRect............... 216 PrintLeft ......................... 218 Println ............................ 218 PrintMemo...................... 218 PrintRight ....................... 221 PrintTab ......................... 222 PrintXY .......................... 222 PushFont ....................... 223

PushPos ........................ 223 PushTabs....................... 224 RecoverPrinter ............... 225 Rectangle....................... 225 RegisterGraphic ............. 226 ReleasePrinter ............... 227 Reset ............................. 231 ResetLineHeight............. 231 ResetPrinter ................... 232 ResetSection.................. 232 ResetTabs...................... 232 RestoreFont ................... 233 RestorePos .................... 233 RestoreTabs .................. 234

ReuseGraphic ................ 234 RoundRect..................... 236 SaveFont ....................... 239 SavePos ........................ 239 SaveTabs....................... 240 SelectPrinter .................. 249 SetBrush........................ 250 SetColumns ................... 250 SetColumnWidth ............ 251 SetFont .......................... 252 SetPaperSize ................. 252 SetPen........................... 253 SetPIVar ........................ 253 SetTab........................... 254 FontHandle .................... 130 FontHeight ..................... 131 FontName ...................... 131 FontPitch........................ 132 FontRotation .................. 132 Fonts.............................. 133 FontSize......................... 133 FontTop ......................... 133 FontWidth ...................... 134 FrameMode.................... 135 Italic............................... 145 LastPage........................ 148 LeftWaste....................... 149 LineBottom..................... 150 LineHeight...................... 151 LineHeightMethod .......... 151 LineMiddle...................... 151 LineNum ........................ 152 LinesPerInch .................. 153 LineTop.......................... 153 MacroData ..................... 158 MarginBottom................. 159 MarginLeft...................... 159 MarginRight.................... 160 MarginTop...................... 160 MaxCopies..................... 161 NoBufferLine .................. 167 NoNTColorFix ................ 168 NoPrinterPageHeight...... 168 NoPrinterPageWidth....... 168 Orientation ..................... 194 OriginX........................... 194

SetTopOfPage ............... 255 StretchDraw ................... 265 Tab ................................ 271 TabEnd .......................... 272 TabStart......................... 275 TabWidth ....................... 276 TextRect ........................ 280 TextWidth....................... 280 UnregisterGraphic .......... 292 UpdateStatus ................. 293 XD2I .............................. 300 XD2U............................. 300 YD2I .............................. 303 YD2U............................. 303 OriginY........................... 194 OutputInvalid.................. 195 OutputName................... 195 PageHeight .................... 198 PageInc.......................... 198 PageInvalid.................... 198 Pages ............................ 199 PageWidth ..................... 199 Papers ........................... 200 ParaJustify..................... 200 Port................................ 204 PrinterIndex.................... 212 Printers .......................... 212 Printing .......................... 217 ReportDateTime............. 229 RightWaste .................... 235 ScaleX ........................... 241 ScaleY ........................... 241 SectionBottom................ 244 SectionLeft..................... 245 SectionRight................... 246 SectionTop..................... 247 Selection........................ 248 ShadeColor.................... 256 ShadePercent ................ 256 ShadowDepth................. 257 StatusFormat.................. 262 StatusLabel .................... 262 StatusText...................... 263 Stream........................... 264 StreamMode .................. 265 Strikeout......................... 266 325

Properties
Aborted ............................ 80 AccuracyMethod............... 81 AscentHeight.................... 84 Bins ................................. 89 BKColor ........................... 89 Bold ................................. 89 BottomWaste.................... 91 BoxLineColor.................... 92 Canvas ............................ 96 Collate ........................... 100 ColumnEnd .................... 101 ColumnNum................... 102 Columns......................... 102 ColumnStart ................... 102 ColumnWidth.................. 103 Copies ........................... 103 CurrentPage................... 110 CurrentPass ................... 111 CursorXPos.................... 111 CursorYPos.................... 111 DescentHeight................ 113 DeviceName .................. 115 DevMode ....................... 116 DriverName.................... 119 Duplex ........................... 120 FileName ....................... 126 FirstPage ....................... 127 FontAlign........................ 129 FontBaseline .................. 129 FontBottom .................... 129 FontCharset ................... 130 FontColor....................... 130

Subscript........................ 266 Superscript..................... 267 TabColor........................ 271 TabJustify ...................... 272 TabShade ...................... 275

TextBKMode .................. 279 Title................................ 281 TopWaste ...................... 285 Totals............................. 285 Underline ....................... 291 TMacroId........................ 283 TOrientation ................... 285 TPrintJustify ................... 286

Units .............................. 291 UnitsFactor..................... 292 Width ............................. 295

Types
TAccuracyMethod........... 276 TBKMode....................... 276 TLineHeightMethod ........ 282 TPrintUnits..................... 287 TStreamMode ................ 289 TTabJustify .................... 290

326

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
BoxLineXxxx .................... 92

Events
OnAfterPrint ................... 170 OnBeforePrint ................ 171 OnDecodeImage ............ 174 OnNewColumn............... 182 OnNewPage................... 182 OnPrintFooter................. 187 OnPrintHeader ............... 188 OnPrintPage .................. 189

Methods
Abort................................ 79 AbortPage........................ 80 AdjustLine........................ 82 AllowAll............................ 82 AllowPreviewOnly............. 83 AllowPrinterOnly............... 83 Arc................................... 84 AssignFont....................... 85 BrushCopy ....................... 94 CalcGraphicHeight ........... 95 CalcGraphicWidth............. 96 Chord............................... 97 ClearAllTabs .................... 98 ClearColumns .................. 98 ClearTabs ........................ 99 ColumnLinesLeft ............ 101 CopyRect ....................... 104 CR ................................. 105 Create............................ 106 CreateBrush................... 107 CreateFont..................... 109 CreatePen...................... 109 CreatePoint .................... 110 CreateRect..................... 110 Destroy .......................... 114 Draw .............................. 117 DrawFocusRect.............. 118 Ellipse............................ 120 Execute.......................... 122 FillRect........................... 126 Finish............................. 126 FinishTabBox ................. 127 FloodFill ......................... 128 FrameRect ..................... 135 GetMemoLine................. 136 GetTab........................... 137 327

GotoFooter..................... 138 GotoHeader ................... 138 GotoXY.......................... 138 GraphicFieldToBitmap.... 139 Home............................. 142 LF .................................. 150 LinesLeft ........................ 152 LineTo............................ 153 Macro............................. 157 MemoLines .................... 163 MoveTo.......................... 165 NewColumn ................... 165 NewLine......................... 165 NewPage ....................... 166 NoPrinters...................... 168 PageHeight .................... 198 Pie ................................. 201 PIVar.............................. 202 Polygon.......................... 202 Polyline.......................... 203 PopFont ......................... 203 PopPos .......................... 204 PopTabs ........................ 204 Print ............................... 206 PrintBitmap .................... 206 PrintBitmapRect ............. 207 PrintBlock....................... 207 PrintCenter..................... 209 PrintCharJustify.............. 209 PrintData........................ 210 PrintDataStream............. 210

PrintFooter ..................... 213 PrintHeader.................... 213 PrintImageRect............... 216 PrintLeft ......................... 218 Println ............................ 218 PrintMemo...................... 218 PrintRight ....................... 221 PrintTab ......................... 222 PrintXY .......................... 222 PushFont ....................... 223 PushPos ........................ 223 PushTabs....................... 224 RecoverPrinter ............... 225 Rectangle....................... 225 RegisterGraphic ............. 226 ReleasePrinter ............... 227 Reset ............................. 231 ResetLineHeight............. 231 ResetPrinter ................... 232 ResetSection.................. 232 ResetTabs...................... 232 RestoreFont ................... 233 RestorePos .................... 233 RestoreTabs .................. 234 ReuseGraphic ................ 234 RoundRect..................... 236 SaveFont ....................... 239 SavePos ........................ 239 SaveTabs....................... 240 SelectBin........................ 248 SelectPaper ................... 249 CurrentPage................... 110 CurrentPass ................... 111 CursorXPos.................... 111 CursorYPos.................... 111 DescentHeight................ 113 DeviceName .................. 115 DevMode ....................... 116 DriverName.................... 119 Duplex ........................... 120 FirstPage ....................... 127 FontAlign........................ 129 FontBaseline .................. 129 FontBottom .................... 129 FontCharset ................... 130 FontColor....................... 130

SelectPrinter .................. 249 SetBrush........................ 250 SetColumns ................... 250 SetColumnWidth ............ 251 SetFont .......................... 252 SetPaperSize ................. 252 SetPen........................... 253 SetPIVar ........................ 253 SetTab........................... 254 SetTopOfPage ............... 255 Start............................... 260 StretchDraw ................... 265 SupportBin..................... 267 SupportCollate ............... 267 SupportDuplex ............... 268 SupportOrientation ......... 268 SupportPaper................. 268 Tab ................................ 271 TabEnd .......................... 272 TabStart......................... 275 TabWidth ....................... 276 TextRect ........................ 280 TextWidth....................... 280 UnregisterGraphic .......... 292 UpdateStatus ................. 293 XD2I .............................. 300 XD2U............................. 300 YD2I .............................. 303 YD2U............................. 303

Properties
Aborted ............................ 80 AscentHeight.................... 84 Bins ................................. 89 BKColor ........................... 89 Bold ................................. 89 BottomWaste.................... 91 BoxLineColor.................... 92 Canvas ............................ 96 Collate ........................... 100 ColumnEnd .................... 101 ColumnNum................... 102 Columns......................... 102 ColumnStart ................... 102 ColumnWidth.................. 103 Copies ........................... 103 328 FontHandle .................... 130 FontHeight ..................... 131 FontName ...................... 131 FontPitch........................ 132 FontRotation .................. 132 Fonts.............................. 133 FontSize......................... 133 FontTop ......................... 133 FrameMode.................... 135 Italic............................... 145 LastPage........................ 148 LeftWaste....................... 149 LineBottom..................... 150 LineHeight...................... 151 LineHeightMethod .......... 151

LineMiddle...................... 151 LineNum ........................ 152 LinesPerInch .................. 153 LineTop.......................... 153 MacroData ..................... 158 MarginBottom................. 159 MarginLeft...................... 159 MarginRight.................... 160 MarginTop...................... 160 MaxCopies..................... 161 NoBufferLine .................. 167 NoNTColorFix ................ 168 NoPrinterPageHeight...... 168 NoPrinterPageWidth....... 168 Orientation ..................... 194 OriginX........................... 194 OriginY........................... 194 OutputInvalid.................. 195 OutputName................... 195 PageHeight .................... 198 PageInc.......................... 198

PageInvalid.................... 198 Pages ............................ 199 PageWidth ..................... 199 Papers ........................... 200 ParaJustify..................... 200 Port................................ 204 PrinterIndex.................... 212 Printers .......................... 212 Printing .......................... 217 ReportDateTime............. 229 RightWaste .................... 235 ScaleX ........................... 241 ScaleY ........................... 241 SectionBottom................ 244 SectionLeft..................... 245 SectionRight................... 246 SectionTop..................... 247 Selection........................ 248 ShadeColor.................... 256 ShadePercent ................ 256 ShadowDepth................. 257 TLineHeightMethod ........ 282 TMacroId........................ 283 TOrientation ................... 285

StatusFormat.................. 262 StatusLabel .................... 262 StatusText...................... 263 Stream........................... 264 StreamMode .................. 265 Strikeout......................... 266 Subscript........................ 266 Superscript..................... 267 TabColor........................ 271 TabJustify ...................... 272 TabShade ...................... 275 TextBKMode .................. 279 Title................................ 281 TopWaste ...................... 285 Totals............................. 285 Underline ....................... 291 Units .............................. 291 UnitsFactor..................... 292 Width ............................. 295

Types
TBKMode....................... 276 TDuplex ......................... 277 TFontAlign...................... 281 TPrintJustify ................... 286 TPrintUnits..................... 287 TTabJustify .................... 290

329

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 330

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 ........................................................... 90 BottomMethod................................................ 91 Enabled........................................................ 121 FontIndex..................................................... 131 Height .......................................................... 141 HeightMethod............................................... 142 Left .............................................................. 148 LeftMethod................................................... 149 MinHeight .....................................................164 Right.............................................................235 RightMethod .................................................235 SetupSection ................................................256 TabIndex ......................................................272 Top...............................................................284 TopMethod ...................................................284

331

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 ................................................ 172 OnBodyBefore.............................................. 172 OnBodyFooter.............................................. 172 OnBodyHeader............................................. 172 OnDetailAfter................................................ 176 OnDetailBefore............................................. 176 OnGroupAfter............................................... 178 OnGroupAfterLast ........................................ 179 OnGroupBefore............................................ 179 OnGroupBeforeFirst ..................................... 179 OnGroupFooter ............................................ 179 OnGroupHeader........................................... 179 OnPageAfter................................................184 OnPageBefore.............................................184 OnPageFooter .............................................185 OnPageHeader............................................185 OnReportAfter.............................................190 OnReportBefore..........................................190 OnReportFooter ..........................................190 OnReportHeader .........................................190 OnRowAfter..................................................190 OnRowBefore ...............................................191 OnRowPrint ..................................................191

Methods
Execute........................................................ 122 PrintBodyFooter ........................................... 208 PrintBodyHeader.......................................... 208 PrintDetail .................................................... 211 PrintGroupFooter.......................................... 213 PrintGroupHeader ........................................ 213 PrintPageFooter ..........................................220 PrintPageHeader.........................................220 PrintReportFooter .......................................220 PrintReportHeader ......................................220 PrintRow.......................................................221

Properties
DetailReport ................................................. 115 Engine ......................................................... 121 IsNewPage................................................... 144 IsReprint ...................................................... 144 Reprint ......................................................... 230 SectionBodyFooter....................................... 243 SectionBodyHeader...................................... 243 SectionGroupFooter ..................................... 244 SectionGroupHeader ....................................244 SectionPageFooter .....................................245 SectionPageHeader ....................................245 SectionReportFooter...................................246 SectionReportHeader..................................246 SectionRow ..................................................247 StartNewPage...............................................260

332

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........................................... 197 OverrideSetup...............................................197 OverrideStatus..............................................197

Methods
PIVar............................................................ 202 SetPIVar ...................................................... 253

Properties
BaseReport .................................................... 88 DefaultDest .................................................. 112 GridHoriz...................................................... 140 GridPen........................................................ 140 GridVert ....................................................... 140 LineHeightMethod ........................................ 151 NoNTColorFix...............................................168 SystemFiler...................................................268 SystemOptions .............................................269 SystemPreview .............................................269 SystemPrinter ...............................................270 TableColumn ................................................273 TSystemSetup ..............................................290 TSystemSetups ............................................290

Types
TReportDest................................................. 288 TSystemOption............................................. 289 TSystemOptions........................................... 289

333

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 Rave 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...................................................... 210 PrintHyperLink.............................................. 214 PrintHyperLinkEnd........................................ 215 PrintHyperLinkStart.......................................215 PrintImage....................................................216

Properties
FileName ..................................................... 126 ParagraphAttribute ....................................... 200 ReplaceFileName......................................... 228 ReplaceToken.............................................. 228 ScreenDPI....................................................241 TableAttributes..............................................273 Title..............................................................281

334

TRPBarsBase
Unit: Parentage: RPBars.pas TRPBarsBase > TRPBarsXxxx Print ............................... 206 PrintXY .......................... 223 Center.............................. 97 CheckSum ....................... 97 Height ............................ 141 Left ................................ 148 Position.......................... 205 PrintChecksum............... 209 PrintReadable ................ 220 PrintTop ......................... 222

Class

Methods
Create............................ 105 IsValidChar .................... 145

Properties
BarBottom........................ 85 BarCodeJustify................. 86 BarCodeRotation.............. 86 BarHeight......................... 86 BarTop............................. 87 BarWidth.......................... 87 BaseReport ...................... 88 Bottom ............................. 90 ReadableHeight.............. 224 Right .............................. 235 Text ............................... 278 TextJustify...................... 279 Top ................................ 284 UseChecksum................ 293 WideFactor..................... 295 Width ............................. 295

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 ------- 212 PrintFimC ------- 212

TRPBarsPostNet
Method: PrintFimA ---------- 212

TRPBarsUPC
No unique Methods / Properties

Component

335

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 .......................................................... 83 SetData ........................................................251 Text..............................................................278

Properties
BufferInc ........................................................ 94 Size ............................................................. 258

336

TRPCustomConnection

Component

Unit: Parentage:

RVData.pas TRaveDataField > TRaveDataView

The CustomConnection component provides a connection to the Rave Visual Designer

Method:
Close ............................................................. 99 Execute........................................................ 123 GetReportList............................................... 137 Open............................................................ 194 ReportDescToMemo.....................................229 Save.............................................................238 SelectReport.................................................249

Property:
Active............................................................. 81 Engine ......................................................... 122 LocalFilter .................................................... 156 ProjectFile.................................................... 223 ReportDesc...................................................229 ReportFullName............................................230 ReportName .................................................230 RuntimeVisibility ...........................................238 OnNext.........................................................183 OnOpen........................................................183 OnRestore....................................................190 OnSetFilter ...................................................192 OnSetSort.....................................................192 OnValidateRow.............................................193

Event:
OnCreate ..................................................... 173 OnDestroy.................................................... 175 OnEOF ........................................................ 176 OnFirst......................................................... 176 OnGetCols................................................... 177 OnGetRow ................................................... 178 OnGetSorts.................................................. 178

337

TRPDataConnection

Component

Unit: Parentage:

RVData.pas TRaveDataField > TRaveDataView

The DataConnection component provides a connection to the Rave Visual Designer

Method:
ClearRaveBlob------------------------------------------- 99 Close-------------------------------------------------------- 99 Execute ---------------------------------------------------123 GetReportList -------------------------------------------137 LoadRaveBlob ------------------------------------------155 Open-------------------------------------------------------194 ReportDescToMemo----------------------------------229 Save -------------------------------------------------------238 SaveRaveBlob------------------------------------------239 SelectReport --------------------------------------------249 ReportDesc----------------------------------------------229 ReportFullName----------------------------------------230 ReportName---------------------------------------------230 StoreRAV ------------------------------------------------263 OnDesignerShow--------------------------------------175 OnDestroy -----------------------------------------------175

Property:
Active------------------------------------------------------- 81 Engine-----------------------------------------------------122 ProjectFile------------------------------------------------223 RaveBlobDateTime------------------------------------224

Event:
OnCreate-------------------------------------------------173 OnDesignerSave---------------------------------------175

338

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

339

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 Rave for a more detailed example of how to use TTablePrinter.

Events
OnAddTotal.................... 169 OnFooterAfter ................ 176 OnFooterBefore.............. 177 OnFooterHeight.............. 177 OnFooterPrint................. 177 OnFooterSetup............... 177 OnHeaderAfter ............... 180 OnHeaderHeight ............ 180 OnHeaderPrint ............... 180 OnInitMaster .................. 180 OnInitPage..................... 181 OnInitTable .................... 181 PrintBox ......................... 208
Margin .................................158 Margin100............................158 MemoBuf .............................162 MinFontSize.........................164 OverflowAppend...................196 OverflowMethod...................196 OverflowReplace..................197 PageTotal ............................199 Pen......................................201 ReportPrinter .......................230

OnRowAfter ................... 191 OnRowBefore................. 191 OnRowHeight................. 191 OnRowPrint.................... 192 OnRowSetup.................. 192

Methods
CreateColumn................ 108 PrintDefault .................... 211
ShadeColor......................... 256 ShadePercent ..................... 256 SplitRow.............................. 260 SubTotal ............................. 267 TableItem............................ 274 TablePrinter ........................ 274 Totals.................................. 285 UseParentFont .................... 294 UseParentPen..................... 294 Width .................................. 295

Properties
AsFloat..................................84 AsInteger...............................85 BoxLines................................93 Description ..........................113 DisplayFormat......................116 Font.....................................128 GrandTotal ..........................139 Heading...............................141 Justify..................................146 JustifyVert............................146

Types
TBoxLines...................... 277 TOverFlowMethod.......... 286 TPrintJustify ................... 286 TPrintJustifyVert............. 287

340

TTableItem
Unit: Parentage: RPTable.pas TTableItem

Class

This class is the base for all TTableItem components.

Methods
Append .......................................................... 83 SetData ........................................................251 Text..............................................................278

Properties
BufferInc ........................................................ 94 Size ............................................................. 258

341

TTablePrinter

Component

Unit: Parentage:

RPTable.pas TBaseShell > TTablePrinter OnInitTable..................................................181 OnValidateRow ...........................................193 Execute ........................................................122 StartPos.......................................................261 TableColumn...............................................273 TableColumns.............................................273 TableSection ...............................................274 TextBKMode................................................279

Events
OnGetNextRow........................................... 178 OnInitMaster ............................................... 181

Methods
Default ........................................................ 112

Properties
DetailTablePrinter....................................... 115 Engine ......................................................... 121 Font............................................................. 128 MasterTablePrinter ..................................... 161 Pen.............................................................. 201 ReprintHeader............................................. 231

342

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.........................................................187 OnSetup.......................................................192 Print Default..................................................211 Pen ..............................................................201 ReportPrinter ................................................230 Section .........................................................243 ShadeColor...................................................256 ShadePercent...............................................256 TablePrinter..................................................274 Text..............................................................278 UseParentFont..............................................294 UseParentPen ..............................................294 Width............................................................295

Methods
PrintBox ....................................................... 208

Properties
BoxLines........................................................ 93 Description................................................... 113 Font ............................................................. 128 Justify .......................................................... 145 JustifyVert .................................................... 146 Margin.......................................................... 158 Margin100.................................................... 158 MinFontSize................................................. 164 OverflowMethod ........................................... 196 OverflowReplace.......................................... 197 OutputType .................................................. 196

Types
TBoxLines.................................................... 277 TOutputType ................................................ 286 TOverflow Method ........................................ 286 TPrintJustify..................................................286 TPrintJustifyVert ...........................................287

343

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 ---------------------------------------------------------104 FileName -------------------------------------------------126 FormFeed ------------------------------------------------134 FormFeedStr --------------------------------------------134 LeftBorder------------------------------------------------149 LPI----------------------------------------------------------157 MarginBottom -------------------------------------------159 MarginLeft------------------------------------------------159 MarginRight ..................................................160 MarginTop ....................................................160 StatusFormat ................................................262 StatusLabel...................................................262 StatusText ....................................................263 TopBorder ....................................................284 Units.............................................................291 UnitsFactor ...................................................292 OnPrint.........................................................186 OnPrintFooter ...............................................187 OnPrintHeader..............................................188 OnPrintPage.................................................189

Event:
OnAfterPrint ................................................. 170 OnBeforePrint .............................................. 171 OnEndOfSection .......................................... 176 OnNewColumn............................................. 182 OnNewPage................................................. 182

344

Appendix

U
Units
The following is a list of the source files that make up Rave 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

345

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

346

Rave 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

347

Appendix

X
Categorical Event/Method/Property Reference
BarBottom property...................... 85 BarCodeJustify property............... 86 BarCodeRotation property............ 86 BarHeight property....................... 86 BarTop property........................... 87 BarWidth property........................ 87 BaseReport property.................... 88 Bottom property ........................... 90 Center property............................ 97 CheckSum property ..................... 97 CodePage property.................... 100

Bar Code

Create method............................105 Extended property ......................124 ExtendedText property................124 Height property...........................141 IsValidChar method ....................145 Left property...............................148 Position property ........................205 Print method...............................206 PrintChecksum property .............209 PrintFimA method.......................212 PrintFimB method.......................212 PrintFimC method.......................212 ColumnNum property..................102 Columns property .......................102 ColumnStart property..................102 ColumnWidth property ................103 Finish method.............................126 FirstPage property......................127 LastPage property ......................148 NewColumn method ...................165 NewLine method ........................165 NewPage method.......................166 NewPara method........................166 OnAfterPrint event......................170 OnBeforePrint event ...................171 OnNewColumn event..................182 OnNewPage event .....................182 OnOverFlow event......................183 OnPrint event .............................186 OnPrintFooter event ...................187 OnPrintHeader event..................188

PrintReadable property............... 220 PrintTop property ....................... 222 PrintXY method.......................... 223 ReadableHeight property............ 224 Right property ............................ 235 Text property.............................. 278 TextJustify property.................... 279 Top property .............................. 284 UseChecksum property.............. 293 WideFactor property................... 295 Width property ........................... 295

ClearColumns method.................. 98 ColumnEnd property .................. 101 ColumnLinesLeft method............ 101

Column

OnInitMaster .............................. 180 SetColumns method................... 250 SetColumnWidth method............ 251

Abort method............................... 79 Aborted property .......................... 80 AbortPage method....................... 80 AccuracyMethod property............. 81 AllowAll method ........................... 82 AllowPreviewOnly method............ 83 AllowPrinterOnly method.............. 83 BaseReport property.................... 88 CurrentPage property................. 110 Engine property ......................... 121 Execute method (frame)............. 122 Execute method (output) ............ 122 ExecuteCustom method ............. 123 FileName property ..................... 126

Control

OnPrintPage event..................... 189 OutputInvalid property................ 195 PageInvalid property .................. 198 Printing property......................... 217 Reset method ............................ 231 ScaleX property ......................... 241 ScaleY property ......................... 241 Selection property ...................... 248 Start method .............................. 260 Stream property ......................... 264 StreamMode property................. 265 TAccuracyMethod type............... 276 TOrientation type ....................... 285 TStreamMode type..................... 289

348

Font

AssignFont method................85 Bold property .........................89 CreateFont method ..............109 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...................203 PushFont method.................223 RestoreFont method.............233 FillRect method....................126 FloodFill method...................128 FrameMode method.............135 FrameRect method...............135 GraphicFieldToBitmap..........139 LineTo method.....................153 MoveTo method ...................165 NoBufferLine property ..........167 OnDecodeImage event.........174 Pie method ..........................201 Polygon method ...................202 Polyline method ...................203 PrintBitmap method..............206 PrintBitmapRect method.......207 PrintImageRect method........216 PrintHyperLinkEnd meth.......215 PrintHyperLinkStart meth......215 PrintImage method...............216 ReplaceFileName prop.........228 ReplaceToken property ........228 LabelShape property............147 LabelWidth property .............147 NumAcross property.............169 NumDown property ..............169 OnLabelAfter event ..............181 OnLabelBefore event ...........181 OnLabelPrint event...............181 PrintByRow property ............208 Row property .......................236 Field property.......................125 FreeSaved method...............136 GetMemoLine method..........136 GetNextLine method ............136 Insert method.......................143 InsertMemoBuf method ........143 Justify property.....................146 LoadFromFile method ..........154 LoadFromStream meth.........155

SaveFont method................ 239 SetFont method................... 252 Strikeout property................ 266 Subscript property ............... 266 Superscript property ............ 267 TFontAlign type ................... 281 Underline property............... 291

Arc method ............................84 BKColor property ...................89 BrushCopy method ................94 CalcGraphicHeight meth ........95 CalcGraphicWidth meth .........96 Chord method........................97 CopyRect method ................104 CreateBrush method............107 CreatePen method...............109 CreatePoint method .............110 CreateRect method..............110 Draw method .......................117 DrawFocusRect method.......118 Ellipse method .....................120

Graphics

Rectangle method ............... 225 RegisterGraphic method...... 226 ReuseGraphic method......... 234 RoundRect method.............. 236 SetBrush method................. 250 SetPen method ................... 253 ShadeToColor method......... 256 StretchDraw method............ 265 TBKMode type .................... 276 TextBKMode property.......... 279 TextRect method................. 280 TransparentBitmaps prop .... 287 UnregisterGraphic meth....... 292

HTML

FileName property ...............126 ParagraphAttribute.............. 200 PrintData method.................210 PrintHyperLink method.........214

ScreenDPI property............. 241 TableAttributes property....... 273 Title property ....................... 281

Label

Border property......................90 Col property.........................100 DrawExtents property...........118 DrawPen property................119 DrawPreviewOnly prop.........119 LabelBrand property.............146 LabelHeight property............147

SkipNum property................ 258 SpacingHeight property ....... 258 SpacingLeft property ........... 259 SpacingTop property ........... 259 SpacingWidth property ........ 259 StartCol property ................. 260 StartRow property ............... 261

Append method .....................83 AppendMemoBuf method.......83 BaseReport property..............88 Buffer property.......................94 BufferInc property ..................94 ConstraintHeightLeft me.......103 Delete method .....................112 Empty method......................120

Memo

MaxSize property ................ 161 Memo property.................... 162 MemoHeightLeft method...... 162 MemoLines method............. 163 MemoLinesLeft method ....... 163 NoCRLF property ................ 167 NoNewLine property............ 167 Pos property........................ 205 PrintEnd property ................ 211

349

PrintHeight method ..............214 PrintLines method................218 PrintMemo method...............218 PrintStart property................221 ReplaceAll method...............227 Reset method ......................231 RestoreBuffer method ..........233 RestoreState method ...........233

RichEdit property..................234 RTFField property ................236 RTFLoadFromFile meth........236 RTFLoadFromStream m.......237 RTFText property.................237 SaveBuffer method...............238 SaveState method................240 SaveToStream method.........240 LPI property .........................157 OnOverFlow event ...............183 SoftLine method...................258 StatusFormat property..........262 StatusLabel property ............262 StatusText property..............263 LeftBorder property ..............149 LF method ...........................150 LineBottom property.............150 LineHeight property..............151 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...................194 OriginY property...................194 PopPos method ...................204 OnPageChange event..........184 OnPreviewSetup event.........185 OnPreviewShow event .........186 OnZoomChange event .........193 PageInc property..................198 Pages property.....................199 PrevPage method ................205 PrintPage method ................219 RedrawPage method............225 RulerType property...............237

SearchFirst method ............. 242 SearchNext method............. 243 SetData method .................. 251 SetRTF method................... 254 Size property....................... 258 Text property....................... 278

CPI property ........................104 Create method.....................106 CurrentPass property ...........111 Destroy method ...................114 IgnoreFileSettings prop ........142

Misc

Title property ....................... 281 TotalPasses property........... 285 UpdateStatus method.......... 293 Version property.................. 294

AdjustLine method .................82 AscentHeight property............84 CR method ..........................105 CursorXPos property............111 CursorYPos property............111 DescentHeight property........113 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

Position

PushPos method................. 223 ResetLineHeight method ..... 231 ResetSection method .......... 232 RestorePos method............. 233 SavePos method................. 239 SectionBottom property ....... 244 SectionLeft property ............ 245 SectionRight property .......... 246 SectionTop property ............ 247 SetTopOfPage method........ 255 TextWidth method ............... 280 TLineHeightMethod type...... 282 TopBorder property ............. 284 XPos property ..................... 302 YPos property ..................... 304

Preview
AccuracyMethod property.......81 Clear method.........................98 GridHoriz property................140 GridPen property..................140 GridVert property .................140 MarginMethod property ........159 MarginPercent property........160 Monochrome property ..........164 NextPage method ................166

ScrollBox property ............... 242 ShadowDepth property........ 257 TMarginMethod type............ 283 ZoomFactor property ........... 305 ZoomIn method ................... 306 ZoomInc property ................ 306 ZoomOut method ................ 307 ZoomPageFactor prop......... 307 ZoomPageWidthFactor........ 308

350

Printer

Bins property .........................89 BottomWaste property............91 Canvas property ....................96 Collate property ...................100 Copies property ...................103 DeviceName property...........115 DevMode property ...............116 DriverName property............119 Duplex property ...................120 Fonts property......................133 LeftWaste property...............149 MaxCopies property.............161 NoNTColorFix property ........168 NoPrinterPageHeight prop ...168 NoPrinterPageWidth prop.....168 NoPrinters method ...............168

Orientation property..............194 OutputFileName property .....195 OutputName property...........195 PageHeight property ............198 PageWidth property..............199 Papers property ...................200 Port property........................204 PrintData method .................210 PrintDataStream method ......210 PrinterIndex property............212 Printers property...................212 RecoverPrinter method.........225 ReleasePrinter method.........227 ResetPrinter method ............232 RightWaste property.............235 RPDev function ....................236 SelectBin method.................248 PrintFooter method...............213 PrintHeader method .............213 PrintJustify property..............217 PrintLeft method...................218 PrintLn method.....................218 PrintRight method ................221 PrintTab method...................222 PrintXY method....................222 OnCreate event....................173 OnDesignerSave method .....175 OnDesignerSaveAs meth .....175 OnDesignerShow method.....175 OnDestroy event ..................175 OnEOF event.......................176 OnFirst event .......................176 OnGetCols event..................177 OnGetRow event..................178 OnGetSorts event ................178 OnNext event.......................183 OnOpen event......................183 OnRestore event ..................190 OnSetFilter event .................192 OnSetSort event...................192 OnValidateRow event...........193 Open method.......................194 ProjectFile property ..............223 Query property.....................224 RaveBlobDateTime prop ......224 ReportDesc property ............229 ReportDescToMemo meth....229

SelectPaper method............ 249 SelectPrinter method ........... 249 SetPaperSize method.......... 252 ShowPrintDialog method ..... 257 ShowPrinterSetupDialog...... 257 SupportBin method.............. 267 SupportCollate method........ 267 SupportDuplex method........ 268 SupportOrientation meth...... 268 SupportPaper method.......... 268 TDuplex type....................... 277 TextRect method................. 280 TopWaste property.............. 285 XDPI property...................... 301 YDPI property...................... 303

Printing
Macro method......................157 MacroData property .............158 PIVar method.......................202 Print method ........................206 PrintBlock method................207 PrintCenter method..............209 PrintCharJustify method .......209

ReportDateTime property .... 229 SetPIVar method................. 253 TruncateText property ......... 288 TMacroID type..................... 283 TPrintJustify type................. 286 TPrintJustifyVert type........... 287

Active property.......................81 ClearRaveBlob method ..........99 Close method ........................99 DataSet property..................112 Design method.....................113 DesignReport method ..........114 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 meth ........155 LoadRaveBlob method.........155 LocalFilter property ..............156 OnAfterClose event..............170 OnAfterOpen event ..............170 OnBeforeClose event...........171 OnBeforeOpen event ...........171

Rave

ReportFullName property..... 230 ReportName property .......... 230 RuntimeVisibility property .... 238 Save method....................... 238 SaveRaveBlob property....... 239 SaveToFile method ............. 240 SaveToStream method........ 241 SelectReport method........... 249 StoreRAV property .............. 263 Table property..................... 273 UseSetRange property ........ 294 WriteBCDData method ........ 296 WriteBlobData method......... 296 WriteBoolData method......... 297 WriteCurrData method......... 297 WriteDateTime method........ 298 WriteFloatData method........ 298 WriteIntData method............ 299 WriteNullData method.......... 299 WriteStrData method ........... 300

351

Render

Active property.......................81 CacheDir property..................95

DisplayName property..........117 ImageQuality property ..........143 MetafileDPI property.............163 HeightMethod property .........142 Left property.........................148 LeftMethod property .............149 MinHeight property...............164 Right property ......................235 RightMethod property...........235 SystemFiler property ............268 SystemOptions property .......269 SystemPreview property.......269 SystemPrinter property.........270 SystemSetups property ........270 TitlePreview property............281 RTFLoadFromFile meth........236 RTFLoadFromStream m.......237 RTFText property.................237 SetRTF method....................254 OnPageAfter event...............184 OnPageBefore event............184 OnPageFooter event ............185 OnPageHeader event...........185 OnReportAfter event ............190 OnReportBefore event..........190 OnReportFooter event..........190 OnReportHeader event ........190 OnRowAfter event................190 OnRowBefore event.............191 OnRowPrint event ................191 PrintBodyFooter method.......208 PrintBodyHeader meth .........208 PrintDetail method................211 PrintGroupFooter meth.........213 PrintGroupHeader meth........213 PrintPageFooter method.......219

OnCompress property ......... 173 ServerMode property...........250

Bottom property .....................90 BottomMethod property..........91 Enabled property..................121 FontIndex property...............131 Height property ....................141

ReportSection

SetupSection method .......... 256 TabIndex property ............... 272 Top property........................ 284 TopMethod prop.................. 284

DefaultDest property ............112 OverridePreview event.........197 OverrideSetup event ............197 OverrideStatus event ...........197 ReportDest property.............229

ReportSystem

TitleSetup property .............. 281 TitleStatus property ............. 282 TSystemOption type............ 289 TSystemSetup type ............. 290

RTF

ParaJustify property .............200 RichEdit property .................234 RTFField property................236

SoftLine method .................. 258 TextRect method................. 280

Shell
DetailReport property ...........115 IsNewPage property.............144 IsReprint property ................144 OnBodyAfter event...............172 OnBodyBefore event............172 OnBodyFooter event............172 OnBodyHeader event...........172 OnDetailAfter event..............176 OnDetailBefore event...........176 OnEndOfSection event.........176 OnGroupAfter event.............178 OnGroupAfterLast event.......179 OnGroupBefore event ..........179 OnGroupBeforeFirst ev ........179 OnGroupFooter event ..........179 OnGroupHeader event .........179

PrintPageHeader method .... 219 PrintReportFooter meth ....... 220 PrintReportHeader meth...... 220 PrintRow method................. 221 Reprint property................... 230 SectionBodyFooter prop ...... 243 SectionBodyHeader prop..... 243 SectionGroupFooter prop .... 244 SectionGroupHeader pro ..... 244 SectionPageFooter prop...... 245 SectionPageHeader prop..... 245 SectionReportFooter pro...... 246 SectionReportHeader pro .... 246 SectionRow property ........... 247 StartNewPage property ....... 260

352

AsFloat property ....................84 AsInteger property .................85 BoxLines property..................93 CreateColumn method .........108 DataSet property..................111 Default method ....................112 Description property.............113 DetailKey property ...............114 DetailTablePrinter prop ........115 DisplayFormat property........116 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 ...........164 OnAddTotal event................169 OnAfter event ......................169

TablePrinter

OnBefore event....................170 OnFooterAfter event.............176 OnFooterBefore event ..........177 OnFooterHeight event ..........177 OnFooterPrint event.............177 OnFooterSetup event ...........177 OnGetNextRow event...........178 OnHeaderAfter event ...........180 OnHeaderBefore event.........180 OnHeaderHeight event.........180 OnHeaderPrint event............180 OnHeaderSetup event..........180 OnInitMaster event...............181 OnInitPage event .................181 OnInitTable event.................181 OnOverFlow event ...............183 OnPrint event.......................187 OnRowAfter event................191 OnRowBefore event.............191 OnRowHeight event .............191 OnRowPrint event ................192 OnRowSetup event ..............192 OnSetup event.....................192 OnValidateRow event...........193 OutputType property ............196 OverflowAppend property.....196 OverflowMethod property .....196 OverflowReplace prop..........197 PopTabs method..................204 PushTabs method................224 ResetTabs method...............232 RestoreTabs method............234 SaveTabs method................240 SetTab method ....................254 Tab method..........................271 TabColor property ................271 XI2D method........................301 XI2U method........................301 XU2D method ......................302 XU2I method........................302 YD2I method........................303 YD2U method ......................303

PageTotal property.............. 199 Pen property ....................... 201 PrintBox method.................. 208 PrintDefault method............. 211 ReportPrinter property ......... 230 ReprintHeader property ....... 231 Section property .................. 243 SectionType property........... 247 ShadeColor property ........... 256 ShadePercent property........ 256 SplitRow property................ 260 StartPos property ................ 261 SubTotal property................ 267 TableColumn property ......... 273 TableColumns property ....... 273 TableItem property .............. 274 TablePrinter property........... 274 TableSection property.......... 274 TBoxLines type ................... 277 Text property....................... 278 Totals property .................... 285 TOutputType type................ 286 TOverFlowMethod type ....... 286 TReportDest type ................ 288 UseParentFont property....... 294 UseParentPen property ....... 294 Width property..................... 295

Tabs
BoxLineColor property............92 BoxLineXxxx constants ..........92 ClearAllTabs method..............98 ClearTabs method .................99 FinishTabBox method ..........127 GetTab method....................137

TabEnd method................... 272 TabJustify property.............. 272 TabShade property.............. 275 TabStart method.................. 275 TabWidth method................ 276 TTabJustify type.................. 290

Units

TPrintUnits type ...................287 Units property ......................291 UnitsFactor property.............292 XD2I method........................300 XD2U method......................300

YI2D method....................... 304 YI2U method....................... 304 YU2D method...................... 305 YU2I method....................... 305

353

Index
A Appendix Category Reference ........................... 348 ReportPrinter Units............................ 345 B Bar Code Reference............................... 348 BaseReport.............................................. 88 Bins......................................................... 89 Bitmap BrushCopy .......................................... 94 Convert GraphicField To Bitmap ....... 139 CreateBrush....................................... 107 PrintBitmap ....................................... 206 BKColor.................................................. 89 Bold ........................................................ 89 Border ..................................................... 90 BoxLineColor.......................................... 92 BoxLines................................................. 93 BoxLineXxxx.......................................... 92 BrushCopy .............................................. 94 C Canvas .................................................... 96 Class Bar Code 128 ................................................ 335 2 of 5 ............................................. 335 Base............................................... 335 Code39 .......................................... 335 EAN .............................................. 335 PostNet .......................................... 335 UPC............................................... 335 Base TBaseReport.................................. 311 TBaseShell .................................... 312 TCanvasReport .............................. 313 TRPBaseComponent...................... 336 TRPComponent ............................. 336 Framework TDetailShell................................... 317 TLabelShell ................................... 320 TMasterShell ................................. 321 TReportShell.................................. 332 Memo 354 TDBMemoBuf........................314, 341 TMemoBuf.................................... 322 Output TFilePreview ................................. 318 TFilePrinter ................................... 319 TReportFiler .................................. 324 TReportPrinter ............................... 327 TReportSystem .............................. 333 TRPHTMLFiler ............................. 334 TRTFFiler ..................................... 339 TTextFiler ..................................... 344 Rave Custom Connection........................ 337 Data Connection ............................ 338 Project ........................................... 323 Report TReportSection.............................. 330 Table TDBTableColumn ......................... 315 TDBTablePrinter ........................... 316 TTableColumn............................... 340 TTablePrinter ................................ 342 TTableSection ............................... 343 Class Tree ............................................. 309 Color Background......................................... 89 Font................................................... 130 Line................................................... 253 Column Clear ................................................... 98 Columns............................................ 102 End ................................................... 101 Justify ............................................... 145 Lines Left.......................................... 101 Number ............................................. 102 Start .................................................. 102 Width ................................................ 103 Constants amAppearance................................... 276 amPositioning.................................... 276 bkOpaque...................................276, 279 bkTransparent.............................276, 279 blAll............................................ 93, 277 blBottom ........................................... 277 blLeft ................................................ 277 blLeftBottom ..................................... 277

blLeftRight........................................ 277 blLeftTop .......................................... 277 blNoBottom ...................................... 277 blNoLeft ........................................... 277 blNone .............................................. 277 blNoRight ......................................... 277 blNoTop............................................ 277 blRight.............................................. 277 blRightBottom................................... 277 blRightTop........................................ 277 blTop ................................................ 277 blTopBottom ..................................... 277 BOXLINENONE ................................ 92 CHARSET ........................................ 130 cpCodeA ........................................... 100 cpCodeB ........................................... 100 cpCodeC ........................................... 100 DEFAULT_CHARSET..................... 130 dtBCD............................................... 296 dtBlob ............................................... 296 dtBoolean.......................................... 297 dtDate ............................................... 298 dtDateTime ....................................... 298 dtFloat........................................297, 298 dtGraphic .......................................... 296 dtInteger............................................ 299 dtMemo ............................................ 296 dtTime .............................................. 298 dupHorizontal ............................120, 277 dupSimlex......................................... 120 dupSimplex ....................................... 277 dupVertical ................................120, 277 faBaseline ..................................129, 281 faBottom ....................................129, 281 faTop .........................................129, 281 fmInside............................................ 135 fmOutside ......................................... 135 fmSplit.............................................. 135 lhmFont ............................................ 282 lhmLinesPerInch ............................... 282 lhmUser ............................................ 282 lsRect................................................ 147 lsRound............................................. 147 lsRoundRect...................................... 147 midCurrDateInter .............................. 283 midCurrDateLong ............................. 283 midCurrDateShort ............................. 283

midCurrDateUS .................................283 midCurrentPage .................................283 midCurrTime24 .................................283 midCurrTimeAMPM..........................283 midCurrTimeLong .............................283 midCurrTimeShort .............................283 midDriverName .................................283 midFirstPage......................................283 midLastPage ......................................283 midPortName.....................................283 midPrinterName.................................283 midTotalPages ...................................283 midUser00 .........................................283 omReplace ................................. 196, 286 omShrink ................................... 196, 286 omTruncate........................................286 omTruncateChar ................................196 omTruncateWord ....................... 196, 286 omWrap..................................... 196, 286 otGrandTotals ....................................286 otHeadings.........................................286 otPageTotals ......................................286 otSubTotals........................................286 otText ................................................286 pjBlock ...................................... 146, 286 pjBottom............................................287 pjCenter ................86, 146, 254, 279, 286 pjLeft ............ 86, 145, 146, 254, 279, 286 pjMiddle .................................... 146, 287 pjRight.......... 86, 145, 146, 254, 279, 286 pjTop .................................................287 poDefault................................... 194, 285 poLandscape .............................. 194, 285 poPortrait................................... 194, 285 rdFile.................................................288 rdPreview...........................................288 rdPrinter.............................................288 Rot0.....................................................86 Rot180.................................................86 Rot270.................................................86 Rot90...................................................86 rtBothCm...........................................237 rtBothIn .............................................237 rtDeveloper ........................................238 rtEndUser...........................................238 rtHorizCm..........................................237 rtHorizIn ............................................237 355

rtNone ....................................... 237, 238 rtVertCm ........................................... 237 rtVertIn ............................................. 237 smFile ....................................... 265, 289 smMemory ................................ 265, 289 smTempFile .............................. 265, 289 smUser ...................................... 265, 289 soAllowPrintFromPreview................. 269 soNoGenerate.................................... 269 soPreviewModal ................................ 269 soShowStatus .................................... 269 soUseFiler ......................................... 269 soWaitForOK .................................... 269 ssAllowCopies................................... 290 ssAllowDestFile ................................ 290 ssAllowDestPreview.......................... 290 ssAllowDestPrinter ............................ 290 ssAllowPrinterSetup .......................... 290 ssAllowSetup..................................... 290 ssCollate............................................ 290 ssDuplex............................................ 290 tjBlock .............................................. 290 tjCenter ............................................. 290 tjLeft ................................................. 290 tjNone ............................................... 290 tjRight............................................... 290 unCM........................................ 287, 291 unInch ....................................... 287, 291 unMM ....................................... 287, 291 unPoint...................................... 287, 291 unUser....................................... 287, 291 Control New Column ..................................... 165 New Line........................................... 165 New Page .......................................... 166 New Paragraph .................................. 166 CPI........................................................ 104 CR ........................................................ 105 Create.................................................... 106 CRLF ..................................... See NewLine D DataSet ......................................... 111, 112 Destroy ................................................. 114 Device Mode................................................. 116 Name................................................. 115 356

Display Format...................................... 116 DLL File ............................................... 117 Draw Arc...................................................... 84 Draw Line To X,Y............................. 153 Ellipse............................................... 120 FillRect ............................................. 126 Move To Point................................... 165 No Buffer Line.................................. 167 Draw Pen .............................................. 119 Driver Name ......................................... 119 E Ellipse................................................... 120 Engine............................................121, 122 Event OnAddTotal ...................................... 169 OnAfter............................................. 169 OnAfterClose .................................... 170 OnAfterOpen..................................... 170 OnAfterPrint ..................................... 170 OnBefore........................................... 170 OnBeforeClose .................................. 171 OnBeforeOpen .................................. 171 OnBeforePrint ................................... 171 OnBodyAfter..................................... 172 OnBodyBefore .................................. 172 OnBodyFooter................................... 172 OnBodyHeader.................................. 172 OnCreate........................................... 173 OnDecodeImage................................ 174 OnDesignerSave................................ 175 OnDesignerSaveAs............................ 175 OnDesignerShow............................... 175 OnDestroy......................................... 175 OnDetailAfter.................................... 176 OnDetailBefore ................................. 176 OnEndOfSection ............................... 176 OnEOF.............................................. 176 OnFirst .............................................. 176 OnFooterAfter ................................... 176 OnFooterBefore................................. 177 OnFooterHeight................................. 177 OnFooterPrint.................................... 177 OnFooterSetup .................................. 177 OnGetCols ........................................ 177 OnGetNextRow................................. 178

OnGetRow ........................................ 178 OnGetSorts ....................................... 178 OnGroupAfter ................................... 178 OnGroupAfterLast ............................ 179 OnGroupBefore................................. 179 OnGroupBeforeFirst.......................... 179 OnGroupFooter ................................. 179 OnGroupHeader ................................ 179 OnHeaderAfter.................................. 180 OnHeaderBefore ............................... 180 OnHeaderHeight ............................... 180 OnHeaderPrint .................................. 180 OnHeaderSetup ................................. 180 OnInitMaster ..............................180, 181 OnInitPage........................................ 181 OnInitTable....................................... 181 OnLabelAfter .................................... 181 OnLabelBefore.................................. 181 OnLabelPrint..................................... 181 OnNewColumn ................................. 182 OnNewPage ...................................... 182 OnNext ............................................. 183 OnOpen ............................................ 183 OnOverFlow ..................................... 183 OnPageAfter ..................................... 184 OnPageBefore................................... 184 OnPageChange.................................. 184 OnPageFooter ................................... 185 OnPageHeader .................................. 185 OnPreviewSetup................................ 185 OnPreviewShow................................ 186 OnPrint ......................................186, 187 OnPrintFooter ................................... 187 OnPrintHeader .................................. 188 OnPrintPage...................................... 189 OnReportAfter .................................. 190 OnReportBefore................................ 190 OnReportFooter ................................ 190 OnReportHeader ............................... 190 OnRestore......................................... 190 OnRowAfter ..............................190, 191 OnRowBefore ................................... 191 OnRowHeight ................................... 191 OnRowPrint...............................191, 192 OnRowSetup..................................... 192 OnSetFilter........................................ 192 OnSetSort ......................................... 192

OnSetup.............................................192 OnValidateRow .................................193 OnValidateRow .................................193 OnZoomChange.................................193 Override.............................................197 OverrideSetup....................................197 OverrideStatus ...................................197 Execute.......................................... 122, 123 F FieldName.............................................125 FileName...............................................126 Finish ....................................................126 First Page...............................................127 FloodFill................................................128 Font Align .................................................129 Assign Font..........................................85 Baseline.............................................129 Bold attribute .......................................89 Bottom...............................................129 Bottom of Line...................................150 Color .................................................130 Create ................................................109 Font ...................................................128 Fonts..................................................133 Handle ...............................................130 Height................................................131 Height of Line....................................151 Index .................................................131 Italic attribute.....................................145 Line Height Method ...........................151 Lines Per Inch ....................................153 LPI ....................................................157 Middle of Line...................................151 Minimum Font Size............................164 Name.................................................131 Pitch ..................................................132 Rotation .............................................132 Size....................................................133 Top ....................................................133 Top of Line........................................153 Underline attribute .............................291 Width.................................................134 Fonts .....................................................133 Format Border Top.........................................284 357

Frame Rectangle.................................... 135 FrameMode........................................... 135 G Graphics Arc...................................................... 84 Background Color................................ 89 BrushCopy .......................................... 94 Calculate Height .................................. 95 Calculate Width ................................... 96 Chord .................................................. 97 Convert GraphicField To Bitmap ....... 139 CopyRect .......................................... 104 CreateBrush....................................... 107 CreatePen .......................................... 109 CreatePoint........................................ 110 CreateRect ......................................... 110 Draw ................................................. 117 Draw Line To X,Y............................. 153 DrawFocusRect ................................. 118 Ellipse ............................................... 120 Fill .................................................... 128 FillRect ............................................. 126 Frame Rectangle................................ 135 FrameMode ....................................... 135 Move To Point................................... 165 No Buffer Line .................................. 167 PrintBitmap ....................................... 206 Register Graphic................................ 226 Reuse ................................................ 234 StretchDraw ...................................... 265 UnregisterGraphic ............................. 292 H Height Ascent ................................................. 84 Help Adding Context Sensitive..................... 11 C++Builder ......................................... 12 Delphi 3 .............................................. 11 Delphi 4 .............................................. 11 Delphi 5 .............................................. 11 Home .................................................... 142 L Label Border ................................................. 90 358

Brand ................................................ 146 Col .................................................... 100 DrawExtents...................................... 118 DrawPen ........................................... 119 DrawPreviewOnly ............................. 119 Height ............................................... 147 Number Across.................................. 169 Number Down ................................... 169 Shape ................................................ 147 Width ................................................ 147 LeftBorder ............................................ 149 Line Adjust ................................................. 82 Lines Column Lines Left............................. 101 M Macro ................................................... 157 Margin .................................................. 158 Memo ................................................... 154 Append ............................................... 83 Append to MemoBuf ........................... 83 Assign Memo to buffer ...................... 162 BaseReport.......................................... 88 Buffer.................................................. 94 Constrain Height ............................... 103 Current Position................................. 205 Delete part of buffer .......................... 112 Empty Status ..................................... 120 End Print Position.............................. 211 Field.................................................. 125 Free Memory..................................... 136 Get Memo Line ................................. 136 Get Next Line.................................... 136 Height of Memo Lines Left................ 162 Increment Buffer Size.......................... 94 Insert................................................. 143 Insert into Memobuf .......................... 143 Justification Style .............................. 146 Load buffer From Stream................... 155 Maximum Size .................................. 161 No CRLF .......................................... 167 No New Line..................................... 167 Number of Memo Lines..................... 163 Number of Memo Lines Left ............. 163 Replace All x with y.......................... 227 Reset Buffer ...................................... 231

Restore Buffer ................................... 233 Restore State ..................................... 233 RichEdit............................................ 234 RTF Field.......................................... 236 RTF Load File................................... 236 RTF Load Stream.............................. 237 RTF output........................................ 254 RTFText ........................................... 237 Save Buffer ....................................... 238 Save State ......................................... 240 Save To Stream ................................. 240 Search First ....................................... 242 Search Next....................................... 243 Set Data ............................................ 251 Size in bytes ...................................... 258 Start Print Position ............................ 221 Text .................................................. 278 Method Abort .................................................. 79 AbortPage........................................... 80 AdjustLine .......................................... 82 AllowAll ............................................. 82 AllowPreviewOnly.............................. 83 AllowPrinterOnly................................ 83 Append ............................................... 83 AppendMemoBuf................................ 83 Arc...................................................... 84 AssignFont.......................................... 85 BrushCopy.......................................... 94 CalcGraphicHeight.............................. 95 CalcGraphicWidth............................... 96 Chord.................................................. 97 Clear ................................................... 98 ClearAllTabs ....................................... 98 ClearColumns ..................................... 98 ClearRaveBlob.................................... 99 ClearTabs............................................ 99 Close................................................... 99 ColumnLinesLeft .............................. 101 ConstraintHeightLeft ......................... 103 CopyRect .......................................... 104 CR .................................................... 105 Create ........................................105, 106 CreateBrush ...................................... 107 CreateColumn ................................... 108 CreateFont ........................................ 109 CreatePen.......................................... 109

CreatePoint ........................................110 CreateRect .........................................110 Default...............................................112 Delete ................................................112 Design ...............................................113 DesignReport.....................................114 Destroy ..............................................114 Draw..................................................117 DrawFocusRect..................................118 Ellipse................................................120 Empty................................................120 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........................................145 LF......................................................150 LinesLeft ...........................................152 LineTo...............................................153 LoadFromFile ....................................154 LoadFromStream ...............................155 LoadRaveBlob ...................................155 Macro ................................................157 MemoHeightLeft................................162 MemoLines........................................163 MemoLinesLeft .................................163 MoveTo .............................................165 NewColumn.......................................165 NewLine............................................165 359

NewPage ........................................... 166 NewPara............................................ 166 NextPage........................................... 166 NoPrinters ......................................... 168 Open ................................................. 194 Pie..................................................... 201 PIVar................................................. 202 Polygon ............................................. 202 Polyline............................................. 203 PopFont............................................. 203 PopPos .............................................. 204 PopTabs ............................................ 204 PrevPage ........................................... 205 Print .................................................. 206 PrintBitmap ....................................... 206 PrintBitmapRect ................................ 207 PrintBlock ......................................... 207 PrintBodyFooter ................................ 208 PrintBodyHeader ............................... 208 PrintBox ............................................ 208 PrintCenter ........................................ 209 PrintCharJustify................................. 209 PrintData ........................................... 210 PrintDataStream ................................ 210 PrintDefault....................................... 211 PrintDetail......................................... 211 PrintFimA ......................................... 212 PrintFimB.......................................... 212 PrintFimC.......................................... 212 PrintFooter ........................................ 213 PrintGroupFooter............................... 213 PrintGroupHeader.............................. 213 PrintHeader ....................................... 213 PrintHeight........................................ 214 PrintHyperLink.................................. 214 PrintHyperLinkEnd............................ 215 PrintHyperLinkStart........................... 215 PrintImage......................................... 216 PrintImageRect .................................. 216 PrintJustify ........................................ 217 PrintLeft ............................................ 218 PrintLines.......................................... 218 PrintLn .............................................. 218 PrintMemo ........................................ 219 PrintPage........................................... 219 PrintPageFooter ................................. 220 PrintPageHeader ................................ 220 360

PrintReportFooter .............................. 220 PrintReportHeader ............................. 220 PrintRight.......................................... 221 PrintRow........................................... 221 PrintTab ............................................ 222 PrintXY......................................222, 223 PushFont ........................................... 223 PushPos............................................. 223 PushTabs........................................... 224 RecoverPrinter................................... 225 Rectangle .......................................... 225 RedrawPage ...................................... 225 RegisterGraphic................................. 226 ReleasePrinter ................................... 227 ReplaceAll ........................................ 227 ReportDescToMemo ......................... 229 Reset ................................................. 231 ResetLineHeight................................ 231 ResetPrinter....................................... 232 ResetSection...................................... 232 ResetTabs.......................................... 232 RestoreBuffer .................................... 233 RestoreFont....................................... 233 RestorePos ........................................ 233 RestoreState ...................................... 233 RestoreTabs....................................... 234 ReuseGraphic .................................... 234 RoundRect ........................................ 236 RTFLoadFromFile............................. 236 RTFLoadFromStream........................ 237 Save .................................................. 238 SaveBuffer ........................................ 238 SaveFont ........................................... 239 SavePos............................................. 239 SaveRaveBlob................................... 239 SaveState........................................... 240 SaveTabs........................................... 240 SaveToFile ........................................ 240 SaveToStream ............................240, 241 SearchFirst ........................................ 242 SearchNext........................................ 243 SelectBin........................................... 248 SelectPaper........................................ 249 SelectPrinter ...................................... 249 SelectReport...................................... 249 SetBrush............................................ 250 SetColumns....................................... 250

SetColumnWidth............................... 251 SetData ............................................. 251 SetFont ............................................. 252 SetPaperSize ..................................... 252 SetParam........................................... 253 SetPen............................................... 253 SetPIVar ........................................... 253 SetRTF ............................................. 254 SetTab............................................... 254 SetTopOfPage ................................... 255 SetupSection ..................................... 256 ShadeToColor ................................... 256 ShowPrintDialog ............................... 257 ShowPrinterSetupDialog ................... 257 SoftLine............................................ 258 Start .................................................. 260 StretchDraw ...................................... 265 SupportBin........................................ 267 SupportCollate .................................. 267 SupportDuplex .................................. 268 SupportOrientation ............................ 268 SupportPaper..................................... 268 Tab ................................................... 271 TabEnd ............................................. 272 TabStart ............................................ 275 TabWidth .......................................... 276 TextRect ........................................... 280 TextWidth......................................... 280 TruncateText..................................... 288 UnregisterGraphic ............................. 292 UpdateStatus ..................................... 293 WriteBCDData.................................. 296 WriteBlobData .................................. 296 WriteBoolData .................................. 297 WriteCurrData................................... 297 WriteDateTime.................................. 298 WriteFloatData.................................. 298 WriteIntData ..................................... 299 WriteNullData................................... 299 WriteStrData ..................................... 300 XD2I................................................. 300 XD2U ............................................... 300 XI2D................................................. 301 XI2U................................................. 301 XU2D ............................................... 302 XU2I................................................. 302 YD2I................................................. 303

YD2U ................................................303 YI2D .................................................304 YI2U .................................................304 YU2D ................................................305 YU2I .................................................305 ZoomIn..............................................306 ZoomOut ...........................................307 N NewColumn...........................................165 NewLine................................................165 O OnAfterPrint..........................................170 Output All options available.............................82 Preview Only .......................................83 Printer Only .........................................83 P Page Abort ...................................................80 Current...............................................110 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........................................111 CursorYPos........................................111 DescentHeight....................................113 Font Top ............................................133 FontBaseline......................................129 FontBottom........................................129 Go to Position X,Y.............................138 Goto Footer........................................138 Goto Header.......................................138 Height of Line....................................151 LF......................................................150 361

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 ........................................... 205 Preview Only - Draw............................. 119 PrevPage ............................................... 205 Print ...................................................... 206 PrintBitmap........................................... 206 Printer Bins Available..................................... 89 Canvas ................................................ 96 Collate............................................... 100 Copies ............................................... 103 DeviceName...................................... 115 DevMode .......................................... 116 Driver Name...................................... 119 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........................................... 148 MaxCopies ........................................ 161 No Printers ........................................ 168 NoPrinterPageHeight......................... 168 NoPrinterPageWidth.......................... 168 OnAfterPrint...................................... 170 Table BoxLines ......................................... 93 CreateColumn................................ 108 Default........................................... 112 362

Description .................................... 113 DetailKey ...................................... 114 DetailTablePrinter.......................... 115 DisplayFormat............................... 116 Execute.......................................... 123 Font............................................... 128 Heading......................................... 141 Justify Vertical .............................. 146 Margin........................................... 158 Margin 100ths of inch .................... 158 MemoBuf ...................................... 162 Minimum Font Size ....................... 164 OnAddTotal................................... 169 Waste........................... 91, 149, 235, 285 Printing Macro................................................ 157 MacroData ........................................ 158 Property Active ................................................. 81 Property Aborted ............................................... 80 AccuracyMethod ................................. 81 Active ................................................. 81 AscentHeight....................................... 84 AsFloat ............................................... 84 AsInteger............................................. 85 BarBottom........................................... 85 BarCodeJustify.................................... 86 BarCodeRotation ................................. 86 BarHeight............................................ 86 BarTop................................................ 87 BarWidth............................................. 87 BaseReport.......................................... 88 Bins..................................................... 89 BKColor.............................................. 89 Bold .................................................... 89 Border ................................................. 90 Bottom ................................................ 90 BottomMethod .................................... 91 BottomWaste....................................... 91 BoxLineColor...................................... 92 BoxLines............................................. 93 Buffer.................................................. 94 BufferInc............................................. 94 CacheDir ............................................. 95 Canvas ................................................ 96 Center ................................................. 97

Checksum ........................................... 97 CodePage.......................................... 100 Col.................................................... 100 Collate .............................................. 100 ColumnEnd....................................... 101 ColumnNum ..................................... 102 Columns............................................ 102 ColumnStart...................................... 102 ColumnWidth.................................... 103 Copies............................................... 103 CPI ................................................... 104 CurrentPage ...................................... 110 CurrentPass....................................... 111 CursorXPos....................................... 111 CursorYPos....................................... 111 DataSet ......................................111, 112 DefaultDest ....................................... 112 DescentHeight................................... 113 Description........................................ 113 DetailKey.......................................... 114 DetailReport...................................... 115 DetailTablePrinter ............................. 115 DeviceName...................................... 115 DevMode .......................................... 116 DisplayFormat................................... 116 DisplayName .............................117, 250 DLLFile ............................................ 117 DrawExtents...................................... 118 DrawPen ........................................... 119 DrawPreviewOnly............................. 119 DriverName ...................................... 119 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 ImageQuality .....................................143 IsNewPage.........................................144 IsReprint............................................144 Italic ..................................................145 Justify........................................ 145, 146 JustifyVert .........................................146 LabelBrand ........................................146 LabelHeight .......................................147 LabelShape ........................................147 LabelWidth ........................................147 LastPage ............................................148 Left....................................................148 LeftBorder .........................................149 LeftMethod ........................................149 LeftWaste ..........................................149 LineBottom........................................150 LineHeight.........................................151 LineHeightMethod .............................151 LineMiddle ........................................151 LineNum............................................152 LinesPerInch ......................................153 LineTop .............................................153 LoadDesigner.....................................154 LocalFilter .........................................156 LookupDataSet ..................................156 LookupDisplay...................................156 363

LookupKey........................................ 156 LPI .................................................... 157 Margin .............................................. 158 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 MetafileDPI....................................... 163 MinFontSize...................................... 164 MinHeight......................................... 164 Monochrome ..................................... 164 NoBufferLine .................................... 167 NoCRLF............................................ 167 NoNewLine....................................... 167 NoNTColorFix .................................. 168 NoPrinterPageHeight......................... 168 NoPrinterPageWidth.......................... 168 NumAcross........................................ 169 NumDown ......................................... 169 OnCompress...................................... 173 Orientation ........................................ 194 OriginX............................................. 194 OriginY............................................. 194 OutputFileName ................................ 195 OutputInvalid .................................... 195 OutputName...................................... 195 OutputType ....................................... 196 OverflowAppend ............................... 196 OverflowMethod ............................... 196 OverflowReplace ............................... 197 PageHeight........................................ 198 PageInc ............................................. 198 PageInvalid........................................ 198 Pages................................................. 199 PageTotal .......................................... 199 PageWidth......................................... 199 Papers................................................ 200 ParagraphAttribute............................. 200 364

ParaJustify......................................... 200 Pen.................................................... 201 Port ................................................... 204 Pos .................................................... 205 Position ............................................. 205 PrintByRow....................................... 208 PrintChecksum .................................. 209 PrintEnd............................................ 211 PrinterIndex....................................... 212 Printers.............................................. 212 Printing ............................................. 217 PrintReadable.................................... 220 PrintStart........................................... 221 PrintTop ............................................ 222 ProjectFile......................................... 223 Query................................................ 224 RaveBlobDateTime ........................... 224 ReadableHeight ................................. 224 ReplaceFileName .............................. 228 ReplaceToken.................................... 228 ReportDateTime ................................ 229 ReportDesc........................................ 229 ReportDest ........................................ 229 ReportFullName................................ 230 ReportName ...................................... 230 ReportPrinter..................................... 230 Reprint.............................................. 230 ReprintHeader ................................... 231 RichEdit ............................................ 234 Right................................................. 235 RightMethod ..................................... 235 RightWaste........................................ 235 Row .................................................. 236 RTFField........................................... 236 RTFText............................................ 237 RulerType ......................................... 237 RuntimeVisibility .............................. 238 ScaleX............................................... 241 ScaleY............................................... 241 ScreenDPI ......................................... 241 ScrollBox .......................................... 242 Section .............................................. 243 SectionBodyFooter ............................ 243 SectionBodyHeader ........................... 243 SectionBottom................................... 244 SectionGroupFooter........................... 244 SectionGroupHeader ......................... 244

SectionLeft........................................ 245 SectionPageFooter............................. 245 SectionPageHeader............................ 245 SectionReportFooter.......................... 246 SectionReportHeader......................... 246 SectionRight ..................................... 246 SectionRow....................................... 247 SectionTop........................................ 247 SectionType ...................................... 247 Selection ........................................... 248 ShadeColor ....................................... 256 ShadePercent..................................... 256 ShadowDepth.................................... 257 Size................................................... 258 SkipNum........................................... 258 SpacingHeight................................... 258 SpacingLeft....................................... 259 SpacingTop ....................................... 259 SpacingWidth.................................... 259 SplitRow ........................................... 260 StartCol............................................. 260 StartNewPage.................................... 260 StartPos............................................. 261 StartRow ........................................... 261 StatusFormat ..................................... 262 StatusLabel ....................................... 262 StatusText ......................................... 263 StoreRAV ......................................... 263 Stream............................................... 264 StreamMode...................................... 265 Strikeout ........................................... 266 Subscript ........................................... 266 SubTotal ........................................... 267 Superscript........................................ 267 SystemFiler ....................................... 268 SystemOptions .................................. 269 SystemPreview.................................. 269 SystemPrinter .................................... 270 SystemSetups .................................... 270 TabColor........................................... 271 TabIndex........................................... 272 TabJustify ......................................... 272 Table................................................. 273 TableAttributes.................................. 273 TableColumn .................................... 273 TableColumns................................... 273 TableItem.......................................... 274

TablePrinter .......................................274 TableSection ......................................274 TabShade...........................................275 Text ...................................................278 TextBKMode .....................................279 TextJustify .........................................279 Title...................................................281 TitlePreview.......................................281 TitleSetup ..........................................281 TitleStatus..........................................282 Top ....................................................284 TopBorder .........................................284 TopMethod ........................................284 TopWaste...........................................285 TotalPasses ........................................285 Totals.................................................285 TransparentBitmaps ...........................287 Underline...........................................291 Units..................................................291 UnitsFactor ........................................292 UseChecksum ....................................293 UseCompression ................................293 UseParentFont....................................294 UseParentPen.....................................294 UseSetRange......................................294 Version ..............................................294 WideFactor ........................................295 Width.................................................295 XDPI .................................................301 XPos ..................................................302 YDPI .................................................303 YPos ..................................................304 ZoomFactor .......................................305 ZoomInc ............................................306 ZoomPageFactor ................................307 ZoomPageWidthFactor.......................308 Q Quit .........................................................79 R Rave Abort ...................................................79 Active ..................................................81 ClearRaveBlob.....................................99 Close ...................................................99 DataSet ..............................................112 365

Design............................................... 113 DesignReport..................................... 114 DLLFile ............................................ 117 Engine............................................... 122 Execute ............................................. 123 ExecuteReport ................................... 124 FieldAliasList .................................... 125 GetReportCategoryList ...................... 137 GetReportList .................................... 137 LoadDesigner .................................... 154 LoadFromFile.................................... 154 LoadFromStream............................... 155 LoadRaveBlob................................... 155 LocalFilter ......................................... 156 OnAfterClose .................................... 170 OnAfterOpen ..................................... 170 OnBeforeClose .................................. 171 OnBeforeOpen................................... 171 OnCreate ........................................... 173 OnDesignerSave ................................ 175 OnDesignerSaveAs............................ 175 OnDesignerShow............................... 175 OnDestroy......................................... 175 OnEOF.............................................. 176 OnFirst .............................................. 176 OnGetCols......................................... 177 OnGetRow ........................................ 178 OnGetSorts........................................ 178 OnNext.............................................. 183 OnOpen ............................................. 183 OnRestore ......................................... 190 OnSetFilter ........................................ 192 OnSetSort.......................................... 192 OnValidateRow ................................. 193 Open ................................................. 194 ProjectFile ......................................... 223 Query ................................................ 224 RaveBlobDateTime ........................... 224 ReportDesc........................................ 229 ReportDescToMemo.......................... 229 ReportFullName ................................ 230 ReportName ...................................... 230 RuntimeVisibility .............................. 238 Save .................................................. 238 SaveRaveBlob ................................... 239 SaveToFile ........................................ 240 SaveToStream ................................... 241 366

SelectReport...................................... 249 SetParam........................................... 253 StoreRAV ......................................... 263 Table................................................. 273 UseSetRange..................................... 294 WriteBCDData.................................. 296 WriteBlobData .................................. 296 WriteBoolData .................................. 297 WriteCurrData................................... 297 WriteDateTime.................................. 298 WriteFloatData.................................. 298 WriteIntData ..................................... 299 WriteNullData................................... 299 WriteStrData ..................................... 300 ReadableHeight..................................... 224 Rectangle Fill........................................ 126

Reference Bar Code ..................................... 348 Column ........................................ 348


Control.............................................. 348 Font................................................... 349 Graphics............................................ 349 HTML............................................... 349 Label ................................................. 349 Memo................................................ 349 Misc.................................................. 350 Position ............................................. 350 Preview............................................. 350 Printer ............................................... 351 Printing ............................................. 351 Rave.................................................. 351 Render............................................... 352 ReportSection.................................... 352 ReportSystem .................................... 352 RTF................................................... 352 Shell.................................................. 352 TablePrinter....................................... 353 Tabs .................................................. 353 Units ................................................. 353 ReportSection Bottom ................................................ 90 Left ................................................... 148 RTF ...................................................... 154 S Set

AsFloat ............................................... 84 AsInteger ............................................ 85 Shell DetailReport...................................... 115 Execute ............................................. 123 IsReprint ........................................... 144 New Page flag................................... 144 Status CurrentPass....................................... 111 Format .............................................. 262 TotalPasses ....................................... 285 System - DefaultDest ............................ 112 T Table DataSet ............................................. 111 FieldName ........................................ 125 GrandTotal........................................ 139 Lookup DataSet Name....................... 156 Lookup Display................................. 156 Lookup Key ...................................... 156 MasterKey ........................................ 160 MasterTablePrinter ............................ 161 Tabs BoxLineColor ..................................... 92 BoxLineXxxx...................................... 92 Clear ................................................... 99 Clear All ............................................. 98 Finish TabBox................................... 127 Get Tab............................................. 137 TextFiler CPI ................................................... 104 FileName .......................................... 126 FormFeed.......................................... 134 FormFeed String ............................... 134 LeftBorder ........................................ 149 TextFiler ........................................... 344 Tutorial 01 Introduction.................................... 14 02 TReportPrinter component.............. 18 03 TReportFiler component................. 21 04 TFilePrinter component .................. 23 05 TFilePreview.................................. 24 06 TReportSystem component............. 26 07 TDetailShell component ................. 29 08 TReportSection component............. 32 09 TMasterShell component ................ 34

10 TReportShell component .................38 11 TLabelShell component...................42 12 TMemoBuf / TDBMemoBuf ...........45 13 TDBTablePrinter component ...........48 14 TDBTableColumn ...........................51 15 TTableSection component ...............55 16 TTablePrinter / TTableColumn ........57 17 Fonts and the Text Line...................58 18 Margins, Sections and Waste Areas .59 19 Columns..........................................60 20 Printing Bitmaps and Graphics.........61 21 Setting up the Printer .......................62 22 Using Streams .................................63 23 Exporting to RTF ............................64 Rave 24 Quick start...................................66 25 Data Connections.........................68 26 Customizing data connections......69 27 Overview of TRaveProject ...........73 28 End User support.........................75 29 Files ............................................77 Type BoxLineXxxx ......................................92 TBKMode..........................................276 TBoxLines .........................................277 TDuplex.............................................277 TFontAlign ........................................281 TLineHeightMethod...........................282 TMacroID..........................................283 TMarginMethod.................................283 TOrientation.......................................285 TOutputType .....................................286 TOverflowMethod .............................286 TPrintJustify ......................................286 TPrintJustifyVert................................287 TPrintUnits ........................................287 TReportDest.......................................288 TRPRenderPDF .................................288 TStreamMode ....................................289 TSystemOption ..................................289 TSystemOptions.................................289 TSystemSetup ....................................290 TSystemSetups...................................290 TTabJustify........................................290 U Underline...............................................291 367

W Waste Bottom ................................................ 91

Left ................................................... 149 Right................................................. 235 Top ................................................... 285

368

Вам также может понравиться