Queen Cpzinha

LUCE Can/a hp

Goumnet Lancho netea

Qua Delicia

And1" Fpnsaca

Bam a dp Batista

M a ftat n g Assistant

Apcounthg Ti'-anaga'

Acco u ntrg f/a nager

Pau la Pa ra nts Sa as f^an agar

Adding an ActiveReport to your project To add an ActiveReport to your project

1. Click on Project > Add New Item

2. Click on ActiveReports File to select it.

3. Change the name of the report to rptSimpleGroup and click Open.

4. The ActiveReports design surface is displayed.

Connecting the data source to a database

To connect the data source to a database

1. Click on the yellow report DataSource icon in the Detail section. This brings up the report DataSource dialog box.

3. Select "Microsoft Jet 4.0 OLE DB Provider" and click Next >>.

4. Click on the ellipsis to browse for the access path to Nwind.mdb. Click Open once you have selected the appropriate access path.

5. Click OK to continue.

6. In the Query field, type "Select * from customers ORDER BY country".

7. Click OK to return to the report design surface.

Adding controls to contain data

To add controls to the report

1. Add a GroupHeader/Footer section to your report (see Grouping Data for help).

2. Make the following changes to the group header:

o Change the name to ghOrderGroup o Change the DataField property to Country

3. Add the following controls to the PageHeader section:

Control Name Text/Caption Location

Label lblCustomerID Customer ID 0, 0

Label lblCompanyName Company Name 1.0729, 0

Label lblContactName Contact Name 2.1875, 0

Label lblContactTitle

Contact Title

4. Add the following controls to the GroupHeader section:

Control DataField Name Text/Caption Location

Textbox Country txtCountry Country 0.3125, 0.0625

5. Add the following controls to the Detail section: Control DataField Name

Textbox CustomerlD Textbox CompanyName Textbox ContactName Textbox ContactTitle

Text/Caption Location txtCustomerID Customer ID 0, 0

txtCompanyName Company Name 1.0625, 0

txtContactName Contact Name 2.1875, 0

txtContactTitle Contact Title 3.3125, 0

Viewing the report To view the report

1. Add the ActiveReports viewer control to a Windows Form.

2. Add the code needed to set the viewer document equal to the report document. See Using the ActiveReports WinForm Viewer for help.

0 0

Post a comment