Rui Lang report Application series three

Source: Internet
Author: User

The last two times that is a little fur, the series of applications will be more and more in-depth analysis and explain the sharp waves more in-depth content, some of the group's friends mentioned some of the problems, some of my actual use of the process of the problem. If you have any questions, you will be answered.

So today we're talking about report data acquisition issues and data presentation issues. To the point of view, first of all, the problem of data acquisition, there was someone in the group asked, sharp waves can be taken to excel inside the data, my answer is yes, can. This is not what I said, it is their manufacturers said, then there are several ways of data acquisition, first of all I know, txt text content data, Word data, Excel data, Access database, SQL, etc., the traditional database is supported.

Let me give you a few examples to see separately. The first one is the TXT document data.

Friends, do you see clearly, this is the place where the data source is set, the data source is in the TXT document, and finally the XML parsed out the data obtained. So other word, it is similar, do not do a detailed introduction;

Next introduce the next EXECL data, EXECL table believe everyone will do, in fact it and we usually use the mysql,sqlserver, such as database, the following people look at the picture to speak.

Please note that the database connection string, and then continue to look at the SQL query statement, it indicates the need for [] to expand, no sign will be error, you can try Oh; Access database, and Excel a little type, but and SQL these databases are also very similar. Finally, I show you the database connection of SQL Server;

Here you may ask, is this the only way to get the data source? The answer is: No, how is it possible, a so well-known report tool how can only so simple, then I give you continue to go into the data acquisition. That is, we put the database connection string and query statements into the controller of our program or in the background. This time the acquisition data set said here, and then said that the report template how to display the data;

The above mentioned that we have a data source, with query syntax, then how to display the data we want, the following SQL database as an example to everyone in detail, talking about the interface display, it is necessary to start from the SQL statement, the interface to show the field or content, that must be the SQL statement inside some content, right. Query statements We can write this, the statement is as follows,

SELECT * from Customers ORDER by region,city Simple, the interface design time we have to remember that we need to display those content or fields, we put in the detail list is OK.

Some people will say this much trouble, I also need to see in the database which fields, then we will write this statement long good, select Customerid,companyname,contactname,contactname from Customers Order by region,city How about this, it's a lot clearer. Let's look at the results below:

Use this report of children's shoes specifically how to operate I do not explain in detail, just beginning to learn the friends remember the following steps, on the right side of the designer has a recordset-field collection, add the fields you want to be able to, the note here is (field type) I've had a loss here before. The field type here is to match the field type in the database. Well, I won't show it as a result. These report headers on the report template, the end of the report, the datasets are either right-click on the design interface, or the designer has a favorite toolbar on it.

Today, the main content of today is a variety of data source acquisition and simple design report template. Next time I'll show you the background and templates to get the data and show it together. I hope you can enjoy my sharing. Thank you, your support is my greatest motivation, and I hope you will criticize correct. There are said inappropriate, there are errors, not clear of the place I would like to ask you to improve.

Rui Lang report Application series three

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.