[Rdlc]-How to display external images in rdlc reports

Source: Internet
Author: User

Summary at work. I hope I will not commit any further mistakes in the future !!!

 

In Windows Form Design

Prerequisites: (The following controls must be used)

CodeSetting: This. reportviewer1.localreport. enableexternalimages = true; // The local image displayed in the rdlc report must be set (disabled by default)

 

 

 

 

 

 

The following method needs to be performed on the rdlc design.

**************************************** **************************************** ******************

Method 1. Use the image control (the effect can be seen only after running)

The value of the image must be in the following format ("file: //" or "file)

= "File: // D: \ baidu_logo.gif"

Note: folders or file names that cannot contain special characters (such as #, Parentheses, and Chinese characters) = "file: // D: \ Project (C #) \ baidu_logo.gif"

 

 

Summary:

It may take a long time to load a report, depending on the size of the loaded image (to control the image size)

Flexible image modification (you can directly replace the original image if you do not like it.Program)

 

 

 

 

 

 

 

Method 2. Embedded display (reference http://www.cnblogs.com/jack86514/archive/2009/10/17/1584862.html)

Follow the steps below:

Step 1: Embed images on rdlc

 

Step 2: add the image you need

 

Step 3: add controls

(The default name is image1)

 

Step 4: Modify settings

Source is external (external) by default, but since the embedded image is displayed now, all changes to embedded (embedded)

 

Effect:

 

Summary:

The embedded image method is relatively easy but not flexible enough (you do not like the original image, you cannot directly replace it, you need to change the Program), because the image has become binary and saved in *. in the rdlc file, the report size is increased (the image size is increased to the report). If you only make reports similar to invoices, we strongly recommend that you, if it is a report of employee information, it is strongly not recommended.

 

 

 

Original size (left), embedded size (right)

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.