visual basic My.Computer.FileSystem.FileExists and custom code SSRS 2008R2


  • Hi,

    I want to add image dynamically into report, image file name is one of parameter (where folder name is let's say "C:\pictures\blabla").

    So I'm trying to create custom code to construct image path from parameter and check if such file exist or not.
    Basically, I'm stuck on how can I check that file exist, I have tried My.Computer.FileSystem.FileExists function.

    I have tried :

    If My.Computer.FileSystem.FileExists("C://pictures//blabla" + img_name + ".jpg") Then.... however that does not work.
    If My.Computer.FileSystem.FileExists("file:///C:/pictures/blabla/" & img_name & ".jpg") Then.... however that also does not work.
    If My.Computer.FileSystem.FileExists("C:\pictures\blabla" + img_name + ".jpg") Then.... neither this works.

    No syntax error, it just goes to "else" path of if statement.

    In future this will become part of custom assembly, so that's why I need to go with VB

    Thank you for your help.

    Sunday, November 25, 2012 5:01 PM

All replies

  • Have you seen this article?

    Josh Ash

    Monday, November 26, 2012 12:22 AM