Você está na página 1de 27

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : P. Sri Vidya
Designation : Lecturer
Branch : DCCP
Institute : Govt. Polytechnic for Women, Bheemili
Semester : VI Semester
Subject : Visual Basic II
Subject code : CCP- 603
Topic : Displaying and Printing
Information(4/10)
Sub Topic : Displaying tabular data in report form
Duration : 100 min.
CCP603.7 to 8 1

Teaching Aids : PPT


Recap

 Data Environment Designer

CCP603.7 to 8 2
Objectives

On completion of this period, you would be able to:


 Know and use Data Report Designer
 Create a report using Data Report Designer
via Data Environment object

CCP603.7 to 8 3
Data Report Designer

What is Data Report Designer?

 The Data Report Designer is a screen on which


we design the layout of the report
 The Data Report Designer is not a part of the tool
box
 To add it, right click on the tool box and select
components from the pop-up menu
 On the component dialog box, click on the
‘Designers’ tab and select ‘Data Report’

CCP603.7 to 8 4
How to add DataReportDesigner to IDE?

 Click on Projects  Add Data Report to add a


Data Report Designer to IDE
 Data Report Designer is a separate form by itself
 This designer will not be placed on a normal form

CCP603.7 to 8 5
Sections of Data Report Designer

Report header :
 Displays text that appears at the very beginning
of a report
 For example the report title, author, or database
name

CCP603.7 to 8 6
Page Header :
 Displays information that goes
 at the top of every page
 for example the report's name

CCP603.7 to 8 7
Group Header/ Footer :

 Displays the heading for every group here.


 For Example our report contains details of
Customers for each city, the group header can
be the name of the city.
 A Group Header must also have a Group Footer.

CCP603.7 to 8 8
Details
 This section contains the actual data.
 It displays the records of the report.

Page footer :
● Displays information at the bottom of every
page, such as page number

CCP603.7 to 8 9
Report footer

 Displays the text that appears at the very end of


the report
 such as summary information, or an address
or contact name.

CCP603.7 to 8 10
Data report controls

Tool box of DataReport object :


 When we add a Data Report object, a separate
tool box will be added under the Data Report
tab.
 The controls in this Toolbox help in designing
reports on Data Report designer screen

CCP603.7 to 8 11
Label control (RptLabel)

 A ‘Label’ control is used to display text


 This control is similar to the standard Visual Basic
label control
 Additional property of the ‘rpt label’ control:
 ‘Cangrow’ property -returns or sets a value that
determines if the control can grow vertically if
the text exceeds the preset size of the control

CCP603.7 to 8 12
Text control (Rpt textbox)

 The ‘Textbox’ control is used to only display text


from a database at run time
 The user cannot enter text at run time
 The rpt textbox has one additional property, the
‘cangrow’ property

CCP603.7 to 8 13
Image control (Rpt image)

 The ‘Image’ control displays a graphic from a


bitmap, icon or a metafile as well as from .jpeg,
or .gif files
 This control is similar to the standard Visual
Basic image control
 Some of the standard image control’s properties
are unavailable on the Data Report version

CCP603.7 to 8 14
Line control (rpt line)

 The ‘line ‘ control displays a horizontal, vertical or


a diagonal lines on the report
 Line slant’ property determines in which direction
the line slopes

CCP603.7 to 8 15
Shape control (rpt shape)

 The ‘Shape’ control displays a rectangle, square,


oval, circle, rounded rectangle, or a rounded
square
 It does not support the Border width, fill color, or fill
style properties

CCP603.7 to 8 16
Function control (rpt shape)

 The ‘Function’ control displays figures calculated value


at run time using various built-in functions-Sum,
Average, Minimum, Maximum based on the values of
data source
 It can only be placed in a group footer section of a data
report designer
 In addition it has the following property:
 ‘function’ property –returns or sets the function
to be used in calculating the value displayed by
the function control

CCP603.7 to 8 17
Steps to create a report using data report
designer taking data from Oracle database via
Data Environment Designer

 Click on Project menu


 Click on Add DataEnvironment
 Right click on Connection
 Click on properties
 Choose Microsoft OLEDB provider for Oracle
 Click on Next
 Enter the UserName ‘Scott’ and Password ‘tiger’

CCP603.7 to 8 18
Steps to create a report using data report
designer taking data from Oracle database via
Data Environment Designer

 Click on Test Connection


 Click on OK
 Right click on Connection1 Add command’
 Right click on ‘command1’  Properties
 Select the database object as ‘Table’
 Enter the Password ‘Tiger’
 Select the required table for ‘Object Name’

CCP603.7 to 8 19
Steps to create a report using data report
designer for Oracle database. Contd..

 Click on ‘SQL statement’


 Click on ‘SQL Builder’
 Click on Connection1
 Click on tables
 Select the table
 Drop the table on Command1 window
 Select the required fields
 Close the Command1 Window and Save
changes CCP603.7 to 8 20
Steps to create a report using data report
designer for Oracle database. Contd..

 Close the Data Environment window


 Click on Project menu  Add Data Report
 Set the properties of Data Report as follows :
 Data Source  DataEnvironment1
 Data member  Command1

CCP603.7 to 8 21
Contd..

 Click on ‘Project Explorer’


 Click on ‘SQL Command1’
 Drag the fields and drop on the Data Report
details section
 Run the program

CCP603.7 to 8 22
QUIZ

1. DataReportDesigner will be placed on normal VB


form (True/False)
False
2. Cangrow property of RptLabel control determines if
the control can grow
a) Vertically
b) Horizontally
c) Diagonally
d) None
CCP603.7 to 8 23
3. Which section of the DataReportDesigner contains
actual data?
a) Page header
b) Report footer
c) Details
d) Group header/footer

CCP603.7 to 8 24
Summary

 Data Report is the object that represents


DataReport Designer
 Data Report Designer Vs.Data Environment
object
 Data Report Designer has separate controls
 We can create Data Report using Data Report
Generator with ease

CCP603.7 to 8 25
Frequently asked questions

1. Explain the sections of DataReport Designer.


2. Explain the controls of DataReport.
3. Write the procedure to create report using Data
Report Designer?

CCP603.7 to 8 26
THANK YOU

CCP603.7 to 8 27

Você também pode gostar