Here is an example of how you can use
the
QuickReport Wizard to make a report in your applications.
This example was made with QuickReport
3.0.5
You may find your version of
QuickReport
is different and that this tutorial is not for your version.
You should still be able to folllow the
steps and get the same results.
Start a new Delphi project.
Click on File then New in the Delphi menu.
Now click on the Business tab and you should see the QuickReport Wizard, click on it and then click on the OK button.
Make sure List report is selected then click on the Start Wizard button.
On this page of the wizard you select a table and fields to include in your report.
In 'Alias or directory' you can use the dropdown list or use the Browse button and a select directory dialog box appears so you can select a directory.
For this example lets click on the dropdown list and select DBDemos.
For Table Name select clients.dbf
Select the >> button to add all fields.
Now click on the Finish button.
You should now see a form in your project with a Table1 components and some QuickReports components.
If you need to you can make changes to
the properties of the table or even delete the table and change the
QuickRep1.dataset property to another
TTable or TQuery.
You will also have to change the
Expression
properties for the components that the wizard created for you
Right-click on the QuickReport form and
select Preview to have a look at how the report should look like.
This method is used for viewing reports
at design time.
As you can see its very easy to use the QuickReport Wizard, if this is the first time you have used this wizard be sure to do some experimenting with it and make some reports that you will delete later so you can get the feel of using the wizard.
To see the report at runtime do this:
Add a button to Form1. Your Report should be on Form2.
Go to File then Use Unit then select Unit2 and click on the OK button.
Double-click on the button and add this code:
procedure TForm1.Button1Click(Sender:
TObject);
begin
Form2.QuickRep1.Preview;
end;
Run the project and click on the button and you should see your new report.
| Back |