Ejemplo n.º 1
0
        public void DownloadItem(string path, string destinationFolder, ReportItemTypes type, bool preserveFolders)
        {
            switch (type)
            {
            case ReportItemTypes.Folder:
                foreach (var catalogItem in RsFacade.ListChildren(path, true))
                {
                    DownloadItem(catalogItem.Path, destinationFolder, catalogItem.Type, preserveFolders);
                }
                break;

            case ReportItemTypes.Report:

                var definition = new XmlDocument();

                definition.Load(new MemoryStream(RsFacade.GetReportDefinition(path)));

                SaveItem(path, type, destinationFolder, preserveFolders, definition);

                break;

            case ReportItemTypes.Model:
                var model = new XmlDocument();

                model.Load(new MemoryStream(RsFacade.GetModelDefinition(path)));

                SaveItem(path, type, destinationFolder, preserveFolders, model);

                break;
            }

            toolStripStatusLabel.Text = String.Format("Downloaded '{0}'", path);
            Application.DoEvents();
        }
Ejemplo n.º 2
0
        public void ShouldCreateThenDownloadReport()
        {
            string reportPath;

            var definition = CreateReport(out reportPath);

            var report = facade.GetReportDefinition(reportPath);

            Assert.AreEqual(definition.Length, report.Length);
            Assert.IsTrue(definition.SequenceEqual(report));
        }
 private string GetReportDefinition(IRSFacade rsInstance, string path)
 {
     return(new UTF8Encoding().GetString(rsInstance.GetReportDefinition(path)));
 }