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

62
The ability to create banded hierarchical reports. MELJUN CORTES MELJUN CORTES

description

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

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

Page 1: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

The ability to create banded hierarchical reports.

MELJUN CORTESMELJUN CORTES

Page 2: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 3: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 4: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

3.Designer Sections This section contains the

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

Parts Continued…

Parts Continued…

Page 5: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

ReportDesignerReportDesigner

The object where you can design and layout a report.

Page 6: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Code ModuleCode Module

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

Page 7: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution
Page 8: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 9: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 10: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 11: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Designer SectionPreview

Designer SectionPreview

Page 12: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 13: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Data Report Controls

Data Report Controls

RptFunction

RptShape

RptLine

RptImage

PointerRptLabel

RptTextbox

Toolbox

Page 14: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 15: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 16: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Designer Features

Designer Features

Drag and Drop Functionality for Fields

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

Page 17: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

A database Connection

Page 18: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

2.Click Add Environment menu.

Steps in Adding Data Environment

Steps in Adding Data Environment

Page 19: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 20: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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”

Page 21: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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…

Page 22: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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…

Page 23: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 24: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 25: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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…

Page 26: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 27: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 28: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 29: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Field – Level Validation

Field – Level Validation

InputBox Function KeyPress Event KeyUp and KeyDown Event Validate Event

Using Input Fields Event to restrict data

Page 30: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 31: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 32: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 33: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Using Textbox to restrict data entryUsing Textbox to

restrict data entry

MaxLengthProperty PasswordChar Property Locked Property

Using TEXTBOX properties to restrict user inputs

Page 34: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

MaxLength PropertyMaxLength Property

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

Page 35: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

LockedPropertyLockedProperty

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

Page 36: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Passwordchar propertyPasswordchar property

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

Page 37: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 38: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Mask PropertyMask Property

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

Page 39: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

format propertyformat property

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

Page 40: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

AutotabPropertyAutotabProperty

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

Page 41: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 42: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 43: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 44: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 45: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

Allocating of your Application

Page 46: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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.

Page 47: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 48: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 49: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Installing the Package & Deployment Wizard

Installing the Package & Deployment Wizard

Page 50: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

3. Check the Loaded/Unloaded option & click OK

InstallingContinued...

InstallingContinued...

Page 51: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 52: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Page 53: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

3. On the main screen, click Package.

Standard PackageContinued…

Standard PackageContinued…

Page 54: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Standard PackageContinued…

Standard PackageContinued…

Page 55: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Standard PackageContinued…

Standard PackageContinued…

Page 56: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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…

Page 57: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Standard PackageContinued…

Standard PackageContinued…

Page 58: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Standard PackageContinued…

Standard PackageContinued…

Page 59: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Standard PackageContinued…

Standard PackageContinued…

Page 60: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Standard PackageContinued…

Standard PackageContinued…

Page 61: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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

Standard PackageContinued…

Standard PackageContinued…

Page 62: MELJUN CORTES Data Report & Data Environment & Input Validation & Application Distribution

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…