Use the QR code control in the DevExpress program to print reports and devexpress report printing.

Source: Internet
Author: User

Use the QR code control in the DevExpress program to print reports and devexpress report printing.

In many business systems, more and more applications are involved in bar code and QR code. Both the Web interface and WInform interface need to handle many material-related operations, and even many enterprises want to reduce entry errors, scan each device by bar code or QR code directly in the process. Simply select some processing options on the interface, which greatly improves work efficiency and reduces the chance of errors. This article describes how to process bar codes and QR codes in DevExpress programs based on WInform, including interface display and report printing.

1. DevExpress bar code operation and report printing

In DevEpxress version 15.1 or later, the BarCodeControl control is added, which contains the display and processing of bar codes, QR codes, and other codes.

In the toolbox, we can find this control. After adding it to the interface, you can set the properties to display the following results.

For bar code control display, you must set the corresponding encoding and display content.

Set the correct format to display the bar code. Otherwise, the undisplayed content will be processed.

To facilitate interface processing and dynamically Add the corresponding bar code control display, we have an independent bar code control, as shown below.

To facilitate display, we add a FlowLayoutPanel flow layout control on the interface to dynamically Add the container of the bar code content. The interface code is as follows.

Run the Demo program to obtain the following test interface.

For bar code printing, We can display the content based on the XtraReport report template. Therefore, we need to design a report interface, as shown below.

This report interface adds a blank report, and then adds the corresponding label and QR code report controls. Just like operating the WInform interface, you can set the layout.

Add the corresponding data source information and set the field name of the bound control.

Finally, bind the report data source and print the report interface code as follows.

The page is displayed as follows.

 

2. Processing of QR code controls

The above is a bar code operation, where BarCodeControl is very confusing. In fact, it can also be used as a space for processing the QR code, which was discovered later, haha.

In fact, there are many open-source QR code controls on Github that can generate images for display.

As shown in the following interface, we can see that this QR code is also the result of the result. After setting the interface, we can immediately see the effect.

When using the built-in control, you only need to set its content when assigning values in the background code, as shown below.

// Use the built-in control var url = this.txt Content. Text. Trim (); this. barCodeControl1.Text = url;

If you use a third-party QR code control, such as ThoughtWorks. QRCode (https://github.com/aaronogan/QR.NET), the code you create is as follows.

Finally, compare the two groups of interfaces, as shown below.

 

 

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.