Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
This tutorial assumes the Microsoft Access 2010 Tutorial has been completed to create the Basic Sales System Database Objective: to create a report which could be used as a statement and looks like the following:
Page 1
Producing a Report Using a Query Select the qCompleteSale Detail Query Select Create Report Design option
With the Property Sheet open, click on the down arrow for the record source and select qCompleteSaleDetail: You may need to resize the Property Sheet Window first.
If the query is not available, make sure the Selection type: Report shows Report at the top of the property sheet
Select the Add Existing Fields option and all of the fields contained in the query will be available. If any are missing, go back to the query, make sure the fields are contained in the query and the show box is ticked. Make any adjustments required to the query. Save your query. The new fields should then be available.
Page 2
Drag (or double click) all of the fields required for the report into the Detail section of the blank report:
Dont worry about tiding anything up yet. Switch to Report View - fairly ugly really isnt it? Also, the customer details are repeated for each purchase.
Page 3
Reducing Repeated Data Creating a sort based on CustomerID so that each customers details are only shown once. Make sure the Groups & Sort option on the Design tab is selected
Click on the Add a group button in the Group, Sort, and Total section at the bottom of the page.
Select CustomerID
This has created a Customer Header above the detail section of the report
And added a group tab in the Group, Sort, and Total section
Select the customer details in the Details section and cut and paste into the CustomerID Header
Now when the report is viewed, the customer details only appear once followed by all the sale details related to the customer. Sandra Dyke, 2012 Page 4 Access 2010 Tutorial Creating Reports
The sale detail headings are still being repeated so these need to be moved into the CustomerID Header section as well. To do this, the labels for each field needs to be separated from their field details. Select the sale details Click on the Stacked option in the Arrange tab Then while these items are still selected, click on the Remove Layout option Click on the top of the Detail bar until the pointer changes into a double headed arrow with a line through it and drag the bar down to make some space.
Click on the label portion of the field (should be the left half) and cut and paste into the CustomerID Header section. If the textbox portion is cut and paste as well, redo the separation step above.
Repeat the stack and remove actions above for the address details and then delete the customer detail labels so only the customer details remain.
Page 5
The CustomerID Header, Detail and Page Footer bars can be moved in the same way as the Detail bar was moved above. The space between the items in the report is determined by the space in each section so the separator bars may need to be adjusted to make things like right. View the report:
Page 6
Creating Separate Pages Now to separate each customer on to their own page:
Click on the CustomerID Header to select it and change the GroupHeader0 name to CustomerIDHeader Then change the Force New Page option to Before Section.
Move through the pages by using the arrows at the bottom of the page. NB if the report is viewed in the Report option, there wont be separate pages.
Page 7
Adding the statement total Click on More in the Group on CustomerID section and show the footer
The following: Make sure the TotalSalePrice is shown before selecting the ShowGrandTotal and Show in group footer options.
Page 8
Final Adjustments Make any final adjustments (eg bold headings, bring in a company logo this was done by using WordArt in Word and copying it to this report)
The date can be added to the page footer, a report title can be added to the report header and the date and time of printing the report can be added to the report footer but I leave this to you to try yourselves.
Page 9