Пример #1
0
        public void AddParameters(NameValueCollection urlParameters, UrlParameterType parameterType)
        {
            switch (parameterType)
            {
            case UrlParameterType.RenderingParameter:
                m_catalogItemUrlBuilder.AppendRenderingParameters(urlParameters);
                break;

            case UrlParameterType.ReportParameter:
                m_catalogItemUrlBuilder.AppendReportParameters(urlParameters);
                break;

            case UrlParameterType.ServerParameter:
                m_catalogItemUrlBuilder.AppendCatalogParameters(urlParameters);
                break;
            }
        }
        private CatalogItemUrlBuilder BaseBookmarkSortUrl(bool isSort)
        {
            string reportUrl = m_report.GetReportUrl(addParams: false);
            CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(reportUrl);

            if (isSort)
            {
                string value = m_serverParams["Command"];
                m_serverParams["Command"] = "Sort";
                catalogItemUrlBuilder.AppendCatalogParameters(m_serverParams);
                m_serverParams["Command"] = value;
            }
            else
            {
                catalogItemUrlBuilder.AppendCatalogParameters(m_serverParams);
            }
            catalogItemUrlBuilder.AppendRenderingParameters(m_rawDeviceInfo);
            return(catalogItemUrlBuilder);
        }
        private void RenderHead()
        {
            string text = null;

            if (m_mainStream != null)
            {
                m_mainStream.Flush();
            }
            if (!m_htmlFragment)
            {
                if (m_rplReport.Location != null)
                {
                    text = m_rplReport.Location;
                    if (text.Length > 0)
                    {
                        WriteStream("<META HTTP-EQUIV=\"Location\" CONTENT=\"");
                        WriteAttrEncoded(text);
                        WriteStream(HTMLElements.m_closeTag);
                        WriteStream("<META HTTP-EQUIV=\"Uri\" CONTENT=\"");
                        WriteAttrEncoded(text);
                        WriteStream(HTMLElements.m_closeTag);
                    }
                }
                string description = m_rplReport.Description;
                if (description != null && 0 < description.Length)
                {
                    text = description;
                    WriteStream("<META NAME=\"Description\" CONTENT=\"");
                    WriteAttrEncoded(text);
                    WriteStream(HTMLElements.m_closeTag);
                }
                string author = m_rplReport.Author;
                if (author != null && 0 < author.Length)
                {
                    text = author;
                    WriteStream("<META NAME=\"Author\" CONTENT=\"");
                    WriteAttrEncoded(text);
                    WriteStream(HTMLElements.m_closeTag);
                }
                int autoRefresh = m_rplReport.AutoRefresh;
                if (0 < autoRefresh)
                {
                    WriteStream("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"");
                    WriteStream(autoRefresh.ToString(CultureInfo.InvariantCulture));
                    WriteStream(";url=");
                    string reportUrl = m_report.GetReportUrl(addParams: false);
                    CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(reportUrl);
                    catalogItemUrlBuilder.AppendCatalogParameter("ResetSession", "True");
                    if (m_serverParams["SessionID"] != null)
                    {
                        catalogItemUrlBuilder.AppendCatalogParameter("SessionID", m_serverParams["SessionID"]);
                    }
                    catalogItemUrlBuilder.AppendRenderingParameters(m_rawDeviceInfo);
                    if (m_allPages)
                    {
                        catalogItemUrlBuilder.AppendRenderingParameter("Section", "0");
                    }
                    else
                    {
                        catalogItemUrlBuilder.AppendRenderingParameter("Section", m_pageNum.ToString(CultureInfo.InvariantCulture));
                    }
                    if (m_deviceInfo.HtmlPrefixId != null && m_deviceInfo.HtmlPrefixId.Length > 0)
                    {
                        catalogItemUrlBuilder.AppendRenderingParameter("PrefixId", m_deviceInfo.HtmlPrefixId);
                    }
                    WriteAttrEncoded(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri));
                    WriteStream(HTMLElements.m_closeQuote);
                }
                WriteStream("<META HTTP-EQUIV=\"Last-Modified\" CONTENT=\"");
                WriteStream(m_rplReport.ExecutionTime.ToUniversalTime().ToString(CultureInfo.InvariantCulture));
                WriteStream(HTMLElements.m_closeQuote);
                if (m_parameters != null)
                {
                    object obj = null;
                    foreach (ReportParameter parameter in m_parameters)
                    {
                        if (parameter.Name != null && parameter.Instance != null)
                        {
                            WriteStream("<META NAME=\"");
                            WriteAttrEncoded(parameter.Name);
                            WriteStream("\" CONTENT=\"");
                            obj = parameter.Instance.Value;
                            if (obj != null)
                            {
                                WriteAttrEncoded(obj.ToString());
                            }
                            WriteStream(HTMLElements.m_closeQuote);
                        }
                    }
                }
                WriteStream("<META NAME=\"Generator\" CONTENT=\"Microsoft Report 8.0 \"/>");
                WriteStream("<META NAME=\"Originator\" CONTENT=\"Microsoft Report 8.0 \"/>");
                WriteStyle(HTMLRendererResources.GetBytes("jqueryui.min.css"));
                WriteStyle(HTMLRendererResources.GetBytes("Html5Renderer.css"));
                WriteScript(HTMLRendererResources.GetBytes("jquery.min.js"));
                WriteScript(HTMLRendererResources.GetBytes("Html5Renderer.js"));
                WriteScript(HTMLRendererResources.GetBytes("Html5RenderingExtensionJs.js"));
            }
            RenderHTMLHead();
        }
        protected internal override void RenderToggleImage(RPLTextBoxProps textBoxProps)
        {
            bool toggleState = textBoxProps.ToggleState;
            RPLTextBoxPropsDef rPLTextBoxPropsDef = (RPLTextBoxPropsDef)textBoxProps.Definition;

            if (!textBoxProps.IsToggleParent)
            {
                return;
            }
            WriteStream(HTMLElements.m_openA);
            WriteStream(HTMLElements.m_tabIndex);
            WriteStream(++m_tabIndexNum);
            WriteStream(HTMLElements.m_quote);
            if (m_deviceInfo.HasActionScript)
            {
                WriteStream(HTMLElements.m_openStyle);
                WriteStream(HTMLElements.m_cursorHand);
                WriteStream(HTMLElements.m_semiColon);
                WriteStream(HTMLElements.m_quote);
                RenderOnClickActionScript("Toggle", textBoxProps.UniqueName);
                WriteStream(HTMLElements.m_closeBracket);
            }
            else
            {
                string reportUrl = m_report.GetReportUrl(addParams: false);
                CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(reportUrl);
                catalogItemUrlBuilder.AppendRenderingParameters(m_rawDeviceInfo);
                if (m_allPages)
                {
                    catalogItemUrlBuilder.AppendRenderingParameter("Section", "0");
                }
                else
                {
                    catalogItemUrlBuilder.AppendRenderingParameter("Section", m_pageNum.ToString(CultureInfo.InvariantCulture));
                }
                if (m_deviceInfo.HtmlPrefixId != null && m_deviceInfo.HtmlPrefixId.Length > 0)
                {
                    catalogItemUrlBuilder.AppendRenderingParameter("PrefixId", m_deviceInfo.HtmlPrefixId);
                }
                m_serverParams["ShowHideToggle"] = textBoxProps.UniqueName;
                catalogItemUrlBuilder.AppendCatalogParameters(m_serverParams);
                WriteStream(HTMLElements.m_hrefString + HttpUtility.HtmlAttributeEncode(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri)) + HTMLElements.m_closeQuoteString);
            }
            WriteStream(HTMLElements.m_img);
            if (m_browserIE)
            {
                WriteStream(HTMLElements.m_imgOnError);
            }
            WriteStream(HTMLElements.m_zeroBorder);
            WriteStream(HTMLElements.m_src);
            RenderInternalImageSrc();
            if (toggleState)
            {
                WriteStream(m_report.GetImageName("ToggleMinus.gif"));
            }
            else
            {
                WriteStream(m_report.GetImageName("TogglePlus.gif"));
            }
            WriteStream(HTMLElements.m_quote);
            WriteStream(HTMLElements.m_alt);
            if (toggleState)
            {
                WriteStream(RenderRes.ToggleStateCollapse);
            }
            else
            {
                WriteStream(RenderRes.ToggleStateExpand);
            }
            WriteStream(HTMLElements.m_closeTag);
            WriteStream(HTMLElements.m_closeA);
            if (!string.IsNullOrEmpty(textBoxProps.Value) || (rPLTextBoxPropsDef != null && !string.IsNullOrEmpty(rPLTextBoxPropsDef.Value)))
            {
                WriteStream(HTMLElements.m_nbsp);
            }
        }