views:

206

answers:

2

I am building a report that needs to include photographs, I have no way of knowing how many photos will be taken but they are stored on a file server under folder named after the ID of the report being generated. How would I go about including these in an RDLC?

A: 

I'm a PHP guy so my answer needs to be filtered, but in PHP you'd do a directory reading and then review each file in the directory to make sure it was a suitable image type for including.

opendir() readdir()

and the a for a while loop to review the file name extensions to make sure you're including only images.

jerebear
I know file i/o, the problem is with RDLC more than anything, it's kind of like crystal reports.
Jared
Maybe this link will help http://msdn.microsoft.com/en-us/library/ms252067(VS.80).aspx
jerebear
It does not... all the msdn documentation assumes you know how many images, exactly where they are located and the filename. The only condition I meet there is the second.
Jared
+1  A: 

It's simple to include images in report if you know quantity and filenames: MSDN How to: Add an Image (Image Wizard)

But in your case if you don't know how many images should be displayed, you have options:
- save image file names in DB and select them with sql from report
or
- create web service to gether image file names from directory and pass it in report as a datasource. Reporting Services: Using XML and Web Service Data Sources

Next in report use Table or List, place Image there and set url/path to Image from datasource field.

Max Gontar
I ended up having my code scan the file system and add entries to the database.
Jared