Try something like:
private bool DoesFolderExist (string folder)
{
SearchCondition condition = new SearchCondition();
condition.Condition = ConditionEnum.Contains;
condition.ConditionSpecified = true;
condition.Name = "Name";
condition.Value =folder;
SearchCondition[] conditions;
conditions = new SearchCondition[1];
conditions[0] = condition;
CatalogItem[] returnedItems = m_ReportingService.FindItems( "/",
BooleanOperatorEnum.Or, conditions );
if (returnedItems != null && returnedItems.Length != 0)
foreach ( CatalogItem ci in returnedItems)
if (ci.Type == ItemTypeEnum.Folder)
if (ci.Name == folder) return true;
return false;
}
folder is the name of the folder you are checking to see if it exists.
Adrian M.
[quoted text, click to view] "Hari" <Hari@discussions.microsoft.com> wrote in message
news:AF901289-045C-48A2-BFCF-0168CE984E4D@microsoft.com...
> Hi all
> I am using Reporting Services's web services to migrate
> reports across environments. I have a report path from the source which i
> need to migrate .
> ex say reportPath1 = "/abc/xyz/report1"
> Before calling the create report i have to create the folders. I know
> there
> is a method called as CreatFolder, But i need to check as to if the folder
> doesn't exits create it else dont create. There is no method which tells
> whether the folder exists or not. Can some one help me solving this prob
>
>