public Stream RenderReportHTML(NameValueCollection deviceInfo, PageCountMode pageCountMode, out string scrollScript, out string pageStyle)
 {
     this.m_htmlStreamCache.Clear();
     using (AspNetCore.Reporting.StreamCache streamCache = new AspNetCore.Reporting.StreamCache(this.CreateStreamCallback))
     {
         try
         {
             LocalHtmlRenderer.Render(deviceInfo, pageCountMode, this, this.GetStreamCallback(streamCache), out scrollScript, out pageStyle);
         }
         finally
         {
             streamCache.MoveSecondaryStreamsTo(this.m_htmlStreamCache);
         }
         return(streamCache.GetMainStream(true));
     }
 }
Ejemplo n.º 2
0
 public ReportActionHandler(Report report, object eventSender, int currentPage, PageCountMode pageCountMode, CancelEventHandler toggle, DocumentMapNavigationEventHandler documentMapNavigation,
                            SortEventHandler sort, CancelEventHandler refresh)
 {
     this.m_report        = report;
     this.m_pageCountMode = pageCountMode;
     this.m_currentPage   = currentPage;
     this.m_eventSender   = eventSender;
     //this.m_pageNav = pageNav;
     this.m_toggle = toggle;
     //this.m_bookmarkNavigation = bookmarkNavigation;
     this.m_documentMapNavigation = documentMapNavigation;
     //this.m_drillthrough = drillthrough;
     this.m_sort = sort;
     //this.m_search = search;
     this.m_refresh = refresh;
 }
Ejemplo n.º 3
0
 public override int GetTotalPages(out PageCountMode pageCountMode)
 {
     lock (m_syncObject)
     {
         LocalExecutionInfo executionInfo = m_processingHost.ExecutionInfo;
         if (executionInfo.PaginationMode == PaginationMode.TotalPages)
         {
             pageCountMode = PageCountMode.Actual;
         }
         else
         {
             pageCountMode = PageCountMode.Estimate;
         }
         return(executionInfo.TotalPages);
     }
 }
        public byte[] Render(string Format, string DeviceInfo, PageCountMode PaginationMode, out string Extension, out string MimeType, out string Encoding, out Warning[] Warnings, out string[] StreamIds)
        {
            string ext  = null;
            string mime = null;
            string enc  = null;

            Warning[]            w             = null;
            string[]             sids          = null;
            ProxyMethod <byte[]> initialMethod = new ProxyMethod <byte[]>("Render2", () => Render2(Format, DeviceInfo, PaginationMode, out ext, out mime, out enc, out w, out sids));
            ProxyMethod <byte[]> retryMethod   = new ProxyMethod <byte[]>("Render", () => base.Render(Format, DeviceInfo, out ext, out mime, out enc, out w, out sids));

            byte[] result = ProxyMethodInvocation.Execute(this, initialMethod, retryMethod);
            Extension = ext;
            MimeType  = mime;
            Encoding  = enc;
            Warnings  = w;
            StreamIds = sids;
            return(result);
        }
        public override Stream RenderReport(string format, bool allowInternalRenderers, string deviceInfo, NameValueCollection additionalParams, bool cacheSecondaryStreamsForHtml, out string mimeType, out string fileNameExtension)
        {
            using (AspNetCore.Reporting.StreamCache streamCache = new AspNetCore.Reporting.StreamCache())
            {
                PageCountMode pageCountMode = PageCountMode.Estimate;
                if (additionalParams != null && string.Compare(additionalParams["rs:PageCountMode"], PageCountMode.Actual.ToString(), StringComparison.OrdinalIgnoreCase) == 0)
                {
                    pageCountMode = PageCountMode.Actual;
                }
                Warning[] array = default(Warning[]);
                this.m_localReport.InternalRender(format, allowInternalRenderers, deviceInfo, pageCountMode, (AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream)streamCache.StreamCallback, out array);
                if (cacheSecondaryStreamsForHtml)
                {
                    streamCache.MoveSecondaryStreamsTo(base.m_htmlStreamCache);
                }

                return(streamCache.GetMainStream(true, out Encoding text, out mimeType, out fileNameExtension));
            }
        }
Ejemplo n.º 6
0
 public ExecutionInfo(string executionId, string historyId, string reportPath, int numPages, bool hasDocumentMap, int autoRefreshInterval, bool credentialsRequired, bool parametersRequired, bool hasSnapshot, bool needsProcessing, DateTime expirationDateTime, bool allowQueryExecution, PageCountMode pageCountMode, ReportDataSourceInfoCollection dataSourcePrompts, ReportParameterInfoCollection parameters, ReportPageSettings pageSettings, ParametersPaneLayout parametersPaneLayout)
 {
     ExecutionID          = executionId;
     HistoryID            = historyId;
     ReportPath           = reportPath;
     NumPages             = numPages;
     HasDocumentMap       = hasDocumentMap;
     AutoRefreshInterval  = autoRefreshInterval;
     CredentialsRequired  = credentialsRequired;
     ParametersRequired   = parametersRequired;
     HasSnapshot          = hasSnapshot;
     NeedsProcessing      = needsProcessing;
     ExpirationDateTime   = expirationDateTime;
     AllowQueryExecution  = allowQueryExecution;
     PageCountMode        = pageCountMode;
     DataSourcePrompts    = dataSourcePrompts;
     Parameters           = parameters;
     ReportPageSettings   = pageSettings;
     ParametersPaneLayout = parametersPaneLayout;
 }
Ejemplo n.º 7
0
        private static ExecutionInfo FromSoapExecutionInfo(Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.ExecutionInfo soapExecutionInfo)
        {
            if (soapExecutionInfo == null)
            {
                return(null);
            }
            ReportParameterInfoCollection reportParameterInfoCollection = null;

            Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.ReportParameter[] parameters = soapExecutionInfo.Parameters;
            if (parameters != null)
            {
                ReportParameterInfo[] array = new ReportParameterInfo[parameters.Length];
                for (int i = 0; i < parameters.Length; i++)
                {
                    array[i] = SoapParameterToReportParameterInfo(parameters[i]);
                }
                reportParameterInfoCollection = new ReportParameterInfoCollection(array);
            }
            else
            {
                reportParameterInfoCollection = new ReportParameterInfoCollection();
            }
            PageCountMode  pageCountMode = PageCountMode.Actual;
            ExecutionInfo2 executionInfo = soapExecutionInfo as ExecutionInfo2;

            if (executionInfo != null && executionInfo.PageCountMode == Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.PageCountMode.Estimate)
            {
                pageCountMode = PageCountMode.Estimate;
            }
            ParametersPaneLayout parametersPaneLayout = null;
            ExecutionInfo3       executionInfo2       = soapExecutionInfo as ExecutionInfo3;

            if (executionInfo2 != null && executionInfo2.ParametersLayout != null && parameters != null)
            {
                parametersPaneLayout = new ParametersPaneLayout();
                SoapExecutionInfoToParametersLayout(parametersPaneLayout, executionInfo2, reportParameterInfoCollection);
            }
            ReportPageSettings pageSettings = new ReportPageSettings(soapExecutionInfo.ReportPageSettings.PaperSize.Height, soapExecutionInfo.ReportPageSettings.PaperSize.Width, soapExecutionInfo.ReportPageSettings.Margins.Left, soapExecutionInfo.ReportPageSettings.Margins.Right, soapExecutionInfo.ReportPageSettings.Margins.Top, soapExecutionInfo.ReportPageSettings.Margins.Bottom);

            return(new ExecutionInfo(soapExecutionInfo.ExecutionID, soapExecutionInfo.HistoryID, soapExecutionInfo.ReportPath, soapExecutionInfo.NumPages, soapExecutionInfo.HasDocumentMap, soapExecutionInfo.AutoRefreshInterval, soapExecutionInfo.CredentialsRequired, soapExecutionInfo.ParametersRequired, soapExecutionInfo.HasSnapshot, soapExecutionInfo.NeedsProcessing, soapExecutionInfo.ExpirationDateTime, soapExecutionInfo.AllowQueryExecution, pageCountMode, ReportDataSourceInfoCollection.FromSoapDataSourcePrompts(soapExecutionInfo.DataSourcePrompts), reportParameterInfoCollection, pageSettings, parametersPaneLayout));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 开始执行异步打印
        /// </summary>
        /// <param name="format"></param>
        /// <param name="allowInternalRenderers"></param>
        /// <param name="deviceInfo"></param>
        /// <param name="pageCountMode"></param>
        /// <param name="createStreamCallback"></param>
        /// <param name="onCompleteCallback"></param>
        /// <param name="isPartialRendering"></param>
        private void BeginAsyncRender(string format,
                                      bool allowInternalRenderers,
                                      string deviceInfo,
                                      PageCountMode pageCountMode,
                                      CreateAndRegisterStream createStreamCallback,
                                      AsyncCompletedEventHandler onCompleteCallback,
                                      bool isPartialRendering)
        {
            object postRenderArgs = Activator.CreateInstance(_postRenderArgsType, false, isPartialRendering);

            object operation = Activator.CreateInstance(
                _asyncAllStreamsRenderingOperationType,
                this._report, pageCountMode, format, deviceInfo,
                allowInternalRenderers,
                postRenderArgs,
                createStreamCallback);

            EventInfo eventInfo = _asyncAllStreamsRenderingOperationType.GetEvent("Completed");

            eventInfo.AddEventHandler(operation, onCompleteCallback);
            this._processingThread.BeginBackgroundOperation(operation);
        }
        public int Sort(string SortItem, SortDirectionEnum Direction, bool Clear, PageCountMode PaginationMode, out string ReportItem, out ExecutionInfo ExecutionInfo, out int NumPages)
        {
            string            rptItem       = null;
            int               nPages        = 0;
            ExecutionInfo2    execInfo      = null;
            ProxyMethod <int> initialMethod = new ProxyMethod <int>("Sort2", delegate
            {
                int result2 = Sort2(SortItem, Direction, Clear, PaginationMode, out rptItem, out execInfo);
                if (execInfo != null)
                {
                    nPages = execInfo.NumPages;
                }
                return(result2);
            });
            ProxyMethod <int> retryMethod = new ProxyMethod <int>("Sort", () => base.Sort(SortItem, Direction, Clear, out rptItem, out nPages));
            int result = ProxyMethodInvocation.Execute(this, initialMethod, retryMethod);

            ExecutionInfo = execInfo;
            NumPages      = nPages;
            ReportItem    = rptItem;
            return(result);
        }
Ejemplo n.º 10
0
        public bool HandlePageNavigation(int targetPage)
        {
            if (targetPage <= 0)
            {
                throw new ArgumentOutOfRangeException("targetPage");
            }
            PageCountMode pageCountMode = default(PageCountMode);
            int           totalPages    = this.m_report.GetTotalPages(out pageCountMode);

            if (totalPages == 0)
            {
                pageCountMode = PageCountMode.Estimate;
            }
            if (targetPage == 2147483647 && pageCountMode != PageCountMode.Estimate)
            {
                targetPage = totalPages;
            }
            if (targetPage > totalPages && pageCountMode != PageCountMode.Estimate)
            {
                throw new InvalidOperationException(Errors.InvalidPageNav);
            }
            return(this.FirePageNavigationEvent(targetPage));
        }
Ejemplo n.º 11
0
 public override byte[] Render(string format, string deviceInfo, PageCountMode pageCountMode, out string mimeType, out string encoding, out string fileNameExtension, out string[] streams, out Warning[] warnings)
 {
     return(InternalRender(format, allowInternalRenderers: false, deviceInfo, pageCountMode, out mimeType, out encoding, out fileNameExtension, out streams, out warnings));
 }
Ejemplo n.º 12
0
 internal void InternalRender(string format, bool allowInternalRenderers, string deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, out Warning[] warnings)
 {
     lock (m_syncObject)
     {
         if (createStreamCallback == null)
         {
             throw new ArgumentNullException("createStreamCallback");
         }
         if (!ValidateRenderingFormat(format))
         {
             throw new ArgumentOutOfRangeException("format");
         }
         EnsureExecutionSession();
         try
         {
             m_lastRenderingWarnings = m_processingHost.Render(format, deviceInfo, PageCountModeToProcessingPaginationMode(pageCountMode), allowInternalRenderers, m_dataSources, createStreamCallback.ToOuterType());
         }
         catch (Exception processingException)
         {
             throw WrapProcessingException(processingException);
         }
         warnings = Warning.FromProcessingMessageList(m_lastRenderingWarnings);
         WriteDebugResults(warnings);
     }
 }
Ejemplo n.º 13
0
 internal override int PerformSort(string sortId, SortOrder sortDirection, bool clearSort, PageCountMode pageCountMode, out string uniqueName)
 {
     try
     {
         lock (m_syncObject)
         {
             if (!m_processingHost.ExecutionInfo.HasSnapshot)
             {
                 throw new InvalidOperationException(CommonStrings.ReportNotReady);
             }
             SortOptions sortOptions    = (sortDirection == SortOrder.Ascending) ? SortOptions.Ascending : SortOptions.Descending;
             string      paginationMode = PageCountModeToProcessingPaginationMode(pageCountMode);
             try
             {
                 return(m_processingHost.PerformSort(paginationMode, sortId, sortOptions, clearSort, out uniqueName));
             }
             catch (Exception processingException)
             {
                 throw WrapProcessingException(processingException);
             }
         }
     }
     catch (SecurityException processingException2)
     {
         throw new LocalProcessingException(CommonStrings.LocalModeMissingFullTrustErrors, processingException2);
     }
 }
 public Render2Request(string Format, string DeviceInfo, PageCountMode PaginationMode)
 {
     this.Format         = Format;
     this.DeviceInfo     = DeviceInfo;
     this.PaginationMode = PaginationMode;
 }
Ejemplo n.º 15
0
 public abstract int GetTotalPages(out PageCountMode pageCountMode);
Ejemplo n.º 16
0
 /// <remarks/>
 public void Sort2Async(string SortItem, SortDirectionEnum Direction, bool Clear, PageCountMode PaginationMode) {
     this.Sort2Async(SortItem, Direction, Clear, PaginationMode, null);
 }
Ejemplo n.º 17
0
 public byte[] Render2(string Format, string DeviceInfo, PageCountMode PaginationMode, out string Extension, out string MimeType, out string Encoding, out Warning[] Warnings, out string[] StreamIds) {
     object[] results = this.Invoke("Render2", new object[] {
                 Format,
                 DeviceInfo,
                 PaginationMode});
     Extension = ((string)(results[1]));
     MimeType = ((string)(results[2]));
     Encoding = ((string)(results[3]));
     Warnings = ((Warning[])(results[4]));
     StreamIds = ((string[])(results[5]));
     return ((byte[])(results[0]));
 }
 public ViewerRenderer(ReportControlSession reportControlSession, AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream streamCallback, ViewerRendererDeviceInfo deviceInfo, NameValueCollection browserCaps, SecondaryStreams secondaryStreams, PageCountMode pageCountMode)
     : base(new DetachedReportWrapper(deviceInfo.RawDeviceInfo["StreamRoot"] ?? ""), new SPBProcessingStub(reportControlSession, HttpUtility.HtmlEncode(deviceInfo.RawDeviceInfo["StreamRoot"] ?? ""), pageCountMode), new NameValueCollection(), deviceInfo, deviceInfo.RawDeviceInfo, browserCaps, streamCallback, secondaryStreams)
 {
 }
Ejemplo n.º 19
0
 public abstract byte[] Render(string format, string deviceInfo, PageCountMode pageCountMode, out string mimeType, out string encoding, out string fileNameExtension, out string[] streams, out Warning[] warnings);
 public AsyncAllStreamsRenderingOperation(Report report, PageCountMode pageCountMode, string format, string deviceInfo, bool allowInternalRenderers, PostRenderArgs postRenderArgs, CreateAndRegisterStream streamCallback)
     : base(report, pageCountMode, format, deviceInfo, allowInternalRenderers, postRenderArgs)
 {
     m_streamCallback = streamCallback;
 }
Ejemplo n.º 21
0
 internal byte[] InternalRender(string format, bool allowInternalRenderers, string deviceInfo, PageCountMode pageCountMode, out string mimeType, out string encoding, out string fileNameExtension, out string[] streams, out Warning[] warnings)
 {
     lock (m_syncObject)
     {
         using (StreamCache streamCache = new StreamCache())
         {
             InternalRender(format, allowInternalRenderers, deviceInfo, pageCountMode, streamCache.StreamCallback, out warnings);
             streams = new string[0];
             return(streamCache.GetMainStream(out encoding, out mimeType, out fileNameExtension));
         }
     }
 }
 // English value: pageCount if PageCountMode.Actual, else pageCount suffixed with a ?
 public string TotalPages(int pageCount, PageCountMode pageCountMode)
 {
     return(string.Format(CultureInfo.CurrentCulture, "{0}{1}", pageCount, pageCountMode == PageCountMode.Estimate ? "~" : String.Empty));
 }
 public Sort3Request(string SortItem, SortDirectionEnum Direction, bool Clear, PageCountMode PaginationMode)
 {
     this.SortItem       = SortItem;
     this.Direction      = Direction;
     this.Clear          = Clear;
     this.PaginationMode = PaginationMode;
 }
Ejemplo n.º 24
0
        private void OnReportViewerStateChanged(object sender, EventArgs e)
        {
            ReportViewer  reportViewer  = (ReportViewer)sender;
            PageCountMode pageCountMode = PageCountMode.Actual;
            int           num           = 0;

            try
            {
                num = ViewerControl.GetTotalPages(out pageCountMode);
            }
            catch (Exception e2)
            {
                if (!ViewerControl.CurrentStatus.IsInFailedState)
                {
                    ViewerControl.UpdateUIState(e2);
                }
            }
            if (num < 1)
            {
                totalPages.Text = "";
            }
            else
            {
                totalPages.Text = LocalizationHelper.Current.TotalPages(num, pageCountMode);
            }
            ReportViewerStatus currentStatus = reportViewer.CurrentStatus;

            if (currentStatus.CanNavigatePages)
            {
                currentPage.Text = ViewerControl.CurrentPage.ToString(CultureInfo.CurrentCulture);
            }
            bool flag  = ViewerControl.CurrentPage <= 1;
            bool flag2 = ViewerControl.CurrentPage >= num && pageCountMode != PageCountMode.Estimate;

            firstPage.Enabled    = (currentStatus.CanNavigatePages && !flag);
            previousPage.Enabled = (currentStatus.CanNavigatePages && !flag);
            currentPage.Enabled  = currentStatus.CanNavigatePages;
            nextPage.Enabled     = (currentStatus.CanNavigatePages && !flag2);
            lastPage.Enabled     = (currentStatus.CanNavigatePages && !flag2);
            back.Enabled         = currentStatus.CanNavigateBack;
            stop.Enabled         = currentStatus.InCancelableOperation;
            refresh.Enabled      = currentStatus.CanRefreshData;
            print.Enabled        = currentStatus.CanPrint;
            printPreview.Enabled = currentStatus.CanChangeDisplayModes;
            printPreview.Checked = (reportViewer.DisplayMode == DisplayMode.PrintLayout);
            pageSetup.Enabled    = print.Enabled;
            export.Enabled       = currentStatus.CanExport;
            zoom.Enabled         = currentStatus.CanChangeZoom;
            textToFind.Enabled   = currentStatus.CanSearch;
            find.Enabled         = (textToFind.Enabled && !string.IsNullOrEmpty(textToFind.Text));
            findNext.Enabled     = currentStatus.CanContinueSearch;
            if (currentStatus.CanSearch && ViewerControl.SearchState != null)
            {
                textToFind.Text = ViewerControl.SearchState.Text;
            }
            bool showPageNavigationControls = reportViewer.ShowPageNavigationControls;

            firstPage.Visible           = showPageNavigationControls;
            previousPage.Visible        = showPageNavigationControls;
            currentPage.Visible         = showPageNavigationControls;
            labelOf.Visible             = showPageNavigationControls;
            totalPages.Visible          = showPageNavigationControls;
            nextPage.Visible            = showPageNavigationControls;
            lastPage.Visible            = showPageNavigationControls;
            toolStripSeparator2.Visible = showPageNavigationControls;
            back.Visible                = reportViewer.ShowBackButton;
            stop.Visible                = reportViewer.ShowStopButton;
            refresh.Visible             = reportViewer.ShowRefreshButton;
            toolStripSeparator3.Visible = (back.Visible || stop.Visible || refresh.Visible);
            print.Visible               = reportViewer.ShowPrintButton;
            printPreview.Visible        = reportViewer.ShowPrintButton;
            pageSetup.Visible           = (print.Visible || printPreview.Visible);
            export.Visible              = reportViewer.ShowExportButton;
            separator4.Visible          = (print.Visible || printPreview.Visible || export.Visible);
            zoom.Visible                = reportViewer.ShowZoomControl;
            bool showFindControls = reportViewer.ShowFindControls;

            toolStripSeparator4.Visible = showFindControls;
            find.Visible       = showFindControls;
            findNext.Visible   = showFindControls;
            textToFind.Visible = showFindControls;
            if (export.Visible && export.Enabled)
            {
                PopulateExportList();
            }
        }
        string IReportViewerMessages3.TotalPages(int pageCount, PageCountMode pageCountMode)
        {
            string builtinString = (pageCountMode != 0 && pageCount > 0) ? CommonStrings.EstimateTotalPages(pageCount) : pageCount.ToString(CultureInfo.CurrentCulture);

            return(GetLocalizedString(builtinString, (ReportViewerMessages3 != null) ? ReportViewerMessages3.TotalPages(pageCount, pageCountMode) : null));
        }
Ejemplo n.º 26
0
 internal abstract int PerformSort(string sortId, SortOrder sortDirection, bool clearSort, PageCountMode pageCountMode, out string uniqueName);
 public SPBProcessingStub(ReportControlSession reportControlSession, string streamRoot, PageCountMode pageCountMode)
 {
     this.m_reportControlSession               = reportControlSession;
     this.m_pageCountMode                      = pageCountMode;
     this.m_spbContext.StartPage               = 1;
     this.m_spbContext.EndPage                 = 1;
     this.m_spbContext.MeasureItems            = false;
     this.m_spbContext.AddToggledItems         = false;
     this.m_spbContext.SecondaryStreams        = SecondaryStreams.Server;
     this.m_spbContext.AddSecondaryStreamNames = true;
     this.m_spbContext.UseImageConsolidation   = true;
     this.m_streamRoot = streamRoot;
 }
Ejemplo n.º 28
0
 private static Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.PageCountMode SoapPageCountFromViewerAPI(PageCountMode pageCountMode)
 {
     if (pageCountMode == PageCountMode.Actual)
     {
         return(Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.PageCountMode.Actual);
     }
     return(Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.PageCountMode.Estimate);
 }
Ejemplo n.º 29
0
 /// <remarks/>
 public void Render2Async(string Format, string DeviceInfo, PageCountMode PaginationMode, object userState) {
     if ((this.Render2OperationCompleted == null)) {
         this.Render2OperationCompleted = new System.Threading.SendOrPostCallback(this.OnRender2OperationCompleted);
     }
     this.InvokeAsync("Render2", new object[] {
                 Format,
                 DeviceInfo,
                 PaginationMode}, this.Render2OperationCompleted, userState);
 }
Ejemplo n.º 30
0
        public int GetTotalPages()
        {
            PageCountMode pageCountMode = default(PageCountMode);

            return(this.GetTotalPages(out pageCountMode));
        }
Ejemplo n.º 31
0
 public int Sort2(string SortItem, SortDirectionEnum Direction, bool Clear, PageCountMode PaginationMode, out string ReportItem, out ExecutionInfo2 ExecutionInfo) {
     object[] results = this.Invoke("Sort2", new object[] {
                 SortItem,
                 Direction,
                 Clear,
                 PaginationMode});
     ReportItem = ((string)(results[1]));
     ExecutionInfo = ((ExecutionInfo2)(results[2]));
     return ((int)(results[0]));
 }
 /// <remarks/>
 public System.IAsyncResult BeginSort2(string SortItem, SortDirectionEnum Direction, bool Clear, PageCountMode PaginationMode, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("Sort2", new object[] {
                 SortItem,
                 Direction,
                 Clear,
                 PaginationMode}, callback, asyncState);
 }
Ejemplo n.º 33
0
 /// <remarks/>
 public void Sort2Async(string SortItem, SortDirectionEnum Direction, bool Clear, PageCountMode PaginationMode, object userState) {
     if ((this.Sort2OperationCompleted == null)) {
         this.Sort2OperationCompleted = new System.Threading.SendOrPostCallback(this.OnSort2OperationCompleted);
     }
     this.InvokeAsync("Sort2", new object[] {
                 SortItem,
                 Direction,
                 Clear,
                 PaginationMode}, this.Sort2OperationCompleted, userState);
 }
Ejemplo n.º 34
0
        public int RenderReport(ReportControlSession session, string viewerInstanceIdentifier, PageCountMode pageCountMode, int pageNumber, InteractivityPostBackMode interactivityMode, string searchState, string replacementRoot, string hyperlinkTarget, string alertMessage, DeviceInfoCollection initialDeviceInfos, string browserMode, bool sizeToContent)
        {
            if (this.m_reportStream != null)
            {
                throw new InvalidOperationException();
            }
            this.m_session = session;
            this.ViewIteration++;
            this.m_pageNumber = pageNumber;

            this.m_viewerInstanceIdentifier = viewerInstanceIdentifier;
            this.m_alertMessage             = alertMessage;
            this.m_interactivityMode        = interactivityMode;
            bool useImageConsolidation     = !sizeToContent;
            NameValueCollection deviceInfo = this.CreateDeviceInfo(initialDeviceInfos, session.Report, pageNumber, searchState, replacementRoot, hyperlinkTarget, browserMode, useImageConsolidation, this.EnableHybrid);

            this.m_reportStream        = session.RenderReportHTML(deviceInfo, pageCountMode, out this.m_scrollScript, out this.m_pageStyles);
            this.m_autoRefreshInterval = session.Report.AutoRefreshInterval;
            int totalPages = session.Report.GetTotalPages();

            if (this.m_pageNumber > totalPages)
            {
                this.m_pageNumber = totalPages;
            }
            this.m_autoRefreshInterval = session.Report.AutoRefreshInterval;
            if (sizeToContent)
            {
                this.m_scrollScript = null;
            }
            string styleStreamName = LocalHtmlRenderer.GetStyleStreamName(pageNumber);
            string text            = default(string);

            byte[] streamImage = session.GetStreamImage(styleStreamName, (string)null, out text);
            this.m_styleBytesString = null;
            if (streamImage != null && streamImage.Length > 0)
            {
                Encoding encoding = new UTF8Encoding(false);
                this.m_styleBytesString = encoding.GetString(streamImage);
            }
            return(this.m_pageNumber);
        }
Ejemplo n.º 35
0
 /// <remarks/>
 public void Render2Async(string Format, string DeviceInfo, PageCountMode PaginationMode) {
     this.Render2Async(Format, DeviceInfo, PaginationMode, null);
 }
Ejemplo n.º 36
0
 public AsyncMainStreamRenderingOperation(Report report, PageCountMode pageCountMode, string format, string deviceInfo, bool allowInternalRenderers, PostRenderArgs postRenderArgs)
     : base(report, pageCountMode, format, deviceInfo, allowInternalRenderers, postRenderArgs)
 {
 }
Ejemplo n.º 37
0
        /// <summary>
        /// Renders the report via SOAP
        /// </summary>
        /// <returns></returns>
        private string GetReportContent(bool toolbar)
        {
            ReportService20051.ReportingService2005 rs;
            ReportExecutionService rsExec;

            byte[] content;
            string html;

            //In argements
            string format;
            string deviceInfo;
            //ReportExecutionService2005.ReportParameter[] _parameters = null;
            //string _report = null;
            string _historyID = null;
            //bool _forRendering = false;
            //ReportExecutionService2005.ParameterValue[] _values = null;
            //ReportExecutionService2005.DataSourceCredentials[] _credentials = null;

            //Out arguments
            string encoding;
            string mimeType;

            //ReportExecutionService2005.ParameterValue[] parametersUsed = null;
            string[] streamIDs = null;
            ReportExecution20051.Warning[] warnings = null;
            string extension = null;

            //1 Get input arguments
            //Always using HTML 4.0 format if toolbar is required, this is used for retrieving the page count
            if (toolbar)
            {
                format = "HTML4.0";
            }
            else
            {
                format = this.Format;
            }

            // Set html device information
            deviceInfo = this.GetHTMLDeviceInfo(toolbar);


            //2. Get reporting web service
            rs     = Util.GetReportingService(this.SessionID);
            rsExec = Util.GetReportExecutionService(this.SessionID);
            //rsExec.Credentials =  System.Net.CredentialCache.DefaultCredentials;


            //3 Call render web service

//            content = rsExec.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);



            ReportExecution20051.ExecutionInfo ei = new ExecutionInfo();

            // Load the selected report.
            try
            {
                ei = rsExec.LoadReport(this.Settings.ReportFolder + this.ReportPath, _historyID);
            }

            catch (Exception ex)
            {
                throw ex;
            }

            PageCountMode Exact = new PageCountMode();

            Exact = PageCountMode.Actual;


            rsExec.SetExecutionParameters(this.ParameterValues, "en-us");
            rsExec.Timeout = System.Threading.Timeout.Infinite;
            content        = rsExec.Render2(format, deviceInfo, Exact, out extension, out mimeType, out encoding, out warnings, out streamIDs);
            ei             = rsExec.GetExecutionInfo();
            this.PageCount = ei.NumPages;

            //content = rsExec.Render(this.Format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);

            // Create a file stream and write the report to it
            //            using (FileStream stream = File.OpenWrite(fileName))
            //{
            //                stream.Write(results, 0, results.Length);
            //}



            if (!toolbar)
            {
                html = Encoding.UTF8.GetString(content);
            }
            else
            {
                html = "";
            }

            //4. Save session value

            //Save the sessionID for later use
            //this.SessionID = ei.ExecutionID;
            this.SessionID = rsExec.ExecutionHeaderValue.ExecutionID;

            return(html);
        }
 /// <remarks/>
 public System.IAsyncResult BeginRender2(string Format, string DeviceInfo, PageCountMode PaginationMode, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("Render2", new object[] {
                 Format,
                 DeviceInfo,
                 PaginationMode}, callback, asyncState);
 }