Using Crystal Reprts to read a MS Windows file folder

Sunday 9 September 2012 @ 11:26 pm

This came up recently in a forum discussion and I was surprised at how many users were not aware of this.

Crystal Reports has a connection option called “File System Data” which turns any Windows file folder into a table, providing 65 fields for every file in the folder.  These fields include the common items like file name, extension, size and dates.  It also includes some that are specific to applications like the number of pages and the number of words for MS Word files.  If the file is a Crystal Report you have access to all of the  “Summary Info” fields like Title, Author, Comments, Revision Number, etc.

To use this feature create a new report and open the  “Create a new connection” node. Look for the item called “File System Data” and select it.  It will ask you to select a starting directory (folder).  Then you can decide to include all files or filter to specific values. You can also decide to include some or all subdirectories (subfolders). From there the folder becomes a table that you can use like you would any other table.

For some real fun you can use the file name in the ‘hyperlink’ property, which allows you to open any file directly from within CR.   I also use this to analyze my Customer project folders, looking for the largest folders that have been dormant for over a year.  That lets me move the largest and oldest files to archive folders and trim down the size of my weekly backups.  If you have a creative use for this feature please drop me a line.

Leave a Reply

Recrystallize Pro

Crystal Reports Server