Report of computer room charge

Source: Internet
Author: User
Tags add time create database

Objective:

Report as a major focus of the computer room charge system, its main process is divided into report design-database connection-VB and report interaction. Let's look at the report design first.

1. First download the installation Report Designer, it is commonly used by grid++report5.0

Download Link: http://xiazai.zol.com.cn/detail/27/262835.shtml

Add corresponding parts in VB


2. Open the Editor--insert a report header--Insert a static box to fill in the required content in a static box

Add time to insert a system variable box--In the Properties box--Data--Select date format

3. Insert Detail GRID--Enter SQL query statement--click the image below to establish a connection to the database

Click Create database connection and follow the instructions

Import the fields from the Database Checkday_info table into the grid (below two items)--Change the table header

4.vb code to interact with the report:

Similar to export Excel is defined first and then the assignment is finally performed using the

     Dim report as Grprolibctl.gridppreport   ' materialized reports
     Private Sub Form_Load ()
     Dim TxtSQL as String  ' instantiation report ', '
  
     Set ' = ' New grprolibctl.gridppreport  ' Report established location
  
     report.loadfromfile App.Path & "\CHECKDAY.GRF"
     Report.DetailGrid.Recordset.ConnectionString = ConnectString   ' data source connection database directly invokes the written module content
  
     TxtSQL = "SELECT * from Checkday_info"
     Report.DetailGrid.Recordset.QuerySQL = TxtSQL  ' View reports
     Grdisplayviewer1.report = Report ' Display reports
     Grdisplayviewer1.start
     End Sub
Summary:

Report learning a stage, in the process of learning is constantly have such sentiment: many times are difficult psychological hint frightened us rather than the difficulty itself, computer learning or need us to fall into the heart of the special research, all the problems are paper tigers.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.