Tech Tip…Select Interbase Current Date Question: “Using Interbase, how I can select the current date?” Answer: Select<br> Cast(‘Now’ as Date) Today
Search the Wiki
How To…Modify SQL via Code
Question “How can I modify the SQL via code?” Solution Use the SQLBuilder class. See the DADE | SQLBuilder topic for a list of How To’s.
How To…Launch the DADE Query Wizard in Code
Question “How do I launch the Query Wizard outside the designer as a stand-alone dialog?” Solution The query Wizard can be launched separate from the designer and used to generate SQL as a stand-alone dialog. Start by creating a TdaQueryWizardDialog object and assigning it a SQL object to use. Once the dialog has been used Full Article…
How To…Launch the DADE Query Designer in Code
Question “How do I launch the Query Designer outside the designer as a stand-alone dialog?” Solution The query designer can be launched separate from the designer and used to generate SQL as a stand-alone dialog. Start by creating a TdaQueryDesignerForm object and assigning it a SQL object to use. Once the dialog has been used Full Article…
How To…Create Query DataViews via Code
Question “How can I create DADE QueryDataViews via code?” Solution The following example shows how to create a DADE datamodule that contains two query dataviews, customer/orders linked in a master/detail relationship. Download: CreateDataModCustOrderLinkedDataViews.zip Delphi code sample: procedure TForm1.CreateDataViews; var lDataModule: TdaDataModule; begin // create data module lDataModule := daGetDataModule(ppReport1); if lDataModule = nil then lDataModule Full Article…
How To…Create Invisible Search Criteria
Question “How can I add search criteria that will be not be visible to my end-users?” Solution The following example shows how to use the DataView.OnBeforeGenerateSQL and OnAfterGenerateSQL events to and remove search criteria that cannot be seen by the end-user. Download: DADEInvisibleSearchCriteria.zip Delphi code sample: procedure TForm1.Button1Click(Sender: TObject); begin PrepareReport(ppReport1); ppReport1.Print; end; procedure TForm1.PrepareReport(aReport: Full Article…
How To…Control Security
Question “Our end-user reporting solution needs to implement a security scheme to limit the data that is available to end-users.” Solution Use the DataDictionary to limit which tables and fields are available to end-users. To limit specific table records that are accessible requires that you modify the SQL statement submitted to the database. The best Full Article…
TdaMetaCache Errors
TECH TIP: Troubleshooting TdaMetache Errors Issue Running a report and/or acessing the Query tools, results in the following error… Error: TdaMetacache.GetFields unable to find table ‘tablename’ in cache” Solution This error indicates an issue with the database connectivity settings for either the Query tools or the report’s DataViews. The Designer’s DataSettings are used to specify Full Article…
How To…Use the DataDictionary Builder at Run-Time
Question “Is is possible to use the DataDictionary Builder at run-time?” Solution The following example shows how to create the DataDictionary Builder via code. Download: DataDictionaryBuilderAtRunTime.zip Delphi code sample: uses daDataDictionaryBuilder; procedure TForm1.Button1Click(Sender: TObject); var lForm: TdaDataDictionaryBuilderForm; begin lForm := TdaDataDictionaryBuilderForm.Create(Application); lForm.DataDictionary := ppDataDictionary1; if lForm.ValidSettings then lForm.Show else stbStatus.SimpleText := lForm.ErrorMessage; end;
Clear MetaData
TECH TIP: Clearing the Meta Data Cache There is a global meta data cache that the ReportBuilder uses to cache information about the available database tables and fields. You can clear the meta data cache using the following code: uses daMetaDataManager; begin gMetaDataManager.Clear; end;
How To…Manually Link DADE Pipelines
Question “How can I link DADE pipelines manually? Sometimes I need to manually edit the SQL or need to bypass generation of the magic sql Solution For the linked data traversal to work properly, make sure the detail query selects all records required for the entire report and Order By the linking field(s). The following Full Article…
How To…Link DADE Pipeline to Standard Pipeline
Question “How do I link a pipeline (dataview) I’ve created in DADE with a standard pipeline I’ve placed on my form/datamodule or vice versa?” Solution Gain access to the pipeline object of the TppDataView via the daGetDataModule routine. Then manually link the pipelines as you would normally in code using a TppMasterFieldLink object. Download: LinkDADEPipeToStandardPipe.zip Full Article…
Database Collation and Linking
Linking DataViews in the ReportBuilder Data workspace (DADE), requires that the detail data be sorted by the linking fields. When DataViews are linked, DADE generates special linking SQL for the detail DataView. The linking SQL (Magic SQL) can be viewed by positioning the mouse over the DataView window and pressing Ctrl + Left Mouse button. Full Article…
DADE Linking
Linking DataViews in the ReportBuilder Data workspace (DADE), requires that the detail data be sorted by the linking fields. When DataViews are linked, DADE generates special linking SQL for the detail DataView. The linking SQL (Magic SQL) can be viewed by positioning the mouse over the DataView window and pressing Ctrl + Left Mouse button. Full Article…
What is DADE?
What is DADE? DADE = Dade Access Development Environment. It is included with RB Professional and Enterprise. Visually DADE is represented by Report Designer’s Data workspace. Why use DADE? DADE enables developers and end-users to rapidly define the data access elements required by simple and complex reports. These elements typically included queries, master/detail linking relationships between Full Article…
Update Database Name
How to modify the DatabaseName stored with a DADE Query Currently when DADE is used to create dataviews, the DatabaseName is stored as part of the query definition. (This is consistent with Delphi’s approach to specifying a database connection for a Query object). In some cases, you may decide that the DatabaseName needs to be Full Article…
SQLText Limitations
TECH TIP: Limitations of using TdaSQL.SQLText The TdaSQL object can contain either an object based description of the SQL (SelectTables[], SelectFields[], etc.) that it uses to generate SQLText OR it contain a SQLText string. If you specify the SQLText string then TdaSQL will not generate any SQLText. Therefore the built-in AutoSearch and Linking features can no Full Article…
SQL Expression for SubString
TECH TIP: SQL Expression for SubString SQL Expressions can be entered via the Calc page of RB’s Query Designer. Select a field and then select Expression as the function type. Type in the desired expression. Most database engines support built-in SQL expressions for functions such as SubString. Consult the database product’s documentation for a full Full Article…
How To…Search Available Dataviews
Question “How do I search the available dataviews created in DADE for a specific one?” Solution Use the TppDataView.Description property to find the name of each dataview and locate the one you need. Start by accessing the datamodule using the daGetDataModule routine. Next loop through each dataview in the TppDataModule.DataViews list to find the desired Full Article…
Group Search (Having Clause) Fundamentals
ReportBuilder 11 and later include what is known as Group Search support or Having clause support in DADE. In order to understand how this feature can be used, we must first discuss what exactly the Having clause is. The Having clause is very similar to the Where clause in a SQL statement in that it Full Article…
Date Formatting in Templates
TECH TIP: Date Format When DADE Search Criteria Values Are Saved in a Template Question: I create a dataview with a criteria value as a date. Why does the template not save the date value as my local regional settings for date format? Answer: DADE saves the TdaCriteria value as a string in the report template. Full Article…
Date Formatting
DADE handles date formatting in two phases: User entry This occurs when the user specifies a date using the Query tools or the AutoSearch dialog. DADE converts the date string entered by the user into a Delphi TDateTime value. The string entered by the user is converted using Delphi’s StrToDateTime. By default Delphi’s StrToDateTime relies Full Article…
DADE Architecture
The Data Access Development Environment (DADE) in ReportBuilder is built upon the concept of DataView classes. A DataView class is responsible for creating the data access objects required to connect a report to data. At a minimum a DataView will contain at least one DataPipeline. A typical DataView will contain one or more DataPipelines, DataSources, Full Article…
Create AutoSearch Parameters
The following describes how to create AutoSearch parameters using DADE: Access the Data workspace of the Report Designer. Create a DataView using the Query Wizard or Query Designer. A DataView tool window will be displayed in the data workspace. Press the Search button. The Search tab of the Query Designer will be displayed. Add a Full Article…
Convert Template BDE to ADO
Currently when DADE is used to create dataviews, the DatabaseName is stored as part of the query definition. (This is consistent with Delphi’s approach to specifying a database connection for a Query object). When you created the reports originally, the daDBBDE.pas BDE DADE plugin was used. Now you want to use ADO. You’ve already changed Full Article…
Query Wizard
Within the data workspace, you can select data from your database using an SQL query. This functionality is provided via query-based dataviews, which can be visually created using the Query Wizard and visually maintained using the Query Designer. The following series of screenshots shows how to create a simple query-based dataview via the Query Wizard. Full Article…
Query Designer
The Query Designer is used to modify query-based dataviews. The query designer presents a series of notebook tabs; each tab represents a different part of the query. The last notebook tab in the Query Designer shows the generated SQL and allows the name of the dataview and datapipeline to be changed. The Query Designer is Full Article…
Extending DADE
DADE is a flexible and extensible architecture that enables developers to tailor the functionality delivered to meet the requirements of a particular application. The most common ways in which DADE is extended are as follows: 1. Dataview Templates Create dataview templates to customize the dataview creation process or to provide datapipeline configurations that cannot be Full Article…
Configuring DADE
The first step in configuring DADE for your end users involves setting the properties of the DataSettings object of the Designer component. This object contains the following properties: Property Description AllowEditSQL Determines whether or not the end-user can edit the SQL in the Query Designer. DatabaseName The name of the database from which data will Full Article…
Ask at Run-Time Support
Ask At Run-Time support refers to the common task of allowing the end-user to specify parameter values that can be used to limit the scope of a report. As an example, for an invoice report, the end-user might specify a company name and date range. ReportBuilder’s AutoSearch feature offers a RAD solution to the drudgery Full Article…
Translate OEM Charset
The following example shows how to add OEM Charset translation to daADO.pas: function TdaChildADOQuery.Translate(Src, Dest: PChar; ToOem: Boolean): Integer; begin if (Src <> nil) then begin if ToOem then CharToOemBuff(Src, Dest, StrLen(Src)+1) else OemToCharBuff(Src, Dest, StrLen(Src)+1); Result:=StrLen(Dest); end else Result:=0; end;
IB Express Compatibility
The ReportBuilder Query Tools support the Interbase Express data access components via a DADE plug-in. The plug-in consists of the daIBExpress.dcu unit and the rbIBExx.bpl package. (Note: the ‘7x’ is replaced by 76 for Delphi 6, 77 for Delphi 7, etc). The rbIBExx.bpl package is compatible with the version of InterBase Express that ships with Full Article…
DADE Plugins
DADE includes DataView classes that support Delphi’s BDE, ADO, and IBExpress data access components. Additional plug-ins can be created to support products that contain SQL based TDataSet descendants. Below is a list available DADE Plug-ins. Plugin Name Description daADO by Digital Metaphors Included with ReportBuilder. DataView classes that support the Delphi ADO data access components. Full Article…
Report Object Loop
TECH TIP: Loop Thru All Objects in a Report A ReportBuilder report is composed of a set of components. The basic structure is: Reports.Bands[].Objects[] The bands and objects within the report can be accessed directly by object name or via the Bands and Objects array properties. Below is an example of using the Bands and Full Article…
Providing a Custom Save Changes Query
Tech Tip: Creating a Custom “Save Changes?” Dialog Question: “I want to be able to provide my own custom ‘Save Changes?’ confirmation message in the Designer. Is that possible?” Answer: While it is possible, it not something that we are going to build into the product right now. However, it is something that you can Full Article…