Thursday, January 6, 2011

How to set the external file path for an image used in RDL report

  1. add an "image" element to the rdlc report created, set its "Source" property to "External" and its "MIMEType" property to "image/png" if the image file is a png
  2. drag a data field into the "image" element, this data field will contains the [filepath] of the image file, the filepath should be something looks like "file:///C:/temp/image.png" or "file:///c:\\temp\\image.png"
  3. add a reportviewer named rpv to the winform, and in the winform constructor code, add "rpv.LocalReport.EnableExternalImages = true;"

No comments:

Post a Comment