Search the Wiki

Viewing 106 to 140 of 409 items

RAP Performance Penalties

Question: “Do you incur any performance penalty by using the RAP interpreter?” Answer: The penalties are negligible. This is due to the fact that RAP is what we call a hybrid interpreter. While it is, in fact, an interpreter, it is actually working as a pass-through to compiled code. Thus, when the interpreter encounters an Object  Full Article…

0

Overview

Question: “What is RAP?” or “What is the difference between RB Pro and Enterprise?” ReportBuilder Enterprise includes a run-time Pascal environment called RAP. RAP enables developers and end-users to code without Delphi. RAP code can be used to add calculations and event-handlers to reports. “Why use RAP? or “Why would I use that?” Reports coded with  Full Article…

0

How To…Modify RAP Programs in Code

Question “How do I modify existing RAP code without using the code workspace (i.e. in Delphi code)?” Solution Use the raGetCodeModule() routine to gain access to the code module object then loop through each program and global program using the Programs and AllGlobalPrograms lists. Access the actual RAP code using the TraProgram.Source property. Download: RAPModifyPrograms.zip  Full Article…

0

How To…Find Components With RAP Code

Question “How do I determine if the report components have RAP code associated with them?” Solution Gain access to the TraCodeModule object using the raGetCodeModule routine, then loop through each program in the Programs list.  Use the TraProgram.Component.Name property to determine which components have RAP code associated with them. Download: ComponentsWithRAPCode.zip Sample Delphi code: procedure  Full Article…

0

How To…Dynamic Variables in RAP

Question “Is it possible to dynamically create multiple variables based on my data via RAP code?” Solution Use a TList object in RAP to keep track of each variable created in RAP. This way when you need to assign each value, you will have a reference to every variable you dynamically created. Use the OnCalc  Full Article…

0

How To…Create RAP Globals in Code

Question “How do I create a RAP Global Variable and assign it in the RAP OnGlobalCreate event in Delph code?” Solution Use the raGetCodeModule() routine to access the RAP code module in code and manually add a TraVarProgram and TraProgram object to create the variable and OnGlobalCreate event. Download: CreateGlobalVar.zip Download: CreateGlobalProc.zip Sample Delphi code:  Full Article…

0

Check for IsNull

TECH TIP: Checking for Null Data values The DataPipeline.FieldObjects[] array property provides access to the TppField objects. TppField has an IsNull boolean property. The notation is: DataPipeline.FieldObjects[‘FieldName’].IsNull Example: if Customer.FieldObjects[‘Addr1’].IsNull then   ShowMessage(‘field value is null’);

0

Calc Tab Views

In order to configure the user-interface to provide this level of functionality, set the RAPInterface riNotebookTab property to True and set all of the RAPOptions to True. When the report designer is displayed, the Calc tab will be visible. By right-clicking on the treeview on the left, a speed menu will be displayed that shows  Full Article…

0

Calc Dialog

The RAP user interface can be configured to meet the needs of your end users. There are three basic configurations available: Calculations Dialog For casual end users, a simple Calculations dialog is accessible from the speedmenu of the new TppVariable component. This dialog provides a place for calculations to be entered and returned via a  Full Article…

0

Supporting Set Types via RTTI

This code demonstrates how you can use your TraRTTI descendants to provide support for Set type properties without using Sets. Version 1.0 of RAP does not support Set types. However, it is possible, using RTTI, to supply support for Set type properties.  Take, for instance, TFont’s Style property which is of type TFontStyles – a  Full Article…

0

Overview

There are two very simple and powerful techniques to extend the capabilities of RAP infinitely. These are summarized below and covered in more detail in the RAP.hlp online help. Demos and tutorials are installed to RBuilder\Demos\RAP. The tutorial text is located in RAP.hlp. RAP Pass-Through Functions These are functions that appear in the Language tab  Full Article…

0

Design-Time Pass-Through Functions

TECH TIP: Accessing Pass-Through Functions in Delphi Design-Time Question: “How do I make my pass-through functions available at design-time?” Since pass-through functions are registered with RAP by calling raRegisterFunction (typically in the Initialization section of a unit), to make your functions available at design-time we simply need to arrange to have the initialization section of your  Full Article…

0

Adding Support to Existing RTTI Objects

Question: “I notice that TppDataPipeline (or some other class) has a Next method (or some other member), but the RAP compiler doesn’t seem to recognize that method, are you going to add support for that?” Answer:  There are a number of class members which have not been added to RAP via the RTTI classes. We  Full Article…

0

Adding AccessSpecifiers via RTTI

Question: “How do I add support for an Indexed property to RAP?” Answer:  A property such as TStrings.Values, is known as an Access Specifier. If you do a GREP search in the RBuilder source directory, you will find numerous references to AccessSpecifierToRec (see the RAP help for TraRTTI.AccessSpecifierToRec). AccessSpecifiers are an odd hybrid of property  Full Article…

0

Summary CalcOnGroup Totals

TECH TIP: Calculating a Summary based on Group Totals Question: “I am using a Variable in the Group Footer to conditionally calculate totals for each group. I want to add a second Variable to the Summary that accumulates the results calculated for each group.” Answer: The following example uses two Variable components: vCustomerTotal and vCustomerSummary.  Full Article…

0

Overview

TECH TIP: Performing Calculations Calculations can be done either on the data access side or within ReportBuilder. When designing reports there are always decisions to be made as to how much processing to do on the data side versus the report side. Usually doing more on one side can greatly simplify the other. So it  Full Article…

0

LookAhead-Based Calcs

If you are using a LookAhead value from a DBCalc in a variable’s calculation, then be aware that you will get inconsistent results. The reason for this behavior is that when the DBCalc prints, and if the rest of the detail bands on the page have not generated, then the datapipeline may not been traversed  Full Article…

0

How To…Access Subreport Values in the Main Report

Question “How do I access subreport values inside the main report in RAP or vice versa?” Solution In Delphi this is simple, just access the values directly from the components needed as they are all defined in the Interface section of your application. In RAP however, components added to a Subreport are not available to  Full Article…

0

How To…Create a Report Template Wizard

Question “How can I can create a simple report wizard that implements a standard template?” Solution The following example shows how to create a custom report wizard and register it with RB. The TmyReportWizard class descends from TppCustomReportWizard and overrides a few simple methods. The ClassDescription and ClassBitmpa are used by the report designer’s ‘New…’  Full Article…

0

How To…Create a Custom Query Wizard

Question “How do I replace the existing query wizard with a custom one of my own?” Solution Use the built-in dialog replacement architecture to create and register your own query wizard.  Start by copying the existing code located in the daQueryWizard.pas file and renaming the class and file name.  Finally inside the initialization and finalization  Full Article…

0

How To…Create a Custom Query Designer

Question “How do I replace the existing query designer with a custom one of my own?” Solution Use the built-in dialog replacement architecture to create and register your own query designer. Start by copying the existing code located in the daQueryDesigner.pas file and renaming the class and file name.  You will also need to create  Full Article…

0

Custom Report Wizard

TppCustomReportWizard is defined in ppWizard.pas. You can create descendants and register them with RB. Example can be found in the following RB source code files: The simplest descendant is TppBlankReportWizard defined in ppRptWiz.pas. TppBlankReportWizard simply creates a an empty report consisting of a header/detail/footer band set. TppLabelTemplateWizard – the label wizard is defined in ppLabWiz  Full Article…

0

Enabling Features in Delphi at Design Time

TECH TIP: Enabling a ReportBuilder feature in Delphi Design-time Question: “How do I add <some feature> to the Report Designer at Delphi designtime?” Answer: ReportBuilder offers an open architecture which allows for considerable extensibility. Many of the features in RAP and DADE, as well as our output devices are available within your applications by simply adding  Full Article…

0

Replaceable Dialogs

TECH TIP: Replacing Built-in Dialogs/Forms in ReportBuilder ReportBuilder has an open architecture for replacing any of the built-in dialogs. You can replace any of the built-in dialogs by creating a new form that inherits from an abstract ancestor and then registering it as the new built-in dialog. For example, to replace ReportBuilder’s print dialog you could:  Full Article…

0

Preview Plugin

TECH TIP: Creating a Preview Plugin Question: “I’ve followed the tutorials and registered a Preview Form replacement but that did not affect the TppDesigner’s Preview workspace.” Answer: Do not use the form replacement, but rather, there is a different architecture built into the preview form that is registered by default. You will need to register a  Full Article…

0

How To…Create a Custom Print Dialog

Question “How do I replace the existing print dialog with a custom one of my own?” Solution Use the built-in dialog replacement architecture to create and register your own print dialog.  Start by copying the existing dialog located in the ppPDlg.pas file and renaming the class and file name.  Finally inside the initialization and finalization  Full Article…

0

RTF Fundamentals

The RTF device gives the capability to easily export any report to RichText format which can be viewed in many text editors such as Microsoft Word and WordPad. Begin by setting the Report.AllowPrintToFile property to True to enable the Print To File section of the Print Dialog. The print dialog can be bypassed by setting  Full Article…

0

ReportTextFile and Memos

Demo 107 (dm107.pas) in RBuilder\Demos\Reports\Demo.dpr is a good example. However, I just spent some time examining it and modifying it to include a memo and discovered the following: The report components are using Courier New size 8, but need to be using Courier New size 9. Notice that the report.Units is set to PrinterPixels. This  Full Article…

0

Windows Service

TECH TIP: Executing Reports in a Windows Service Environment Configure that report to suppress all dialogs Report.ShowPrintDialog := False; Report.ShowCancelDialog := False; Report.ShowAutoSearchDialog := False; Provide a thread-safe environment/container in which the report can execute. See the RBuilder.hlp on the Background printing feature fpr details. Typically a Windows service application executes under a special user  Full Article…

0

Windows Terminal Server

TECH TIP: RB and Windows Terminal Server RB currently requires that a default printer be configured for the Windows account under which the RB application is executing.

0

Send TextFile to Printer

TECH TIP: Send TextFile to Printer Question: “I designed a application that exports the report to a .txt file using ReportTextFile device. How can I Send the text file to the printer?” The following procedure will send the .txt file to the printer using Delphi’s TPrinter object. uses Printers; procedure SendTextFileToPrinter(aFileName: String); var lsLines: TStringList;  Full Article…

0

Screen Printer

TECH TIP: What is the Screen printer? The Report.PrinterSetup.PrinterNames[] array contains the list all of the printers installed on the machine. It also contain the names ‘Default’ and ‘Screen’. Default Printer The Default printer refers to the Windows default printer as specified by the Windows Printer Panel. Screen Printer The Screen printer is a virtual  Full Article…

0

Printing to Dot Matrix

TECH TIP: Printing to Dot Matrix Printers Dot matrix printers are natively line and character based. Most dot matrix printers can emulate graphical (i.e. pixel based) printing, but there is additional overhead which degrades printing speed. Some options for maximizing performance: Use native printer fonts. Each dot matrix printer normally has some built-in fonts. You  Full Article…

0

Printer Dev Mode

TECH TIP: Configuring Printer Specific Options The Report.PrinterSetup properties can be used to set the properties that are common to all printers. Internally RB applies these to the Windows DevMode structure. Report.PrinterSetup <—-> Windows DevMode <—–> Printer Driver <—> Printer Printers often contains additional features, such as output bins, media types, etc. The Windows DevMode  Full Article…

0

Print Copy Captions

TECH TIP: Printing a Unique Caption for Each Copy of a Multi-Copy Report Sent to the Printer Here’s example of sending 3 copies to the printer and printing a unique caption for each one. Set Report.PrinterSetup.Collation to True Set Report.PrinterSetup.Copies to 3 Set the Report.PassSetting to psTwoPass. (add ppTypes to your “uses” clause) Create a private  Full Article…

0