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(); }
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))); }