Using Aggregate Fields With TClientDataSet Delphi’s TClientDataSet provides support for aggregate fields. In the current implementation the IsNull function of the TAggregateField returns True unless the dataset is on the first record. This is problematic since ReportBuilder relies on the IsNUll function to determine whether field value is valid. Therefore, a work around is required Full Article…
Search the Wiki
How To…Use Bookmarks With TextPipeline
Question “How can I use the TextPipeline to print only specific records or apply a filter?” Solution This example shows how to add a list of Bookmarks to the TextPipeline to control which records print. All DataPipelines support bookmarking and bookmark list data traveral. When bookmarks are added to a datapipeline, it will traverse only Full Article…
How To…Dyanmically Configure a TextPipeline
Question “How can I dynamically create and configure a TextPipeline to print from data that I generate at runtime?” Solution This example first generates a text file containing sample data, then dynamically creates and configures a TextPipeline to access the text file. Download: TextPipeDynamicFile.zip Sample Delphi code: {——————————————————————————} { TForm1.FormCreate } procedure TForm1.FormCreate(Sender: TObject); var Full Article…
PipeSort
TECH TIP: Using a JITPipeilne to Display Sorted Data Question: “I am using JITpipeline and I want to know is there a way to sort the data?” Answer: You can implement this functionality by creating an index for your data. A simple index can be made using a StringList. You can iterate through your data and Full Article…
OnGetPicture Event
TECH TIP: Using the JITPipeilne OnGetPicture Event to Display Images Question: “I am using a JITPipeline to output data stored in a series of stringlists, one of these stringlists contains the names of a graphic. How can I use the JITPipeline.OnGetPicture Event to display an image?” Solution: Use JITPipeline fields editor to declare a Field Full Article…
Master-Detail Manual Control
TECH TIP: Manual Master/Detail JITPipelines In some applications, you may want to implement a master/detail JITPipeline relationship in which you programmtically control the detail data that is available for each master record. Create two JITPipelines and implement the OnGetFieldValue event in the standard way. For the detail JITPipeline, leave the MasterDataPipeline and MasterFieldLinks properties unassigned. Full Article…
Master-Detail
TECH TIP: Use Master/Detail JITPipelines To use Master/Detail relationship with the JITPipeline: Check out the demo dm0139 in the main demo reports app for an example. Make sure you have the Detail JITPipeline.MasterFieldLinks defined to specify the relationship. In dm0139 the detailed it linked to the master using the CustNo field from each pipeline. Once you Full Article…
How To…Access RTF Data via the JITPipeline
Question “How can I use a JITPipeline to provide access to a DBRichtext component on my report?” Solution The following example implements the JITPipeline GetfieldAsString event to access RTF data. For this example a Delphi TRichEdit is placed on a form and used as the source of the rich text. Another solution could use an Full Article…
How To…Access Image Data via the JITPipeline
Question “How can I use a JITPipeline to provide access to a DBImage component on my report?” Solution The following example implements the JITPipeline GEtFieldAsPicture event to access Image data. For this example the image is loaded from a file. You could also implement a solution that loads images from other sources such a TImage Full Article…
TDataSet Descendants
ReportBuilder’s Support for TDataset Descendants ReportBuilder’s DBPipeline component can connect to any TDataset descendant. TDataSet —> TDataSource —> DBPipeline –> Report To use RB Professional’s Query tools you will need a DADE Plug-in. a. Check the ..\RBuilder\Demos\EndUser Databases directory for end-user examples using a variety of database products. b. Check out the friends | data | Full Article…
No Database Reports
TECH TIP: Printing Reports without a Database ReportBuilder has a very flexible and powerful DataPipeline architecture for accessing data from a variety of sources. The product ships the following datapipelines: DBPipeline: connects to any TDataSource TextPipeline: used to accessing ASCII text files JITPipeline: event-handler based pipeline, used to print data from arrays, grids, lists or Full Article…
How To…Use DataModules with ReportBuilder
Question “Is it possible to use Delphi DataModules with my ReportBuilder application?” Solution As a rule of thumb, DataModules should be primarily used to contain abstract data objects such as Tables, Queries, and DataSources. DataModules are also a good place to place DataPipelines as the TppReport object on the main form of your app will Full Article…
How To…Create a DataPipeline in Code
Question “How do I create a DataPipeline in code?” Solution Datapipelines can easily be created dynamically in code by assigning a few key properties. Create the TppDBPipeline object: FDataPipeline := TppDBPipeline.Create(Self); Give the pipeline a recognizable name. FDataPipeline.Name := ‘plCustomers’; FDataPipeline.UserName := ‘Customers’; Assign the DataSource property. FDataPipeline.DataSource := dsCustomers; Assign any other properties you Full Article…
How To…Check For Data Before Printing
Question “How do I check if there is data to be retrieved before printing my report?” Solution Check the TppDataPipeline.EOF and TppDataPipeline.BOF properties. If both of these properties are True, the dataset contains no data. Note that the datapipeline will need to be opened to successfully access these properties. Download: CheckForDataBeforePrinting.zip Sample Delphi code: function Full Article…
Display MasterFieldLinks Editor
TECH TIP: Display DataPipeline.MasterFieldLinks Editor in code uses ppForms, ppFLnkEd; procedure TForm1.DisplayFieldLInkEditor; var lFormClass : TFormClass; lFieldLinkEd: TppCustomMasterFieldLinkEditor; begin {the detail pipeline's masterdatapipeline property needs to be set prior to using the field link editor} if (myDetailPipeline.MasterDataPipeline = nil) then myDetailPipeline.MasterDataPipeline := myMasterPipeline; {get the registered field link editor class} lFormClass := ppGetFormClass(TppCustomMasterFieldLinkEditor); {create the Full Article…
Define MasterFieldLinks in Code
Tech Tip: Define Master/Detail DataPipeline Links in Code Defining a Master/Detail relationship for a DataPipeline requires that the detail pipeline have the following properties defined: 1. MasterDataPipeline 2. MasterFieldLinks At Delphi design-time you can use the object inspector and the DataPipeline’s FieldLinks editor to define the master/detail relationship. The following example illustrates how to define Full Article…
Data Traversal
TECH TIP: Fundamentals of Report Data Traversal Single Table Listing Report Assign the Report.DataPipeline property and leave the DetailBand.Pipeline unassigned. The report will traverse the data from start to end (based on the datapipeline range settings and honoring any filters you’ve placed on the datset etc.) Master/Detail Report: Assign the Report.DataPipeline property to the master. Full Article…
Controlling Which Records are Printed
TECH TIP: Controlling which records are printed for a report There are a several techniques you can use to control which records are printed for a report. Use a Query to construct a result set containing only the desired records. Define a Filter on a dataset (Query or Table) to filter out the unwanted records. Full Article…
ADO Connect to Paradox via ADOConnection
TECH TIP: Connect To Paradox Via ADOConnection Create a TADOConnection Launch the Data Link Properties Dialog by double clicking on the ADOConnection on the Form Set the Provider to be the Microsoft OLE DB Provider for ODBC Drivers Select Next or Select the Connection tab of the Data Link dialog Specify the source of data Full Article…
Linking SQL Queries
TECH TIP: Linking SQL Queries for Master/Detail Data The following example shows two options for linking SQL queries to create a master/detail relationship. In this example, we are using Delphi’s DBDemos data to create a Customer/Order relationship. Thus we wish to link the Orders detail to the Customer master. I. Delphi Query Linking a. Set the Full Article…
How To…Search Between a Date and 6 Months Prior
Question “How can I search on a specified date and 6 months prior?” Solution Use the Query Designer to build a query that contains two search criteria on the Date. Use the <= and >= operators. Designate the first criteria as AutoSearch and use SQLBuilder to modify the second criteria at runtime. Download: SQLBuilderSearchOnDateMinus6Months.zip Sample Full Article…
How To…Apply Single AutoSearch to Multiple Queries
Question “How can I define a single autosearch parameter and apply it to multiple queries?” Solution Implement the Report.BeforeOpenDataPipelines event and use SQLBuilder to apply the AutoSearch value to additional queries. Download: ApplyAutoSearchValueTo2ndQuery.zip Sample RAP code: procedure ReportBeforeOpenDataPipelines; var lSQLBuilder: TdaSQLBuilder; begin {create SQLBuilder – pass the Customer2 datapipeline to the constructor} lSQLBuilder := TdaSQLBuilder.Create(Customer2); if (Report.AutoSearchFields[0].ShowAllValues) then Full Article…
Custom Designers
Data Designers descend from TdaCustomDataWizard which is defined in daDataWizard.pas. The TdaCustomDataWizard class defines a class function called DataViewClass that should be overriden by descendants classes to specify the DataView class for which the data designer is implemented. The daRegisterWizard and daUnRegisterWizard procedures defined in daDataWizard.pas are used to register and unregister Data Designers with Full Article…
Custom Dataviews
The following code shows how to create a dataview in code: uses daDatMod, daQClass, daDataVw, daQuery, daDBBDE; {——————————————————————————} {TForm1.CreateDataView} procedure TDynamicReport.CreateDataView; var lSQL: TdaSQL; lTable: TdaTable; lField: TdaField; begin {create a datamodule – note: this is only necessary if you need to stream the report definition to an .rtm or database} FDataModule := TdaDataModule.CreateForReport(FReport); {create Full Article…