private void RenderBookmarkHref(RPLAction action)
        {
            string bookmarkLink = action.BookmarkLink;
            string text         = null;
            string text2        = string.Empty;

            if (m_deviceInfo.Section == 0)
            {
                if (m_globalBookmarks != null && m_globalBookmarks.ContainsKey(bookmarkLink))
                {
                    text = m_globalBookmarks[bookmarkLink];
                }
            }
            else if (m_pageBookmarks != null && m_pageBookmarks.ContainsKey(bookmarkLink))
            {
                text = m_pageBookmarks[bookmarkLink];
            }
            else if (m_globalBookmarks != null && m_globalBookmarks.ContainsKey(bookmarkLink))
            {
                text = m_globalBookmarks[bookmarkLink];
                CatalogItemUrlBuilder catalogItemUrlBuilder = BaseBookmarkSortUrl(isSort: false);
                catalogItemUrlBuilder.AppendRenderingParameter("BookmarkId", bookmarkLink);
                text2 = HttpUtility.HtmlAttributeEncode(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri));
            }
            if (text != null)
            {
                WriteStream(HTMLElements.m_hrefString + text2 + "#" + m_deviceInfo.HtmlPrefixId + text + HTMLElements.m_quoteString);
            }
        }
 protected override void RenderInteractionAction(RPLAction action, ref bool hasHref)
 {
     if (m_deviceInfo.HasActionScript)
     {
         RenderControlActionScript(action);
         WriteStream(HTMLElements.m_href);
         WriteStream(HTMLElements.m_quote);
         OpenStyle();
         WriteStream(HTMLElements.m_cursorHand);
         WriteStream(HTMLElements.m_semiColon);
         hasHref = true;
     }
     else if (action.DrillthroughUrl != null)
     {
         string replacementRoot = m_deviceInfo.ReplacementRoot;
         CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(action.DrillthroughUrl);
         catalogItemUrlBuilder.AppendRenderingParameter("Parameters", "Collapsed");
         if (m_rawDeviceInfo["DocMap"] != null)
         {
             catalogItemUrlBuilder.AppendRenderingParameter("DocMap", m_rawDeviceInfo["DocMap"].ToString(CultureInfo.InvariantCulture));
         }
         if (replacementRoot == null)
         {
             if (!m_isMHTML)
             {
                 catalogItemUrlBuilder.AppendRenderingParameter("Toolbar", "False");
             }
             if (m_deviceInfo.HasActionScript)
             {
                 catalogItemUrlBuilder.AppendRenderingParameter("ActionScript", m_deviceInfo.ActionScript);
             }
             if (m_deviceInfo.HtmlPrefixId != null && m_deviceInfo.HtmlPrefixId.Length > 0)
             {
                 catalogItemUrlBuilder.AppendRenderingParameter("PrefixId", m_deviceInfo.HtmlPrefixId);
             }
             WriteStream(HTMLElements.m_hrefString + catalogItemUrlBuilder.ToString() + HTMLElements.m_quoteString);
         }
         else
         {
             WriteStream(HTMLElements.m_hrefString + HttpUtility.HtmlAttributeEncode(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri)) + HTMLElements.m_quoteString);
         }
         hasHref = true;
     }
     else if (action.BookmarkLink != null)
     {
         if (HasInteractiveScript && m_deviceInfo.AllowScript && m_deviceInfo.Section > 0)
         {
             WriteStream(HTMLElements.m_href);
             WriteStream(HTMLElements.m_quote);
             RenderBookmarkOnClick(action.BookmarkLink);
         }
         else
         {
             RenderBookmarkHref(action);
             hasHref = true;
         }
     }
 }
        private string BuildAbsoluteBookmarkOrSortBaseUrl(bool isSort)
        {
            CatalogItemUrlBuilder catalogItemUrlBuilder = BaseBookmarkSortUrl(isSort);

            if (isSort)
            {
                catalogItemUrlBuilder.AppendCatalogParameter("SortId", string.Empty);
            }
            return(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri));
        }
        internal static string BuildDrillthroughUrl(ICatalogItemContext currentCatalogItemContext, string initialUrl, NameValueCollection parameters)
        {
            if (BuildPathUri(currentCatalogItemContext, checkProtocol: true, initialUrl, parameters, out ICatalogItemContext newContext) == null || newContext == null)
            {
                return(null);
            }
            CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(newContext, newContext.RSRequestParameters);

            catalogItemUrlBuilder.AppendReportParameters(parameters);
            return(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri);
        }
Beispiel #5
0
        public static string BuildDrillthroughUrl(ICatalogItemContext currentCatalogItemContext, string initialUrl, NameValueCollection parameters)
        {
            ICatalogItemContext catalogItemContext = default(ICatalogItemContext);
            string text = ReportUrl.BuildPathUri(currentCatalogItemContext, true, initialUrl, parameters, out catalogItemContext);

            if (text != null && catalogItemContext != null)
            {
                CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(catalogItemContext, catalogItemContext.RSRequestParameters);
                catalogItemUrlBuilder.AppendReportParameters(parameters);
                Uri uri = new Uri(catalogItemUrlBuilder.ToString());
                return(uri.AbsoluteUri);
            }
            return(null);
        }
Beispiel #6
0
        public string GetReportUrl(bool addReportParameters)
        {
            if (m_isOldSnapshot)
            {
                return(new ReportUrlBuilder(m_renderReport.RenderingContext, null, useReplacementRoot: true, addReportParameters).ToString());
            }
            CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(m_renderingContext.OdpContext.ReportContext);

            if (addReportParameters && Parameters != null)
            {
                NameValueCollection toNameValueCollection = Parameters.ToNameValueCollection;
                catalogItemUrlBuilder.AppendReportParameters(toNameValueCollection);
            }
            return(catalogItemUrlBuilder.ToString());
        }
        public string GetReportUrl(bool addReportParameters)
        {
            if (this.m_isOldSnapshot)
            {
                return(new ReportUrlBuilder(this.m_renderReport.RenderingContext, null, true, addReportParameters).ToString());
            }
            ICatalogItemContext   reportContext         = this.m_renderingContext.OdpContext.ReportContext;
            CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(reportContext);

            if (addReportParameters && this.Parameters != null)
            {
                NameValueCollection toNameValueCollection = this.Parameters.ToNameValueCollection;
                catalogItemUrlBuilder.AppendReportParameters(toNameValueCollection);
            }
            return(catalogItemUrlBuilder.ToString());
        }
        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);
            }
        }
        protected internal override void RenderSortAction(RPLTextBoxProps textBoxProps, RPLFormat.SortOptions sortState)
        {
            if (m_deviceInfo.AllowScript)
            {
                RenderSortOnClick(textBoxProps, sortState);
                WriteStream(HTMLElements.m_closeBracket);
                return;
            }
            CatalogItemUrlBuilder catalogItemUrlBuilder = BaseBookmarkSortUrl(isSort: true);

            catalogItemUrlBuilder.AppendCatalogParameter("SortId", textBoxProps.UniqueName);
            if (sortState == RPLFormat.SortOptions.Descending || sortState == RPLFormat.SortOptions.None)
            {
                catalogItemUrlBuilder.AppendCatalogParameter("SortDirection", "Ascending");
            }
            else
            {
                catalogItemUrlBuilder.AppendCatalogParameter("SortDirection", "Descending");
            }
            catalogItemUrlBuilder.AppendCatalogParameter("ClearSort", "TRUE");
            WriteStream(HTMLElements.m_hrefString + HttpUtility.HtmlAttributeEncode(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri)) + HTMLElements.m_closeQuoteString);
        }
Beispiel #11
0
 public override string ToString()
 {
     return(m_catalogItemUrlBuilder.ToString());
 }