Fee System of the cooperative edition Data Center-Report

Source: Internet
Author: User

In my personal edition, my reports were quite smooth and there was no problem, but when I cooperated, I followed the previous steps step by step and kept reporting errors, it's really a crash. As a result, continuous re-creation and non-stop modification-deletion-creation-deletion are cyclical. Through cooperation, I would like to summarize the report knowledge. On the one hand, it is also a deep memory for myself. On the other hand, let's learn it together, so that students who encounter the same mistakes in the future can have a good inspiration.

 

Due to space limitations, I will talk about the specific process of creating a report in this article today, and explain why our reports encountered problems during cooperation.

 

The specific process of creating a report:

 

First, because you want to create a report at the U layer, right-click the U layer and choose add-new item.

 

The following page is displayed. Select a common item -- reporting -- Report, and change the name.

 

Next, design a report template.

 

When you drag the table control into the design report template, the following interface is displayed. Then select the data source we want to create

 

 

Next, we can proceed step by step. We do not need to describe anything here.

 

Next step

 

Next, select database connection. The database is not here when we work together, so we need to select another user's database.

 

Next, select the corresponding table

 

Continue to proceed.

 

Then, we will find a small square in the table in the designed report template. Click the small square and select the corresponding column name.

 

Don't forget to modify the column name and change the header to Chinese.

 

Next, create a new form, which is the form of the report. We need to create a report form, bind the template to the form, and create a data source to connect.

 

Drag the report control into the form, click a blacklist on the Right of reportviewer, and select a report template.

 

The next step is to bind the data source.

 

Note that the following interface is displayed. If we do not need to select a date for the query of the report, we do not need to perform the following operations. However, our data center charging system bills users by selecting a date, so we need to set parameters here, just like here is a method, then we can pass the parameters in the form to this "method. At the same time, you should also pay attention to the following interface to see the difference between the form after parameters are added and the form. Okay, let's proceed to the next step. Right-click the blue part and select "configuration"

 

The following interface is displayed.

 

Next, click the query generator to remove the check boxes of columns that do not need to be displayed.

 

Next, add the two parameters we need to query the start date and end date, that is, the section marked in yellow.

 

Click Next.

 

Click Next to complete. Return to this interface and check the comparison with the previous figure. Here there are two more parameters.

 

This is the code automatically generated before the parameter is added. You need to add two parameters later.

Private sub frmreport_load (byval sender as system. Object, byval e as system. eventargs) handles mybase. Load 'todo: This line of code loads data into the table "chargesystemdataset. t_checkbyday. You can move or delete it as needed. Me. t_checkbydaytableadapter.fill (Me. chargesystemdataset. t_checkbyday) me. reportviewer1.refreshreport () end sub

 

This is the code after parameters are added. That is, you can pass the content in the time text box in the form to the parameter.

'Todo: This line of code loads data to the table "chargesystemdataset. t_checkbyday. You can move or delete it as needed. Me. t_checkbydaytableadapter.fill (Me. chargesystemdataset. t_checkbyday, datetimepicker1.text, datetimepicker2.text) me. reportviewer1.refreshreport ()

 

I am here for this article today. In the next article, I will continue to talk about report problems, mainly to summarize and explain the problems in the table in our cooperation times.

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.