Beispiel #1
0
        public byte[] CreateReport(out string reportPath)
        {
            var definition = Controller.GetBytesFromFile(@"Catalog.rdl");

            facade.CreateReport("Catalog", testFolder.Path, true, definition, null);

            var item = facade.ListChildren(testFolder.Path, false)
                       .FirstOrDefault(i => i.Name == "Catalog" && i.Type == ReportItemTypes.Report);

            Assert.IsNotNull(item);

            reportPath = item.Path;

            return(definition);
        }
        public void UploadReport(string filename, string destinationFolder, bool overwrite)
        {
            try
            {
                var definition = GetBytesFromFile(filename);

                var visibleName = Path.GetFileName(filename);

                RsFacade.CreateReport(visibleName, destinationFolder, overwrite, definition, null);

                toolStripStatusLabel.Text = String.Format("Uploaded item {0}", Path.GetFileName(filename));
                Application.DoEvents();
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("An error has occured: {0}", ex.Message));
            }
        }