TECH TIP: ReportBuilder’s RichText Architecture The RichText in ReportBuilder is a wrapper around Delphi’s TRichEdit which in turn relies on Windows. There are two versions of Windows richedit – RichEd32.dll is the older one and RichEd20.dll is a newer one (RichEd32 is being phased out). Delphi by default relies on RichEd32 – the older version. Full Article…
Search the Wiki
RB 7 and WP Tools
ReportBuilder 7 no longer includes the global ppParentWnd due to modifications required for thread-safety. You have two choices: Modify TWPCustomRichTextForPP (or create a descendant class). Override the CreateParams as shown below. CreateParams is a protected method of TWinControl. (note: This is the approach that RB uses so that RichText can be thread-safe for RB Server.) Full Article…
JIT RichText
TECH TIP: Using Delphi’s TRichEd with the JITPipeline The following function can be used to copy rtf data from a Delphi TRichEd to a Delphi String. Once you have the rtf data in a string you can return the value in the JITPipeline.OnGetFieldAsString and JITPipeline.OnGetFieldValue events. Note: you can define the JITPipeline’s Field.DataType as dtBlob, Full Article…
Delphi RTF
TECH TIP: Copy RTF Data from TRichEd to TppRichText You can copy RTF data from Delphi’s TRichEd to ReportBuilder’s TppRichText control by using an intermediate memory stream: var lRTFStream: TMemoryStream; begin {create temp memory stream} lRTFStream := TMemoryStream.Create; {save the TRichEd's rtf data to the memory stream} RichEdit1.Lines.SaveToStream(lRTFStream); {load the rtf stream to the TppRichText} Full Article…
Assigning Attributes
TECH TIP: Assigning Font Attributes of RichText component You can assign font attributes to a RichText component by using the SelStart, SelLength properties or the the SelectAll method to select the text. Then assign the font to the RichText.SelAttributes property. Example: var lFont: TFont; begin lFont := TFont.Create; lFont.Name := 'Arial'; lFont.Size := 14; lFont.Color Full Article…
How To…Render a Form Control to a Report
Question “How can I render a control on my form, to my report?” Solution The following example uses the ReportBuilder PaintBox control to render a TProgressBar and a TGauge to a report. The TProgressBar is a TWinControl descendant and the TGauge is a TGraphicControl descendant. Download: RenderControlToPaintBox.zip procedure TForm1.ppPaintBox1Print(Sender: TObject); begin // size the paint Full Article…
Loading an Image by Path at Runtime
TECH TIP: Loading an Image Dynamically Question: “We store paths to our image files in our database rather than the images themselves. How can I load the images at runtime?” Answer: Connect the DBImage to the string field and it will automatically try to load the image from the file.
JPEG Resolution
TECH TIP: ReportBuilder JPEG Resolution RB relies on Delphi’s TJPEGImage for providing JPEG graphic support. There is a TppImage.DirectDraw property that enables RB to render a graphic in two different ways. When DirectDraw is True, the TJPEGImage renders itself directly to the screen/printer canvas. When DirectDraw is False, RB converts the TJPEGImage to a BMP Full Article…
Image Formats
TECH TIP: ReportBuilder Image Support ReportBuilder natively supports Bitmap (.bmp), JPEG (.jpg, .jpeg), Metafile (.wmf, .emf), Gif (.gif), and Icon (.ico) image formats. PNG (.png) images are supported for Delphi 2009 or later. ReportBuilder has an open architecture that supports any TGraphic descendant. For example, for versions of Delphi earlier than Delphi 2007, ReportBuilder ships Full Article…
How To…Use the OnGetPictureEvent
Question “How can I use the DBImage.OnGetPicture event to conditionally display a default image? For example, some records in my dataset have any empty image field.” Solution The following examples uses the DBImage.OnGetPicture event to conditionally display a default image. Download: UseDBImageOnGetPictureEvent.zip Delphi code sample: procedure TForm1.FormCreate(Sender: TObject); begin FDefaultPicture := TPicture.Create; // load the Full Article…
GIF Image
Gif images are natively supported by Delphi 2007 and on. TGIFImage, is an excellent freeware component written by Anders Melander. TGIFImage is Copyright 1997,98 Anders Melander. All rights reserved. URL: http://www.melander.dk/delphi/gifimage/ You must add the ppGIF to the ‘uses’ clause of your unit in order to load and print GIFs. TGIFImage is an example of Full Article…
RB 9+ Architecture
Article: RB 9 Architecture Changes ReportBuilder 9 includes architecture changes to more cleanly separate Designer code from Report code. The code related to component popup menus and design controls has been broken out into separate classes. For an example, check out RBuilder\Demos\RCL. The myChkBox.pas unit contains the component classes…. TppCustomComponent | | TMyCustomCheckBox | |– Full Article…
How To…Use the PaintBox Component
Question “How is the PaintBox component meant to be used?” Solution The PaintBox component is a report control that can be used to draw directly to a Canvas. Use the TppPaintBox.Canvas property to draw text, lines, images, etc. Use the OnPrint event to draw to the canvas. The example below shows how the TppPaintBox component Full Article…
Draw Command Architecture
TECH TIP: Draw Command Architecture Page Objects When a report prints it generates Page objects. Each Page object contains an array of DrawCommand objects (Page.DrawCommands[]) that describe what needs to be rendered for the page. Report –> Pages.DrawCommands[] —> Device (Printer, Screen, ..) –> final output DrawCommands Objects Component –> DrawCommand Each TppComponent generates a Full Article…
DataAware Component
TECH TIP: How to Make a Data-Aware RB Component Publish the DataPipeline and DataField properties. These are declared in the ancestor class TppPrintable (ppPrnabl.pas). Override the public IsDataAware function from TppPrintable class to return True. function TmyDBComponent.IsDataAware: Boolean; begin Result := True; end; Override the public Notify method from the ancestor to redraw the design Full Article…
TeeChart General Info
ReportBuilder includes TeeChart wrapper components that enable TeeChart to be used within the Report Designer. For an example see RBuilder\Demos\Reports\Demo.dpr. Open the project main form and read the directions at the top. For an end-user example, see RBuilder\Demos\EndUser\Report Explorer\EndUser.dpr. Again, open the main form and read the directions at the top of the form for Full Article…
TeeChart Compile Error
Tech Tip: Resolving Compile Error w\TeeChart When using TeeChart and ReportBuilder in Delphi you will encounter a compile error stating that the unit ‘IEditCha’ cannot be found. In order to get around it you can: Build your project with packages. Purchase TeeChart Pro from http://www.steema.com The TeeChart author did not include all of the units Full Article…
RB Online Help
The ReportBuilder online help contains details about: Teechart versions supported Known limititations of TeeChart support Directions for manually building and installing ReportBuilder TeeChart related packages. Access the RBuilder.hlp, select the Table of Contents, and then select ReportBuilder Reference | TeeChart | Delphi X where X is the version of Delphi that you are using.
How To…Display the TeeChart Editor in Tree Mode
Question “Is it possible to display the TeeChart editor in tree mode inside the report designer?” Solution Yes, this can be done by calling the TeeChart routine TeeSaveBoolOption inside the TeeEditCha unit. Calling this routine with the TeeMsg_TreeMode key and a true value will globally set the editor to tree mode inside and out of Full Article…
How To…Create a Master Detail Chart
Question “How do I display a different chart for each (master) record in my report?” Solution The DBTeeChart component will automatically traverse the entire dataset it is connected to. This means that if you place a chart component inside the detail band of your main report, connected to a dataset, it will display the same Full Article…
How To…Create a Chart in Code
Question “How do I create a TeeChart inside my report completely in code?” Solution Begin by creating a TppTeeChart object and adding it to the report. Then leverage the TppTeeChart.Chart property to add Series objects to the chart. The key to being successfull at creating charts in code is to include the proper TeeChart units Full Article…
How To…Chart As Image
Question “How do I show a TeeChart created on a form as an image on a report?” Solution Use the TeeChart routine TeeCreateMetafile to export the chart to an image then assign it to a TppImage on a report. Download: ChartAsImage.zip Sample Delphi code: procedure TForm1.Button1Click(Sender: TObject); var lMetaFile: TMetaFile; lRect: TRect; begin lRect.Left := Full Article…
How To…Change the TeeChart Language
Question “How do I change the language translation for the TeeChart editor?” Solution TeeChart contains built in translations that can be enabled by including the proper units in your application, then registering them using the routines available in teh TeeTranslate unit. Take a look at the \Lib directory located inside your TeeChart root install directory Full Article…
How To…Calc Chart Pos Clicked
Question “How can I calculate the x,y position of the chart when clicked in the viewer?” Solution The can be accomplished by implementing the Chart.OnDrawCommandClick event to convert the mouse position to chart coordinate space. Download: CalcChartPosClicked.zip procedure TForm1.ehTeeChart_DrawCommandClick(Sender, aDrawCommand: TObject); var lViewer: TppViewer; lCursorPos: TPoint; lDrawCommandPos: TPoint; lChartPos: TPoint; begin // get reference to Full Article…
Design Package Installation
TECH TIP: Class TppDPTeeChart Not Found If the correct Teechart design time packages are installed, but not loaded, then you will receive this error when attempting to load any form which contains a TppDPTeeChart or TppTeeChart. You can attempt to fix this problem by performing the following: Select Components | Install Packages from the Delphi main Full Article…
Delphi 6 and TeeChart
TECH TIP: D6 + TeeChart + RB Limitations Delphi 6 – TeeChart 4.04 Limitations The version of TeeChart bundled with Delphi 6 (TeeChart 4.04) has the following limitations: Within the Delphi IDE the data-aware TppDPTeeChart does not work properly. You cannot assign a series to datapipeline. With the end-user report designer (at run-time) the data-aware TppDPTeeChart Full Article…
Delphi 2007 Missing file
For the benefit of anyone else coming across this (as well as yourselves of course): There is an update available for anyone to use at http://www.teechart.net/files/vcl/public/TeeChartStandard7/v711/TeeChartStandard_CodeGear_Edition_7.11Delphi2007.exe You need to install this (the installer will spot the old version and prompt you to agree to move the old files to a backup) then add the TeeChart\Delphi11\Lib Full Article…
GS1-128
TECH TIP: GS1-128 GS1 is an organization that sets industry standard for the supply chain. They have developed Barcode standards for several Barcode types including GS1-128. ReportBuilder’s support for the Code 128 barcode symbology can be used to print GS1-128 barcodes. Download example: RB GS1-128 1. GS1-128 Barcode standard This Wikipedia page provides a concise Full Article…
QR Code: Enable All Versions
By default, the QR Code component included with ReportBuilder supports code versions 1 – 10. To enable all QR Code versions (1 – 40), follow the steps below. 1. Copy the ppBarCode2DQRCode.pas file from the \RBuilder\Source\… directory to the \RBuilder\Lib\…* directory. * \Win32 or \Win64 for multi-platform Delphi versions 2. Open the copied file Full Article…
QR Code
Starting with ReportBuilder 15, QR Code and Datamatrix barcodes are natively supported by the 2DBarcode component. Please see the included help topic installed with ReportBuilder on the Tpp2dBarcode class for more information. Also see our “What’s New” page for a list of new features for the latest version of ReportBuilder. —
Manual Encode 128
By default Barcode.AutoEncode is set to true. For most applications, you should use the AutoEncode feature – which creates the encoded version of the data automatically. Set AutoEncode to False and manually encode the data for a Code 128 BarCode when you have special requirements. If you are unfamiliar with Code 128, I will try Full Article…
BarCode Types
TECH TIP: Adding New BarCode Types ReportBuilder natively supports the following barcode types: BarCode Codabar Code 128 Code 39 EAN-8 EAN-13 Interleaved 2 of 5 PostNet UPC-A UPC-E BarCode 93 (Available for Download at https://www.digital-metaphors.com). 2DBarCode PDF417 MaxiCode128 QRCode Datamatrix Options for adding new BarCode types: Find a VCL or ActiveX BarCode component that supports Full Article…
What is RAP?
TECH TIP: RAP Overview Question: “What is RAP?” RAP is Portable Code. RAP is included with ReportBuilder Enterprise and allows you to store code with your reports. Until now, ReportBuilder’s powerful events have been available only within Delphi. If you wanted to load reports at runtime and retain any event handlers, you had to load Full Article…