11.9 how to export data of the WinForm interface control DataGridView?

Source: Internet
Author: User

Data export is a very common task. The most acceptable format for users is Excel files. If other formats can be exported while exporting Excel files, users are more satisfied.

We currently provide a data export tool for the DataTable and DataGridView controls.

Component:IBeamMDAAWinUI. dll

Namespace:IBeam. MDAA. WinUI

Example:

Preview and export data:

String title = string. Format ("{0} Contact information", contactmechanic ismlist. PartyName );

Dgvcontactmechanic ismlist. Print (DataGridViewHelp. PaperType. A4 portrait, title );

 

Export an Excel file directly:

String title = string. Format ("{0} Contact information", contactmechanic ismlist. PartyName );

Dgvcontactmechanic ismlist. ExportToExcel (title, title );

Export PDF files directly:

String title = string. Format ("{0} Contact information", contactmechanic ismlist. PartyName );

Dgvcontactmechanic ismlist. ExportToPDF (DataGridViewHelp. PaperType. A4 portrait, title, title );

 

Export the file as a BMP file:

String title = string. format ("{0} Contact information", contactmechanic ismlist. partyName); dgvcontactmechanic ismlist. exportToImage (maid. paperType. a4 vertical, "BMP", title, title );

 

Export the file as a TIFF file:

String title = string. Format ("{0} Contact information", contactmechanic ismlist. PartyName );

Dgvcontactmechanic ismlist. ExportToImage (DataGridViewHelp. PaperType. A4 portrait, "TIFF", title, title );

 

Export the image as a JPEG file:

String title = string. format ("{0} Contact information", contactmechanic ismlist. partyName); dgvcontactmechanic ismlist. exportToImage (maid. paperType. a4 vertical, "JPEG", title, title );

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.