MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Post on 14-Jan-2015

257 views 0 download

Tags:

description

MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Transcript of MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

The ability to create banded hierarchical reports.

MELJUN CORTESMELJUN CORTES

Steps in Adding Data Report

Steps in Adding Data Report

1.In your Standard EXE project, Click Project menu,

2.Click Add Data Report menu.

Parts of the Data ReportParts of the Data Report

1.Data Report Object Like Visual Basic form, the Data

Report object has both a visual DESIGNER and a CODE MODULE.

2.Data Report Controls Special controls that can only be

used in Data Report Designer.

3.Designer Sections This section contains the

following: Report Header Page Header Group Header/Footer Details Page Footer Report Footer

Parts Continued…

Parts Continued…

ReportDesignerReportDesigner

The object where you can design and layout a report.

Code ModuleCode Module

Like other module, data report module is used to add code to manipulate the report formats

Designer Section

Designer Section

1. Report Header Contains the text that appears at

the very beginning of a report, such as the report title, author, or database name.

2. Page Header Contains information that goes at

the top of every page, such as the report’s title

Section Continued…

Section Continued…

3.Group Header/Footer Contains a “repeating” section of

the data report. Each group header is matched with a group footer.

4. Details Contains the innermost

“repeating” part (the records) of the report.

Section Continued…

Section Continued…

5. Page Footer Contains the information that goes

at the bottom of every page, such as the page number.

6. Report Footer Contains the text that appears at

the very end of the report, such as summary information, or an address.

Designer SectionPreview

Designer SectionPreview

It also allows the user to show and hide its parts such as the following:

It also allows the user to show and hide its parts such as the following:

Report header/footer

Page header/footer

GridRulers

…and add several Group

Header/Footer

Report header/footer

Page header/footer

GridRulers

…and add several Group

Header/Footer

Data Report Controls

Data Report Controls

RptFunction

RptShape

RptLine

RptImage

PointerRptLabel

RptTextbox

Toolbox

Controls Continued…

Controls Continued…

1.Pointer Allows you to select a certain parts,

section or controls

2.Label Control (RptLabel) Allows you to place labels on the

report to identify fields or section

3.Image Control (RptImage) Enables you to place graphics on your

report.

Controls Continued…

Controls Continued…

4.Line Control (RptLine) Lets you draw rules on the report to

further distinguish sections

5.Shape Control (RptShape) Enables you to place rectangles,

triangles, or ovals

6.Function Control (RptFunction) A special text box that calculates

values as the report is generated

Designer Features

Designer Features

Drag and Drop Functionality for Fields

Toolbox Controls Print Preview Print Reports File Export Export Templates Asynchronous Operation

A database Connection

1.In your Standard EXE project, Click Project menu,

2.Click Add Environment menu.

Steps in Adding Data Environment

Steps in Adding Data Environment

Data Environment buttons

Data Environment buttons

Add Connection

Add Child Command

Insert Stored ProcedureAdd Command

DeleteRefresh

Design

Properties

View CodeOptio

n

Arrange by Connection

Arrange by Object

Step in Connecting Data Environment to databaseStep in Connecting Data Environment to database

1.Add Connection in your Data Environment by clicking Add Connection Button

2.Click Properties button

3.A common dialog box appear “Data Link Properties”

4.Click Microsoft Jet 3.51 OLE DB Provider for the converted database and Microsoft Jet 4.0 OLE DB provider for the unconverted database. This selects the correct OLE DB provider for accessing a Jet database.

Connection Continued…Connection Continued…

5.Click the Next button to get to the Connection Tab.

6.Click the ellipsis button (…) next to the first text box.

Connection Continued…Connection Continued…

Connection Continued…Connection Continued…

7.Use the Select Access Database dialog box to search your (*.mdb database type), database.

8.Choose your database then click test connection button. Then click OK to close dialog box.

Connection Continued…Connection Continued…

9.Click Add Command Button to display the command1 dialog box. In the dialog box, set the properties as shown below:

CommandName Name Connection Database Object

10.Click OK to Close the Dialog box.

11.Then drag fieldnames on the report which you want to use in the report

Connection Continued…Connection Continued…

Connecting Data Report to Data Environment

Connecting Data Report to Data Environment

1. On the properties window, click DataSource and then click DataEnvironment1 (the name of your Data Environment)

2. Then click DataMember and choose tablename that you want to use in your report.

The process in how to format,restrict, and receive input data

Input ValidationIn Visual Basic

Input ValidationIn Visual Basic

Field – Level Validation Using Textbox to restrict data

entry Using the masked edit control Form – Level Validation Form – Event Validation

Field – Level Validation

Field – Level Validation

InputBox Function KeyPress Event KeyUp and KeyDown Event Validate Event

Using Input Fields Event to restrict data

Field – Level Continued…

Field – Level Continued…

Using the InputBox Function

Private Sub Form_Load()varAge = InputBox(“Enter Your Age:”)

End Sub

InputBox( Prompt, [Title], [Default], [Xpos], [Ypos], [HelpFile], [Context]) As String

Displays standard dialog box prompting the user to enter a string value.

Field – Level Continued…

Field – Level Continued…

Using KeyPress to Modify Keystrokes

Private Sub Text1_KeyPress(KeyAscii As Integer)

KeyAscii = Asc(UCase(Chr(KeyAscii)))'Chr(CharCode As Long)'UCase(String)'Asc(String As String)As Integer

End Sub

When user enters a standard ASCII character, the KeyPress event occurs.

Field – Level Continued…

Field – Level Continued…

Using the Validate Event Using LostFocus & Validate Event to restrict input

Private Sub Text1_Validate(Cancel As Boolean)

If Text1.Text = "Welcome" Then

MsgBox "Valid Input"

Else: MsgBox "Invalid Input"

End If

End Sub

when the control lost its focus, the Validate Event occurs

Using Textbox to restrict data entryUsing Textbox to

restrict data entry

MaxLengthProperty PasswordChar Property Locked Property

Using TEXTBOX properties to restrict user inputs

MaxLength PropertyMaxLength Property

Used to set a maximum number of character that can be entered into a textbox.

LockedPropertyLockedProperty

Determines whether users can edit the text in a text box.

Passwordchar propertyPasswordchar property

Allows the user to hide characters that are entered into a text box.

Using the masked edit control

Using the masked edit control

Mask Property Format Property Text and ClipText Properties AutoTab Property Clearing Masked Edit ValidationError Event

Using MASKED EDIT properties and event to restrict and format data

Mask PropertyMask Property

Allow the user to hide characters that are entered into a text box.

format propertyformat property

Defines the format you want to use for displaying and printing the content of the control

AutotabPropertyAutotabProperty

When AutoTab property is True, the insertion point automatically moves to the next control

masked edit Continue…

masked edit Continue…

Using the ValidationError EventPrivate Sub MaskEdBox1_ValidationError(_InvalidText As String, StartPosition As Integer) If StartPosition = MaskEdBox1.MaxLength Then MsgBox "Limit 6 digit" Else: MsgBox "Digits Only" End IfEnd Sub

Occurs when the user types invalid character

Form – Level Validation

Form – Level Validation

Form – Level Keyboard Handler Enabling an OK Button Validating all fields on a form

This kind of validation will occur when all fields are filled in.

Form – Level Keyboard Handler

Form – Level Keyboard Handler

When KeyPreview property of form is True. The form receives events such as KeyDown, KeyPress, & KeyUp before any controls on the form

Form Event Used in Validating DataForm Event Used in Validating Data

Active and Deactive Event GotFocus and LostFocus Event Load and Unload Event QueryUnload Event

Using the form event to manage the forms, initialize controls and variables and write termination code.

Allocating of your Application

Steps for Distributingan Application

Steps for Distributingan Application

1. Packaging You must package your application

files into one or more .cab files that can be deployed to the location you choose, and you must create Setup Program for certain types of packages.

2. Deployment You must move your packaged

application to the location users can install it from.

Tools for Packaging and Distribution

Tools for Packaging and Distribution

1. Package and Deployment Wizard Automates many of the steps

involved in distributing application by presenting you with choices about how you want to configure your .cab files.

2. Setup Toolkit Lets you customize some of what

happens during the installation process

Using the package and deployment wizard

Using the package and deployment wizard

… Three ways you can start the wizard

Run from within Visual Basic as an add-in

Run it as a stand-alone component from outside the development environment

Run it in silent mode by launching it from a command prompt

1.Click the Add-ins menu, then choose Add-In Manager

Installing the Package & Deployment Wizard

Installing the Package & Deployment Wizard

2. In the list of Available Add-Ins, select Package & Deployment Wizard

3. Check the Loaded/Unloaded option & click OK

InstallingContinued...

InstallingContinued...

Two Kinds ofpackages

Two Kinds ofpackages

1. Standard Packages Distributing your application on disk,

floppy or via a network share

2. Internet Packages Distributing your application via an

internet or intranet site

1. Open the project you want to package or deploy using the wizard

2. Select Package & Deployment Wizard from the Add-Ins menu to start the wizard

Step in creatingStandard Package

Step in creatingStandard Package

3. On the main screen, click Package.

Standard PackageContinued…

Standard PackageContinued…

4. Select Standard Setup Package as the package type and click Next

Standard PackageContinued…

Standard PackageContinued…

5. Choose a folder location where your package will be assembled, then click Next

Standard PackageContinued…

Standard PackageContinued…

6. In the list of files to include as part of your application, select or clear the check box to the left of the file name, and then click Next

Standard PackageContinued…

Standard PackageContinued…

7. Choose either Single cab or Multiple cabs and click Next

Standard PackageContinued…

Standard PackageContinued…

8. Enter the title to be displayed when the Setup program is run, and click Next

Standard PackageContinued…

Standard PackageContinued…

9. Choose the Start Menu groups and items that will be created by the installation process, and click Next

Standard PackageContinued…

Standard PackageContinued…

10.Modify any file location and subfolder information for each of the files listed, if desired, and click Next

Standard PackageContinued…

Standard PackageContinued…

11.Check any files you want to install as shared, and then click Next

Standard PackageContinued…

Standard PackageContinued…

12.In the Script Name field, enter a name under which to save settings for the current session, and then click Finish to create the package

Standard PackageContinued…

Standard PackageContinued…