Archive

Posts Tagged ‘File listing’

Directory List Report

May 18, 2012 Leave a comment

Here is a sample report with a script that will list the contents of a folder on a hard drive.

First start with a blank report.   It will be unbound (no data source).   The data source will be created in a script.   On the report add a table and name each cell as follows:   Add a second table in the report header to name the columns.   And then finally add a label control for a title.

Now for the script that will run this report.

You set the variable “directory” to the folder you want to get a file list of.    You can modify this so it is a report parameter, but to keep things simple now, just hardcode the folder.   The rest of the script creates an array with file information and assigns the array to the datasource of the report.   Then each cell in the table needs to be bound to an element of the array.   Finally the title is set to the string variable “directory”.

The resulting report looks like this when previewed:

You can download this sample report HERE.

Advertisements