private int GetItemTypeIndex(rsService.ItemTypeEnum type)
        {
            int index = 2;
            switch (type)
            {
                case rsService.ItemTypeEnum.Folder:
                    index = 0;
                    break;
                case rsService.ItemTypeEnum.DataSource:
                    index = 3;
                    break;
                case rsService.ItemTypeEnum.LinkedReport:
                    index = 1;
                    break;
                case rsService.ItemTypeEnum.Report:
                    index = 1;
                    break;
                case rsService.ItemTypeEnum.Resource:
                    index = 2;
                    break;
                default:
                    break;
            }

            return index;
        }
        private string GetFolderPath(rs2005.CatalogItem item)
        {
            string delimiter = "/";

            // Split the path string into the folder names as parts
            Regex rx = new Regex(delimiter);
            string[] pathParts = rx.Split(item.Path);

            // Check to see if the item has a virtual path and return the
            // virtual path for items that support it, like My Reports
            if (item.VirtualPath != null && pathParts[1] != "Users Folders")
                return item.VirtualPath;
            else
                return item.Path;
        }
        public void RenderReport(rs2005.CatalogItem report)
        {
            string currentPath;

            // If the path of the item is the root of the catalog
            // set path equal to /,
            if (this.Path == "/")
                currentPath = this.Path;
            else
                currentPath = this.Path + "/";

            // Build string for url access
            string url = serverPathTextbox.Text + "?" + currentPath + report.Name;

            try
            {
                ReportViewer viewer = new ReportViewer();
                viewer.Url = url;
                viewer.Show();
            }

            catch (Exception ex)
            {
                this.HandleGeneralException(ex);
            }
        }
        private void FillPropertiesListview(rs2005.CatalogItem selItem)
        {
            rs2005.Property[] property = null;
            // Clear Listview
            propertiesListview.Items.Clear();

            try
            {
                // Properties parameter is null so all properties for the specified item are returned.
                property = rs.GetProperties(selItem.Path, null);

                // Display properties in a Listview
                foreach (rs2005.Property prop in property)
                {
                    ListViewItem lstItem = propertiesListview.Items.Add(prop.Name);
                    lstItem.SubItems.Add(prop.Value);
                }
            }
            catch (Exception ex)
            {
                // Note: In a production application you would want to use a specific exception type
                this.HandleGeneralException(ex);
            }
        }
 public int GetTypeIndex(rs2005.ItemTypeEnum type)
 {
     int typeIndex= 0;
     switch (type)
     {
         case rs2005.ItemTypeEnum.Folder:
             typeIndex = 0;
             break;
         case rs2005.ItemTypeEnum.Report:
             typeIndex = 1;
             break;
         case rs2005.ItemTypeEnum.Resource:
             typeIndex = 2;
             break;
         case rs2005.ItemTypeEnum.LinkedReport:
             typeIndex = 3;
             break;
         case rs2005.ItemTypeEnum.DataSource:
             typeIndex = 4;
             break;
     }
     return typeIndex;
 }