1 / 20

Building and Using Reports in Visual Basic 6.0 - Enterprise Development

This tutorial discusses the importance of reports in enterprise applications and provides a step-by-step guide on how to build and use reports using Visual Basic 6.0.

maudra
Download Presentation

Building and Using Reports in Visual Basic 6.0 - Enterprise Development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Enterprise Development Using Visual Basic 6.0 Autumn 2002Tirgul #13 ‘Tirgul’ # 13

  2. Objectives • Building and using reports ‘Tirgul’ #13

  3. Why reports • Essential in many applications • Customer care: • Telephone bills • Credit card expenses • System admin. • Last used web site • Data base scheme ‘Tirgul’ #13

  4. Name Age Grade Jason 25 89 … … … Type of reports • Graphical: • Graph • Cake • Textual • Table of data ‘Tirgul’ #13

  5. VB Reports • Based on Database data • To be accurate – Using a Recordset Database Sample report RS ‘Tirgul’ #13

  6. Adding reports (1) • Open Project components ‘Tirgul’ #13

  7. Adding reports (2) • In the Designers tab, Add “Data Report” ‘Tirgul’ #13

  8. Adding reports (3) • Add a data report to the project ‘Tirgul’ #13

  9. Project tree ‘Tirgul’ #13

  10. The data report object Header area 1st report page Page header Each report page Detail Main data area Page footer Each report page Header area last report page (Total…) ‘Tirgul’ #13

  11. Sections of the Data Report Designer • Report Header - Text that appears at the very beginning of a report, such as the report title, author, or database name. • Page Header - Information that goes at the top of every page, such as the report's title. • Group Header/Footer - contains a "repeating" section of the data report. Each group header is matched with a group footer. • Details - contains the innermost "repeating" part (the records) of the report. ‘Tirgul’ #13

  12. Sections of the Data Report Designer 2 • Page Footer - contains the information that goes at the bottom of every page, such as the page number. • Report Footer - contains the text that appears at the very end of the report, such as summary information, or an address or contact name. ‘Tirgul’ #13

  13. Data Report Controls 2 Report Label Report Text box Report Image Report Shape Report Line Report Function ‘Tirgul’ #13

  14. Data Report Controls 2 • TextBox Control (RptTextBox) - allows you to format text, or assign a DataFormat. • Label Control (RptLabel) - allows you to place labels on the report to identify fields or sections. • Image Control (RptImage) - enables you to place graphics on your report. Note that this control cannot be bound to a data field. ‘Tirgul’ #13

  15. Data Report Controls 3 • Line Control (RptLine) - lets you draw rules on the report to further distinguish sections. • Shape Control (RptShape) - enables you to place rectangles, triangles, or circles (and ovals) on a report. • Function Control (RptFunction) - a special text box that calculates values as the report is generated. ‘Tirgul’ #13

  16. Setting data • Its all about data source: • While • RS is a Recordset containing data Set DataReport.DataSource = RS ‘Tirgul’ #13

  17. Setting Recordset fields • Done In design time. • In the Details section, create a TextBox and set its DataField property to the corresponding field in the table • Repeat for each field you want to show ‘Tirgul’ #13

  18. Setting report functions • Same as setting data • Common: • Sum/Min/Max… ‘Tirgul’ #13

  19. Setting other data • Other usefull data: • Current page • Total number of pages • Date/Time ‘Tirgul’ #13

  20. Summary before examples • Make sure you have an existing RecordSet. • Design the report properly (add logo/shapes) • Put ONLY Database fields in the detail section • Lets see… ‘Tirgul’ #13

More Related