Пример #1
0
        /// <summary>
        /// Render a Tabular element containing Name/Value pair for CreatedBy and CreationDate properties.
        /// </summary>
        /// <param name="catalogItem"></param>
        private void TabularPreview(CatalogItem catalogItem)
        {
            //Start Tabular
            xmlQueryResponse.WriteStartElement("Tabular");
            //CreatedBy Record
            xmlQueryResponse.WriteStartElement("Record");
            xmlQueryResponse.WriteElementString("Name",
                string.Format(CultureInfo.InvariantCulture, Resources.Resources.CreatedBy));
            xmlQueryResponse.WriteElementString("Value",
                string.Format(CultureInfo.InvariantCulture, catalogItem.CreatedBy));
            xmlQueryResponse.WriteEndElement();
            //CreationDate Record
            xmlQueryResponse.WriteStartElement("Record");
            xmlQueryResponse.WriteElementString("Name",
                string.Format(CultureInfo.InvariantCulture, Resources.Resources.CreationDate));
            xmlQueryResponse.WriteElementString("Value",
                string.Format(CultureInfo.InvariantCulture, catalogItem.CreationDate.ToString()));
            xmlQueryResponse.WriteEndElement();

            xmlQueryResponse.WriteEndElement();
        }
Пример #2
0
        private void DownloadItem(string localDirectory, CatalogItem item)
        {
            if(item.Type == ItemTypeEnum.Report)
            {
                byte[] reportDefinition = null;
                System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
                reportDefinition = ReportingService.GetReportDefinition(item.Path);
                MemoryStream stream = new MemoryStream(reportDefinition);

                doc.Load(stream);
                doc.Save(Path.Combine(localDirectory + @"/",
                    item.Name + GetExtensionfromType(Enum.GetName(typeof(ItemTypeEnum), item.Type))));
            }
        }