SQLServer Reporting Services check if file exists

  • I want to use SQLServer 2008 Reporting Services(subscriptions) to report a specific missing file on the file system (network drive). I am using a query to retrieve the path. I used the folleowing in the textbox expression

    =IIf(System.IO.File.Exists(Fields!DXFFile.Value),"True","False")

    But I am always returning "False" even if the file exists. Why? Any help figuring out how to check if the file exists?

    Thanks a lot !

    Bazim

  • I'm sorry to be a little obtuse, but I was unaware you could use things like system.io in expressions?

    Also, I need to ask WHY you would do this in a report?

    I think we need a bit more detail.

    CEWII

  • I tried referencing assemblies .dll/codes (function to check if file exists) with the same results (False).

    We have people creating .dxf files for specific production units and dumping these files on a network drive. I am trying to see if I can check these drives to report (via Reporting Services subscriptions) any units where the associated files are missing.

  • You might want to go about this in a different way where you have a sproc do a dir on a directory and get the data and store it. I just don't thing this is the best way. You could also build a SQL CLR object to do this VERY easily..

    CEWII

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply