How To…Launch the Report Wizard in Code

Question

“How can I launch the Report wizard directly in code?”

Solution

a. Simplest solution is to use the Designer

b. It is also possible to launch the report wizard without the Designer

Start by manually creating a TppReportWizard object and implementing the necessary events.

– OnCreateReport: Create a report object and assign a datapipeline.

– OnGetDataNames: Assign the field names from the pipeline to the DataNameList.

– OnGetFields: Add the datapipeline fields to the field list.

– OnValidateName: Set the aNameValid parameter to True.

Next execute the report wizard to show the dialog.

Download: LaunchReportWizardInCode.zip

Sample Delphi code: