Get rid of database limitations and make real-world three-tier reports

Source: Internet
Author: User

What

Reports are used to dynamically display data in tables, charts, and other formats. We use a report to show the entire checkout in the final checkout part of the room charge.

The three-layer idea is to divide the entire software into appearances, logic, data three layers, each of which is connected but never offside. That is, the U-layer will not do the D layer of things, not to contact the database such things, but just send the requirements to B layer and then B-layer processing to the D layer and the database to complete the task, and finally the return value to the U-layer display.

A three-tier report, of course, is a report of a quarantined database,

Why:

Why do I want to make a report of a fully isolated database? The personal understanding of this is in line with the three-layer idea that the person responsible for the U-layer in the true three-tier collaboration is not directly accessible to the database, but should accept the data from the D-level.

If this: (for example) through the data source configuration manually connected to the database, it violates the three-tier principle, even if you are the final data obtained from the D layer, the data source of the report is the data returned from the D layer, but in this step is ultra vires. I think the u layer is not authorized to access the database directly

How:1: Create a DataSet Dateset
2: Add DataTable for Dateset
3: Add a report, add a dataset Dateset to the report, and then add a table to the report.



4:u Layer Code
        Dim CHECKBLL as New BLL. Checkbll        Dim dt As DataTable        dt = Checkbll.selectcheck (checkdate.value) ' Get data DataTable        Dim Myreport as New ReportDataSource ' defines a new data source myreport for the report        . Name = "DataSet1"        myreport. Value = dt        ReportViewer1.LocalReport.ReportEmbeddedResource = "UI. REPORT1.RDLC "        ReportViewer1.LocalReport.DataSources.Add (Myreport)" To add a data source        Me.ReportViewer1.RefreshReport ()
5: Show Results
Summary:

With the software into the engineering era, writing software more and more like assembling large machines, you can not rely on one's own power to complete, so we need to cooperate, need division of labor. Three layer, not only facilitates the system maintenance, but also is very good system division of labor. Each layer does its own work, does not affect each other, (weak coupling), and completes the system together.



Get rid of database limitations and make real-world three-tier reports

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.