Adding controls to RDLC at runtime
I need to be able to add all of the user uploaded images to my report dynamically. I have all of the images stored in one place and I have the name of all the images stored in the database.
Is this possible with an RDLC or would I ha开发者_如何转开发ve to generate a pdf and then insert my images into that with something like iTextSharp?
I solved this by generating a PDF with just images and then I merge the two PDFs with iTextSharp.
Yes it is possible.
- In your RDLC add an image
- In the image properties, set the image source to external
- For the value of the external source point to a field from your dataset which could be something like: MyImageDirectory+NameOfImageFromDatabase.jpg
If you have multiple images to display, use a tablix or a list to list all of them
One more thing: I had to set my path as an URI to make it work. A string wouldn't work last time I tried.
精彩评论