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

Embed Size (px)

Citation preview

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    1/62

    The ability to create bandedhierarchical reports.MELJUN ORTES

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    2/62

    Steps in Adding DataReport

    1. In your StandardEXE project,

    Click Projectmenu,

    2.Click Add DataReport menu.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    3/62

    Parts of theData Report

    1.Data Report Object

    Like Visual Basic form, the Data Reportobject has both a visual DESIGNERanda CODE MODULE.

    2.Data Report Controls Special controls that can only be used

    in Data Report Designer.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    4/62

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    5/62

    ReportDesigner

    The object

    where you candesign andlayout a report.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    6/62

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    7/62

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    8/62

    DesignerSection

    1. Report Header

    Contains the text that appears at the

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

    2. Page Header Contains information that goes at the

    top of every page, such as the reports

    title

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    9/62

    Sectionontinue

    3. Group Header/Footer Contains a repeating section of the

    data report. Each group header ismatched with a group footer.

    4. Details

    Contains the innermost repeating

    part (the records) of the report.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    10/62

    Sectionontinue

    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.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    11/62

    DesignerSectionPreview

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    12/62

    It also allows

    the user to

    show and hideits parts such

    as the

    following:Report

    header/footer

    Page header/footer

    GridRulers

    and add several

    GroupHeader/Footer

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    13/62

    Data ReportControls

    RptFunction

    RptShape

    RptLine

    RptImage

    Pointer

    RptLabel

    RptTextbox

    oolbox

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    14/62

    Controlsontinue

    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.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    15/62

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    16/62

    DesignerFeatures

    Drag and Drop Functionalityfor Fields

    Toolbox Controls

    Print Preview

    Print Reports

    File Export

    Export Templates

    Asynchronous Operation

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    17/62

    A database Connection

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    18/62

    1. In your StandardEXE project, Click

    Project menu,

    2.Click AddEnvironmentmenu.

    Steps in AddingData Environment

    Add C i

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    19/62

    Data Environmentbuttons

    AddConnection

    Add Child Command

    Insert Stored Procedure

    Add Command

    Delete

    RefreshDesign

    Properties

    ViewCode

    Option

    Arrange by Connection

    Arrange by Object

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    20/62

    Step in Connecting DataEnvironment to database

    1.Add Connectionin your DataEnvironment by clicking AddConnection Button

    2.Click Propertiesbutton

    3.A common dialog box appear Data LinkProperties

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    21/62

    4.Click Microsoft Jet 3.51 OLE DBProviderfor the converted database andMicrosoft Jet 4.0 OLE DB provider forthe unconverted database. This selects

    the correct OLE DB provider foraccessing a Jet database.

    Connectionontinue

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    22/62

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

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

    Connectionontinue

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    23/62

    Connectionontinue

    7.Use the Select Access Database dialogbox to search your (*.mdb database

    type), database.

    8.Choose your database then click testconnection button. Then click OK toclose dialog box.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    24/62

    Connectionontinue

    9.Click Add CommandButton to displaythe command1 dialog box. In the dialogbox, set the properties as shown below:

    CommandName

    Name

    Connection

    Database Object

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    25/62

    10.Click OKto Close the Dialog box.

    11.Then drag fieldnameson the reportwhich you want to use in the report

    Connectionontinue

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    26/62

    Connecting Data Reportto Data Environment

    1. On the properties window, clickDataSource and then click

    DataEnvironment1 (the name of yourData Environment)

    2. Then click DataMember and choosetablenamethat you want to use inyour report.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    27/62

    The process in how to format,

    restrict, and receive input data

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    28/62

    Input ValidationIn Visual Basic

    Field Level Validation

    Using Textbox to restrict data entry

    Using the masked edit control

    Form Level Validation Form Event Validation

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    29/62

    Field LevelValidation

    InputBox Function

    KeyPress Event

    KeyUp and KeyDownEvent

    Validate Event

    Using Input FieldsEvent to restrictdata

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    30/62

    Field Levelontinue

    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.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    31/62

    Field Levelontinue

    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 IntegerEnd Sub

    When user enters a standard ASCII

    character, the KeyPress event occurs.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    32/62

    Field Levelontinue

    Using the Validate Event Using LostFocus& ValidateEvent 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 Eventoccurs

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    33/62

    Using Textbox torestrict data entry

    MaxLengthProperty

    PasswordCharProperty

    LockedProperty

    Using TEXTBOX properties to restrict

    user inputs

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    34/62

    MaxLength Property

    Used to set a

    maximum number

    of character thatcan be entered

    into a textbox.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    35/62

    Locked

    Property

    Determines

    whether users can

    edit the text in atext box.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    36/62

    Passwordchar

    property

    Allows the user to

    hide characters

    that are enteredinto a text box.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    37/62

    Using the maskededit control

    Mask Property

    FormatProperty

    Text and ClipText Properties

    AutoTab Property

    Clearing Masked Edit

    ValidationError Event

    Using MASKED EDITproperties and

    event to restrict and format data

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    38/62

    Mask Property

    Allow the user to

    hide characters

    that are enteredinto a text box.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    39/62

    formatproperty

    Defines the

    format you want

    to use fordisplaying and

    printing the

    content of thecontrol

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    40/62

    AutotabProperty

    When AutoTabproperty is True,

    the insertionpoint

    automatically

    moves to the nextcontrol

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    41/62

    masked editontinue

    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

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    42/62

    Form LevelValidation

    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.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    43/62

    Form LevelKeyboard Handler

    When KeyPreviewproperty of form is

    True. The formreceives events such

    as KeyDown,

    KeyPress, & KeyUp

    before any controlson the form

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    44/62

    Form Event Usedin Validating Data

    Active andDeactive Event

    GotFocus andLostFocus Event

    Load andUnload Event

    QueryUnload Event

    Using the form event to manage theforms, initialize controls andvariables and write termination code.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    45/62

    Allocating of your Application

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    46/62

    Steps for Distributingan Application

    1. Packaging You must package your application files

    into one or more .cab files that can bedeployed to the location you choose,and you must create Setup Program forcertain types of packages.

    2. Deployment You must move your packaged

    application to the location users caninstall it from.

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    47/62

    Tools for Packagingand Distribution

    1. Package and Deployment Wizard

    Automates many of the steps

    involved in distributing application bypresenting you with choices abouthow you want to configure your .cabfiles.

    2. Setup Toolkit

    Lets you customize some of whathappens during the installation

    process

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    48/62

    Using the package and deployment wizard

    Three ways you can start the wizard

    Run from within Visual Basic as anadd-in

    Run it as a stand-alone componentfrom outside the development

    environment Run it in silent mode by launching it

    from a command prompt

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    49/62

    1.Click the Add-insmenu, then

    choose Add-InManager

    Installing the Package Deployment Wizard

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    50/62

    2. In the list ofAvailable Add-Ins,

    select Package &

    Deployment

    Wizard

    3. Check theLoaded/Unloaded

    option & click OK

    InstallingContinued...

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    51/62

    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

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    52/62

    1. Open the projectyou want to

    package or deployusing the wizard

    2. Select Package &

    DeploymentWizardfrom the

    Add-Insmenu to

    start the wizard

    Step in creatingStandard Package

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    53/62

    3. On the mainscreen, click

    Package.

    Standard Packageontinue

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    54/62

    4. Select StandardSetup Package

    as the packagetype and click

    Next

    Standard Packageontinue

    5 Ch f ld

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    55/62

    5. Choose a folderlocation where

    your package willbe assembled,

    then click Next

    Standard Packageontinue

    6 I th li t f fil t

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    56/62

    6. In the list of files toinclude as part of

    your application,select or clear the

    check box to the

    left of the file

    name, and thenclick Next

    Standard Packageontinue

    7 Ch ith

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    57/62

    7. Choose eitherSingle cab or

    Multiple cabsand click Next

    Standard Packageontinue

    8 E t th titl t

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    58/62

    8. Enter the title tobe displayed

    when the Setupprogram is run,

    and click Next

    Standard Packageontinue

    9 Ch th

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    59/62

    9. Choose theStart Menu

    groups anditems that will be

    created by the

    installation

    process, and

    click Next

    Standard Packageontinue

    10 M dif fil

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    60/62

    10.Modify any filelocation and

    subfolderinformation for

    each of the

    files listed, if

    desired, and

    click Next

    Standard Packageontinue

    11 Ch k fil

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    61/62

    11.Check any filesyou want to

    install asshared, and

    then click Next

    Standard Packageontinue

    12 I th S i t

  • 8/13/2019 MELJUN CORTES Visual Basics Data Report & Data Environment & Input Validation & Application Distribution

    62/62

    12.In the ScriptName field, enter

    a name underwhich to save

    settings for the

    current session,

    and then click

    Finish to create

    the package

    Standard Package