How to show images on an RDLC report
-
I have an RDLC report and would like one of the columns in a table on this report to display images. The datasource for my report is a class that has a property called Image of type System.Drawing.Image. On my report I dragged an image control onto the column and I set the following properties: MIMEType: image/png Source: Database Value: =Fields!Image.Value When I run my report, I get a broken image. I'd really appreciate any suggestions! Thanks in advance :o)
-
Answer:
I don't know if this is the best solution, but I got it to work. It looks like the problem was in using System.Drawing.Image. In my class, I created a new property called ImageByte of type byte[]. I didn't make a setter for ImageByte, but I made a getter that does the following: MemoryStream ms = new MemoryStream(); Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png); return ms.ToArray(); I updated my report to have =Fields!ImageByte.Value for the Value and now everything appears to be working as expected :o)
Tina Orooji at Stack Overflow Visit the source
Other answers
Firstly, you take a new Form in your project on Load event you Wright this line below: reportViewer1.LocalReport.EnableExternalImages = true; After that take reportViewer on that page and set smart tag of that, choose Design a new report and take an image control on it from ToolBox, set its property Source = External Value = file:\D:Images\Sunset.jpg Note: Image(Sunset.jpg) saved in Images folder on D drive. You changed it according to your requirement.
Praveen Pareta
Related Q & A:
- How are multiple images stitched?Best solution by stackoverflow.com
- How to upload images in background in iOS?Best solution by Stack Overflow
- How do I write up a geography report?Best solution by Yahoo! Answers
- How can I prepare a monthly sales report?Best solution by auctivacommerce.com
- How can I check a full company report?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.