示例#1
0
        private void ValidateAllReportsRenderHTML5_UnitTest(string scenario)
        {
            if (!_isUnitTest)
            {
                Assert.Fail("This test is not valid to run as a LoadTest");
            }

            HTML50Render renderFormat = new HTML50Render();
            string       url;
            bool         allReportsRendered = true;
            var          failedReports      = new List <string>();
            var          contentManager     = ContentManagerFactory.GetInstance(scenario);

            Parallel.ForEach(contentManager.ExistingReports, (report) =>
            {
                try
                {
                    Logging.Log("Starting Rendering Scenario {0} , Report {1}", scenario, report);
                    RSExecutionInfo info     = contentManager.SoapAccessor.Execution.LoadReport(report, null);
                    RSExecutionInfo execInfo = contentManager.SoapAccessor.Execution.GetExecutionInfo();
                    url = contentManager.ConstructUrl(report, renderFormat, null, 1, 1, execInfo.ExecutionID, null);
                    string execid;
                    contentManager.IssueGetRequest(url, out execid);
                    Logging.Log("Completed Rendering Scenario {0} , Report {1}", scenario, report);
                }
                catch (Exception ex)
                {
                    Logging.Log("Report failed to render, scenario {0}, report {1} exception {2}", scenario, report, ex);
                    failedReports.Add(report);
                    allReportsRendered = false;
                }
            });

            Assert.IsTrue(allReportsRendered, "Reports failed to render {0}", failedReports.ToNewLineSeparatedString());
        }
示例#2
0
        private void SimulateFirstPageLoad(string report)
        {
            RSExecutionInfo info         = this.ContentManager.SoapAccessor.Execution.LoadReport(report, null);
            RSExecutionInfo execInfo     = this.ContentManager.SoapAccessor.Execution.GetExecutionInfo();
            HTML50Render    renderFormat = new HTML50Render();
            string          url          = this.ContentManager.ConstructUrl(report, renderFormat, null, 0, 0, execInfo.ExecutionID, null);
            string          execid;

            this.ContentManager.IssueGetRequest(url, out execid);
            execInfo = this.ContentManager.SoapAccessor.Execution.GetExecutionInfo();
        }
示例#3
0
        /// <summary>
        /// Prepares Url for Printing with SessionID
        /// </summary>
        /// <param name="report">Report for printing</param>
        /// <returns>Completed Url</returns>
        private string PrepareUrlForPrint(string report)
        {
            IMAGERender renderFormat = new IMAGERender();

            renderFormat.OutputFormat = "EMF";
            string          url      = this.ContentManager.URLAccessor.GetUrl(report, renderFormat, null);
            RSExecutionInfo execInfo = this.ContentManager.SoapAccessor.Execution.LoadReport(report, null);

            url += "&rs:SessionID=" + execInfo.ExecutionID;
            return(url);
        }
示例#4
0
        private string SimulateViewerControlExport(string report, string sessionid, string format, string outputformat)
        {
            string execId = string.Empty;

            this.ContentManager.SoapAccessor.Execution.LoadReport(report, null);
            this.ContentManager.SoapAccessor.Execution.ExecutionHeaderValue.ExecutionID = sessionid;
            RSExecutionInfo execInfo     = this.ContentManager.SoapAccessor.Execution.GetExecutionInfo();
            RSRenderStruct  renderFormat = this.ContentManager.ConstructRenderStruct(format, outputformat);
            string          url          = this.ContentManager.ConstructUrl(report, renderFormat, null, 0, 0, execInfo.ExecutionID, null);

            this.ContentManager.IssueGetRequest(url, out execId);

            return(execId);
        }
        /// <summary>
        /// Get Report Page Count (in normal view mode)
        /// </summary>
        /// <param name="report">Report Path</param>
        /// <returns>Page Count of the given report</returns>
        public int GetPageCount(string report)
        {
            string ext;
            string mimeType;
            string encoding;

            RSWarning[] warns;
            string[]    streamIDs;

            this.SoapAccessor.Execution.LoadReport(report, null);
            this.SoapAccessor.Execution.Render("HTML4.0", "<DeviceInfo><Section>1</Section></DeviceInfo>", out ext, out mimeType, out encoding, out warns, out streamIDs);
            RSExecutionInfo execInfo = this.SoapAccessor.Execution.GetExecutionInfo();

            return(execInfo.NumPages);
        }