Format settings of the exported file in the Crystal Report

Source: Internet
Author: User
Original article: Setting the format of the exported file in the Crystal Report

The export and print functions provided by the crystal report are very convenient to use, but sometimes the files to be exported do not need so many types. I have summarized some friends' codes on the Internet, you can use the code to customize the exported file type.

First, you need to define an enumeration:

Public Enum allowedexportformat {// <summary> // PDF. /// </Summary> pdf = 1, /// <summary> // Excel (97-2003) /// </Summary> excel2003 = 2, /// <summary> /// word (97-2003) /// </Summary> word2003 = 4, /// <summary> /// RTF /// </Summary> RTF = 8, /// <summary> /// crystal report /// </Summary> crystalreport = 16, /// <summary> // Excel (97-2003) (data only) /// </Summary> excel2003dataonly = 32, // <summary> // word (97-2003) -editable /// </Summary> word2003editable = 64, /// <summary> /// XML /// </Summary> xml = 128, /// <summary> // Excel (data only) // </Summary> exceldataonly = 512, /// <summary> /// CSV /// </Summary> CSV = 1024}

Then you can set the export format of the Crystal Report and select the corresponding enumerated value based on the export format you need.

crystalReportViewer1.AllowedExportFormats =                    (int)(AllowedExportFormat.Word2003                    | AllowedExportFormat.PDF                    | AllowedExportFormat.XML);

As for the order of the default export format of the Crystal Report, I tested it casually and gave up if it didn't succeed.

Format settings of the exported file in the Crystal Report

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.