home *** CD-ROM | disk | FTP | other *** search
/ Computer Based Training: …, Windows 95 & NT Basics / a1454501.iso / mo97a02 / IA03.TXT < prev    next >
Encoding:
Text File  |  1997-05-07  |  14.6 KB  |  411 lines

  1. Reports are an effective way of creating a printed copy of information taken from data in your database.
  2. |
  3. Although you can also print a query of a form, reports have two main advantages.
  4. |
  5. They can compare, summarize, and subtotal large sets of data.
  6. |
  7. Using a report also gives you greater control over exactly where data prints on a page.
  8. |
  9. Most of the information in a report comes from an underlying table, query, or SQL statement.
  10. |
  11. Other information, such as additional comments or explanations, is stored in the report's design.
  12. |
  13. For example, you might design a report to include the name of the person who created it.
  14. |
  15. Reports have three views
  16.  
  17. ò Design View
  18. ò Print Preview
  19. ò Layout Preview
  20. |
  21. Design view is used when you want to create a report, or change the structure of an existing report.
  22. |
  23. You can use Print Preview to see the report's data as it will appear on every printed page.
  24. |
  25. Layout Preview is a quick way of checking the layout of a report because Microsoft Access uses just enough data from the underlying table or query to show you what the report will look like.
  26. |
  27. Let's take a look at an existing report in the three views.
  28. |
  29. First you click the ^UReports^u tab, and choose ^UCustomers^u.
  30. |
  31. Then you click the ^UPreview^u button to preview the report.
  32. |
  33. As you can see, the report is magnified so that you can clearly read the data.
  34. |
  35. The magnifying glass pointer means that you can alter perspective.
  36. |
  37. For example, you can zoom out to see how the data is laid out on the whole page.
  38. |
  39. In Access 97, you have the option of displaying more than one page at a time.
  40. |
  41. To display multiple pages you simply click the ^UMultiple Pages^u button.
  42. |
  43. You choose the number of pages you'd like to see.
  44. |
  45. Access displays the pages you've chosen.
  46. |
  47. Let's see what the report looks like in Design view.
  48. |
  49. Like forms, reports are divided into sections.
  50. |
  51. The report header appears once, at the beginning of a report.
  52. |
  53. You can use it for items such as a logo, report title, or print date.
  54. |
  55. The report header is printed before the page header on the first page of the report.
  56. |
  57. The page header appears at the top of every page in the report.
  58. |
  59. You use it to display items such as column and page titles.
  60. |
  61. The detail section contains the main body of a report's data.
  62. |
  63. This section appears for each record in the report's source data.
  64. |
  65. The page footer appears at the bottom of every page in the report.
  66. |
  67. You use it to display items such as page numbers.
  68. |
  69. The report footer appears once at the end of the report.
  70. |
  71. It can display items such as Grand Totals or Total Amount Outstanding.
  72. |
  73. The report footer is the last section in the report design but appears before the page footer on the last page of the printed report.
  74. |
  75. You can hide or view the headers and footers in your report by selecting ^UView - Page Header/Footer.
  76. |
  77. The Layout Preview shows the report's layout.
  78. |
  79. It includes just a sample of the data in the report.
  80. |
  81. Access enables you to separate records into groups.
  82. |
  83. By grouping records meaningfully, you can make a report easier to read.
  84. |
  85. For example, a report that groups customers by region is often easier to understand than one that lists them in random order.
  86. |
  87. The advantage is that you can skim the report to find those customers living in a particular city quickly.
  88. |
  89. When you group records, you can also perform calculations on the data in each group.
  90. |
  91. For example, you could calculate the total value of sales for the group.
  92. @@
  93. There are a number of ways of creating reports in Access.
  94. |
  95. You cannot create a report if you don't have a default printer installed.
  96. |
  97. Suppose you need a sales report to take to a meeting starting shortly.
  98. |
  99. You can create that report quickly using the AutoReport facility.
  100. |
  101. You click the ^UNew Object^u button.
  102. |
  103. You choose ^UReport^u from the drop-down list box.
  104. |
  105. In the New Report dialog box, you can choose one of the AutoReport wizards.
  106. |
  107. The ^UAutoReport: Tabular^u option puts the fields in each record on one line, and prints the labels once at the top of each page.
  108. |
  109. In this case you select ^UAutoReport: Columnar^u, so that each field will appear on a separate line with a label to its left.
  110. |
  111. You click the table or query that contains the data on which you want to base your report, for example ^USales^u.
  112. |
  113. Then you click ^UOK^u.
  114. |
  115. Access applies the last autoformat you used to the report.
  116. |
  117. If you haven't created a report with a wizard before or used the ^UAutoFormat^u command, the default autoformat is used.
  118. |
  119. Suppose you have the Employees table open.
  120. |
  121. You can create a single-column report based on the table by clicking the down-pointing arrow next to the ^UNew Object^u button.
  122. |
  123. Reports created with this method have no report header and footer, only a detail section.
  124. |
  125. Suppose that you need a detailed report to present your product range to prospective clients.
  126. |
  127. The easiest way to do this is to use the Report Wizard.
  128. |
  129. You click the ^UNew Object^u button, and select ^UReport^u in the drop-down list.
  130. |
  131. You click ^UReport Wizard^u.
  132. |
  133. You open the drop-down list box to choose the table on which you want to base the report - here it is ^UProducts^u.
  134. |
  135. Then you click ^UOK^u.
  136. |
  137. In the Table/Queries drop-down list box you can opt to change the table or query on which you based the report.
  138. |
  139. You can also choose to base the report on more than one table.
  140. |
  141. In the Available Fields list box, you can double-click those fields you want to appear on your form.
  142. |
  143. Here, you click the double right arrow to select all the fields.
  144. |
  145. Then you click ^UNext^u.
  146. |
  147. You can now decide how you want to group your fields.
  148. |
  149. For example, you might want to group the report by Category ID.
  150. |
  151. This means that the group header, Category, will introduce the group.
  152. |
  153. The ^UGrouping Option^u button enables you to choose at what intervals you'd like to group the fields.
  154. |
  155. You click ^UNext^u.
  156. |
  157. You can now specify sorting options.
  158. |
  159. For example, you might want to sort the product names alphabetically within a group.
  160. |
  161. In the drop-down list box you choose ^UName^u.
  162. |
  163. The ^USort^u button shows that the product names will be sorted in alphabetical order.
  164. |
  165. You click the ^USummary Options^u button to display data fields that can be summarized.
  166. |
  167. Here, only the Unit Price and Delivery fields can be summarized.
  168. |
  169. Since there has been a change in the Unit Price of various products, you select the ^UAvg^u checkbox.
  170. |
  171. Then you click ^UOK^u.
  172. |
  173. And you click ^UNext^u.
  174. |
  175. Access makes it easy to lay out your report by providing a variety of built-in layouts.
  176. |
  177. You can choose to print your report in the ^UStepped^u option, for example.
  178. |
  179. You can opt to print your pages in landscape or portrait orientation.
  180. |
  181. Here, you choose ^UPortrait^u.
  182. |
  183. If you'd like all your fields to fit on one page, you select the ^UAdjust the ... page^u checkbox.
  184. |
  185. Then you click ^UNext^u.
  186. |
  187. You can scroll through different options to choose a style for your report.
  188. |
  189. For example, you can select the ^UCasual^u option.
  190. |
  191. Then you click ^UNext^u.
  192. |
  193. Although the Report wizard suggests the name Products, here you decide to change the name to "Stock Report".
  194. |
  195. Then you click ^UFinish^u to close the dialog box.
  196. |
  197. The Report Wizard creates your report.
  198. @@
  199. Once your report has been created by a Report Wizard, you can still customize it to suit your business needs.
  200. |
  201. For example, you may want to update your report to display a recently added field from the report's record source.
  202. |
  203. You click the ^UField List^u button to display a list of all the fields in the record source.
  204. |
  205. Then you simply drag and drop the additional field you need on the report.
  206. |
  207. Access draws the new control.
  208. |
  209. When you created the Stock Report, you grouped the products by category, and then sorted them alphabetically.
  210. |
  211. Now, you might decide to change the sort order so that Access sorts the groups by the Unit Price field, and in descending order.
  212. |
  213. You click the ^USorting and^u ^UGrouping^u button to display the Sorting And Grouping dialog box.
  214. |
  215. Choosing ^UView - Sorting and^u ^UGrouping^u has the same result.
  216. |
  217. You select the field you want to use - here it is ^UUnit Price^u.
  218. |
  219. In the Sort Order drop-down list, you click the option you want, for example ^UDescending^u.
  220. |
  221. After you close the dialog box, you can switch to ^UPrint Preview^u.
  222. |
  223. As you can see, Access has applied the new sort order.
  224. |
  225. The Report Wizard automatically generates default page numbering in the page footer section of a report.
  226. |
  227. Suppose you want to change the page footer generated by the wizard.
  228. |
  229. The easiest way to do this is to select the page number control and edit the expression in Design view.
  230. |
  231. For example, you type 
  232.  
  233. ^R="Page" & [Page]^r
  234. |
  235. In Print Preview, you can see that the new expression changes the page numbering style.
  236. |
  237. You can also add controls, such as labels and pictures, to reports.
  238. |
  239. Let's see how you create a label for a report header.
  240. |
  241. You click the ^ULabel^u button to create a label control.
  242. |
  243. Then you click where you want to place the label.
  244. |
  245. You type the text for the label.
  246. |
  247. And then you press ^UEnter^u.
  248. |
  249. You can move, size, or align selected controls.
  250. |
  251. Let's see how you size a group.
  252. |
  253. To select several controls, you hold down the ^UShift^u key as you click each control.
  254. |
  255. You choose ^UFormat - Size^u which allows you to resize all selected controls.
  256. |
  257. For example, you can make the selected controls as narrow as the narrowest control by selecting ^UTo Shortest^u.
  258. |
  259. Access resizes the selected controls.
  260. |
  261. Access allows you to change the appearance of an entire report or selected parts of it.
  262. |
  263. Suppose you want to change the font, font size, and line weight for all text and lines on the report at once.
  264. |
  265. You select the entire form by clicking the ^UForm Selector^u.
  266. |
  267. You click ^UAutoFormat^u.
  268. |
  269. Choosing ^UFormat - AutoFormat^u has the same result.
  270. |
  271. You select a new autoformat for the report, ^UBold^u for example.
  272. |
  273. You click ^UOK^u.
  274. |
  275. Access applies the new format.
  276. |
  277. To make more detailed changes to the appearance of your controls, you select the controls you want to format.
  278. |
  279. Then you can change the format using the formatting options on the Formatting toolbar.
  280. |
  281. Let's use one of the ^USpecial Effect^u buttons to give the selected controls a shadowed effect.
  282. |
  283. You click the ^USpecial Effect^u button, and then select the ^UShadowed^u option.
  284. |
  285. Access applies the new format.
  286. @@
  287. @@
  288. A subreport is a report that's inserted in another report.
  289. |
  290. When you combine reports, one of them must serve as the main report.
  291. |
  292. The main report is either bound or unbound.
  293. |
  294. An unbound main report can store unrelated subreports that you want to combine.
  295. |
  296. If a main report is bound, it means that it is based on a table, query, or SQL statement.
  297. |
  298. In Access 97 you can nest subforms and subreports in a main report.
  299. |
  300. You can create an outer report or main report in the usual way using the Report Wizard, and then embed a subform or subreport in it.
  301. |
  302. A main report can contain up to two levels of subforms and subreports.
  303. |
  304. For example, a report can contain a subreport, and that subreport can contain a subform or a subreport.
  305. |
  306. Let's see how you create a subreport, and embed it in the group header of the main report.
  307. |
  308. You select the ^UStock Report^u.
  309. |
  310. You click the ^UDesign^u button to open the Stock report in Design view.
  311. |
  312. Then you click the ^USubform/Subreport^u button.
  313. |
  314. You click where you want to place the subreport in the group header.
  315. |
  316. You have the option to use a table, a query, or an existing form on which to base your subreport.
  317. |
  318. Here you click ^UTable/Query^u.
  319. |
  320. And you click ^UNext^u.
  321. |
  322. You select ^USales^u.
  323. |
  324. Then in the Available Fields list box, you click the fields you want to appear in your subreport.
  325. |
  326. Here you select ^UCustomer^u ^UID^u, ^UProduct ID^u, ^UUnits sold^u, and ^UUnit Price^u.
  327. |
  328. In most cases, a subreport is linked to a main report, so it shows records that are related to the current record on the main report.
  329. |
  330. To set up a link, you click the ^UChoose from a list^u radio button.
  331. |
  332. You select the appropriate link, in this case ^UShow^u ^USales for each record in^u ^UProducts using Product ID^u.
  333. |
  334. And then you click ^UNext^u.
  335. |
  336. You enter an appropriate name for your new subreport, for example ^RSales^r ^Rsubreport^r.
  337. |
  338. Then you click ^UFinish^u to close the dialog box.
  339. |
  340. Access embeds the subreport in the main report.
  341. @@
  342. Access makes it easy to print database objects.
  343. |
  344. For example, you can print
  345.  
  346. ò the datasheet of a table,
  347.   or a form
  348. |
  349. ò a selection of records
  350. |
  351. ò a grouped report
  352. |
  353. Unless your report or form is designed solely for online distribution, you'll usually want to print it.
  354. |
  355. The quickest way to print a report is by using the ^UPrint^u button.
  356. |
  357. The ^UPrint^u button method is suitable for reports, tables, and forms that are already formatted.
  358. |
  359. It is also an easy way to print the datasheet of a form or a table quickly.
  360. |
  361. When you click the ^UPrint^u button, Access prints the entire document using the default print settings.
  362. |
  363. Sometimes you may want to change printing defaults.
  364. |
  365. For example, you could set different default print margins to suit a particular document.
  366. |
  367. To do this, you click ^UTools - Options^u.
  368. |
  369. You click the ^UGeneral^u tab.
  370. |
  371. In the Print Margins area, you set the margins you want to use as defaults.
  372. |
  373. Changing default margins doesn't affect the margin settings for existing forms and reports.
  374. |
  375. You click ^UApply^u.
  376. |
  377. And then you click ^UOK^u to close the dialog box.
  378. |
  379. Since your report is grouped, you might want to set the Keep Together property.
  380. |
  381. Setting this property prevents page breaks in the middle of a group.
  382. |
  383. You select ^UDesign View^u in the View drop-down list.
  384. |
  385. You click the ^USorting and^u ^UGrouping^u button.
  386. |
  387. In the Keep Together field, you select ^UWhole Group^u.
  388. |
  389. Then you close the dialog box.
  390. |
  391. You could preview your document before printing it.
  392. |
  393. You simply click ^UPrint Preview^u in the View drop-down list.
  394. |
  395. You can use the navigation buttons at the bottom of the Print Preview window to move between pages.
  396. |
  397. Once you are satisfied with the layout of your report, you can print it.
  398. |
  399. To do this you click ^UFile - Print^u.
  400. |
  401. You enter the settings you want in the Print dialog box.
  402. |
  403. For example, in the Printer area, you specify a printer.
  404. |
  405. Similarly, in the Print Range area you specify whether you want to print all pages or a range of pages.
  406. |
  407. For example, if you only wanted to print five pages, you could enter the details in the Print Range area.
  408. |
  409. Then you click ^UOK^u.
  410. @@
  411.