"C #" Report Production < machine room reconstruction >

Source: Internet
Author: User

Preface

and VB need to refer to other reporting software, vs comes with the function of the report design, the first attempt. I feel the strength of it.

Report Production

Words don't say much. The production process of direct report.

1, first, we must first make a report of the container. On the window where we display the report.

2. Then, add a report.



3, after the completion of the report, we will see the relevant data of the report.


4. Add good data source and data set, and test connection is successful.


5, after the success of the See.

Join the number of parameters to be used.

6. Then we can add what we need in the report toolbox. For example, table. text boxes, and so on. The table here is able to directly reference the contents of the data set. Click on the small icon in the table to make it.


7. Finally, reference the data source dataset.


Well, for some basic configuration here it's done.

Next is the code.

Code

private void Btninquire_click (object sender, EventArgs e) {    string begindate = DtpBegin.Text.Trim ();    String EndDate = DtpEnd.Text.Trim ();    Facade.facade Faca = new Facade.facade ();    DataTable table = Faca. Inqcheckinfo (Begindate, EndDate);    ReportDataSource Rptdatasource = new ReportDataSource ();    reportparameter[] Params =     {        new ReportParameter ("ID", Entity.Model.user),        new ReportParameter (" Checkdate ", DateTime.Now.ToShortDateString ())    };    Rptdatasource.name = "Datasetcheckreport";//Specify Data set name    Rptdatasource.value = table;//data Source name    ReportViewer.LocalReport.ReportEmbeddedResource = "UI. CHECKREPORT.RDLC ";//Report File name    reportViewer.LocalReport.DataSources.Clear ();//clear the Presence report    REPORTVIEWER.LOCALREPORT.DATASOURCES.ADD (Rptdatasource);//Join the data source    reportViewer.LocalReport.SetParameters ( Params);//Pass the parameter    reportviewer.refreshreport ();//Refresh Report Control}
The code is almost the same as the D layer, which is to pass in the parameters before running. Run the steps as above.

Summarize

In the process of making a report, it is assumed that the difficulties encountered. We have to say that the issue occurs when the number of references. Most of this problem is named, right-click. Set properties. Just be careful, let the name of the variable not go wrong, the report should show up normally.

After the report, there is a very big feeling is that you in the production process of any point, you will find its powerful not only can display data, there are a lot of features. Very friendly to users.

Feel that you not only have too much room for improvement in technology. In terms of interface friendliness, there is too much to learn.

So, it's not important to do software. It is important to do the software how many people like to use.

"C #" Report Production < machine room reconstruction >

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.