C # bind Winform ReportView to data

Source: Internet
Author: User

. Net frame work 3.5 ReportView
1. Create an rdlc file, design the UI, bind fields, and create a new dataset as the data source. The data is temporary and does not need to be persisted.
2. Create a winform page, pull a MicrosoftreportViewer, and select a new *. rdlc file report.
3. Data Binding: the push-pull model. Bind the data fields to be presented in the report and bind the data source.
Binding code:
ReportViewer1.LocalReport. CES. Clear ();
This. reportViewer1.LocalReport. CES. Add (new Microsoft. Reporting. WinForms. ReportDataSource ("dsNotice_Notice ",
Data. Notice ));
This. reportViewer1.LocalReport. CES. Add (new Microsoft. Reporting. WinForms. ReportDataSource ("dsNotice_Details ",
Data. Details ));
This. reportViewer1.RefreshReport ();
Data Source Name: dataset_table, for example, dsNotice_Notice.
Data Source value: Table object.
Multiple tables are added multiple times.
We recommend that you clear CES before binding each time.
Print: Reports are larger than the default horizontal printing, while reports are vertical printing.

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.