public static TextWriter CreateWriter(string streamName, string mimeType, AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream createStreamCallback, AspNetCore.ReportingServices.Interfaces.StreamOper streamOper)
        {
            Stream stream = LocalHtmlRenderer.CreateHTMLStream(streamName, mimeType, createStreamCallback, streamOper);

            TextWriter textWriter = new StreamWriter(stream, new UTF8Encoding(false));

            textWriter.NewLine = null;
            return(textWriter);
        }
 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)
 {
 }
Пример #3
0
 public override ProcessingContext CreateProcessingContext(PreviewItemContext itemContext, ParameterInfoCollection parameters, IEnumerable dataSources, RuntimeDataSourceInfoCollection dataSourceInfoColl, RuntimeDataSetInfoCollection dataSetInfoColl, SharedDataSetCompiler sharedDataSetCompiler, DatasourceCredentialsCollection credentials, ReportProcessing.OnDemandSubReportCallback subReportCallback, IGetResource getResourceFunction, IChunkFactory chunkFactory, ReportRuntimeSetup runtimeSetup, AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream createStreamCallback)
 {
     return(new ProcessingContextForDataSets(itemContext, parameters, new DataSourceCollectionWrapper((ReportDataSourceCollection)dataSources), subReportCallback, this.m_subreportDataCallback, getResourceFunction, chunkFactory, runtimeSetup, (AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream)createStreamCallback));
 }
        public static void Render(NameValueCollection deviceInfo, PageCountMode pageCountMode, ReportControlSession reportControlSession, AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream streamCallback, out string scrollScript, out string pageStyle)
        {
            TextWriter htmlTextWriter = null;

            try
            {
                deviceInfo.Add("OnlyVisibleStyles", "True");
                htmlTextWriter = LocalHtmlRenderer.CreateWriter(reportControlSession.Report.DisplayNameForUse, "text/html", streamCallback, AspNetCore.ReportingServices.Interfaces.StreamOper.CreateAndRegister);
                NameValueCollection      browserCaps = new NameValueCollection();
                ViewerRendererDeviceInfo viewerRendererDeviceInfo = new ViewerRendererDeviceInfo();
                viewerRendererDeviceInfo.ParseDeviceInfo(deviceInfo, new NameValueCollection());
                HTML5ViewerRenderer hTML5ViewerRenderer = new HTML5ViewerRenderer(reportControlSession, streamCallback, viewerRendererDeviceInfo, browserCaps, SecondaryStreams.Server, pageCountMode, null);
                hTML5ViewerRenderer.Render(htmlTextWriter);
                scrollScript = hTML5ViewerRenderer.FixedHeaderScript;
                //var stream=(streamCallback.Target as StreamCache).GetMainStream(true);
                //System.IO.StreamReader sr = new StreamReader(stream);
                //var html=sr.ReadToEnd();
                pageStyle = hTML5ViewerRenderer.PageStyle;
            }
            catch (LocalProcessingException)
            {
                throw;
            }
            catch (Exception renderingException)
            {
                throw renderingException;
            }
            finally
            {
                if (htmlTextWriter != null)
                {
                    htmlTextWriter.Flush();
                }
            }
        }
 public static Stream CreateHTMLStream(string streamName, string mimeType, AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream createStreamCallback, AspNetCore.ReportingServices.Interfaces.StreamOper streamOper)
 {
     return(createStreamCallback(streamName, "html", Encoding.UTF8, mimeType, false, streamOper));
 }
 public ProcessingContextForDataSets(PreviewItemContext reportContext, ParameterInfoCollection parameters, IEnumerable dataSources, ReportProcessing.OnDemandSubReportCallback subReportCallback, LocalDataRetrievalFromDataSet.GetSubReportDataSetCallback subReportInfoCallback, IGetResource getResourceFunction, IChunkFactory chunkFactory, ReportRuntimeSetup reportRuntimeSetup, AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream createStreamCallback)
     : base(reportContext, WindowsIdentity.GetCurrent().Name, parameters, subReportCallback, getResourceFunction, chunkFactory, ReportProcessing.ExecutionType.Live, Thread.CurrentThread.CurrentCulture, UserProfileState.Both, UserProfileState.None, reportRuntimeSetup, createStreamCallback, false, new ViewerJobContextImpl(), new ViewerExtensionFactory(), DataProtectionLocal.Instance)
 {
     this.m_dataSources           = dataSources;
     this.m_subReportInfoCallback = subReportInfoCallback;
 }
Пример #7
0
 public static AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream ToInnerType(this AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream callback)
 {
     return((string name, string extension, Encoding encoding, string mimeType, bool willSeek, AspNetCore.ReportingServices.Interfaces.StreamOper operation) => callback(name, extension, encoding, mimeType, willSeek, (StreamOper)operation));
 }