【问题标题】:Hide SSRS parameters in CRM 2011在 CRM 2011 中隐藏 SSRS 参数
【发布时间】:2012-05-12 00:11:55
【问题描述】:

我以不同的方式描述我的问题, 我可以使用以下代码打开报告

var url="/"+orgname+"/crmreports/viewer/viewer.aspx?action=run&helpID=OppClients.rdl&id=%7bC7D34446-7F90-E111-A8F3-080027EA7FF9%7d&p:nomclient=aziza boulabyar";

window.open(url, "", "height=" + (screen.availHeight * .75)
     + ",width=" + (screen.availWidth * .75)
     + ",toolbar=no,menubar=no,scrollbars=no,resizable=yes,location=0");

现在我想在报告中隐藏参数,当我将&rc:parameters=false 添加到 url 时,我收到如下图所示的错误

谁能告诉我如何解决这个问题


日志文件内容如下:

at ErrorInformation.LogError()
at ErrorInformation..ctor(Exception exception, Uri requestUrl, Boolean logError)
at MainApplication.Application_Error(Object sender, EventArgs eventArguments)
at EventHandler.Invoke(Object sender, EventArgs e)
at HttpApplication.RaiseOnError()
at ApplicationStepManager.ResumeSteps(Exception error)
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
>MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Une exception de type 'System.Web.HttpUnhandledException' a été levée.
Error Message: CRM Parameter Filter - Invalid parameter 'rc:parameters=false' in Request.QueryString on page /Manhattan/crmreports/viewer/viewer.aspx
The raw request was 'GET /Manhattan/crmreports/viewer/viewer.aspx?action=run&helpID=OppClients.rdl&id=%7bC7D34446-7F90-E111-A8F3-080027EA7FF9%7d&rc:parameters=false&p:nomclient=aziza%20boulabyar' called from .
Error Details: Une exception de type 'System.Web.HttpUnhandledException' a été levée.
Source File: Not available
Line Number: Not available
Request URL: http://localhost:5555/Manhattan/crmreports/viewer/viewer.aspx?action=run&helpID=OppClients.rdl&id=%7bC7D34446-7F90-E111-A8F3-080027EA7FF9%7d&rc:parameters=false&p:nomclient=aziza%20boulabyar
Stack Trace Info: [InvalidOperationException: CRM Parameter Filter - Invalid parameter 'rc:parameters=false' in Request.QueryString on page /Manhattan/crmreports/viewer/viewer.aspx
The raw request was 'GET /Manhattan/crmreports/viewer/viewer.aspx?action=run&helpID=OppClients.rdl&id=%7bC7D34446-7F90-E111-A8F3-080027EA7FF9%7d&rc:parameters=false&p:nomclient=aziza%20boulabyar' called from .]
à Microsoft.Crm.Application.ParameterFilter.ValidateParameter(HttpRequest request, ArrayList parameterCollection, String key, String value, ParameterSources source, EntityType pageEntityType, FormAdditionalAllowedParameters additionalAllowedParameters)
à Microsoft.Crm.Application.ParameterFilter.ValidateParameters(Page page, EntityType pageEntityType, Boolean alwaysEnableParameterChecking, FormAdditionalAllowedParameters formAdditionalAllowedParametersTemp)
à Microsoft.Crm.Application.ParameterFilter.ValidateParameters(Page page, EntityType pageEntityType, Boolean alwaysEnableParameterChecking)
à Microsoft.Crm.Application.Controls.AppPage.ValidatePageParameters()
à Microsoft.Crm.Application.Controls.AppPage.OnInit(EventArgs e)
à System.Web.UI.Control.InitRecursive(Control namingContainer)
à System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException: Une exception de type 'System.Web.HttpUnhandledException' a été levée.]
à System.Web.UI.Page.HandleError(Exception e)
à System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
à System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
à System.Web.UI.Page.ProcessRequest()
à System.Web.UI.Page.ProcessRequest(HttpContext context)
à System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
à System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

【问题讨论】:

  • 没有附图片 - 你能详细说明错误吗?

标签: reporting-services hide dynamics-crm-2011


【解决方案1】:

我的解决方案涉及多个步骤,大部分不受支持 - 但它有效。

  1. 将现有的 C:\Program Files\Microsoft Dynamics CRM\CRMWeb\CRMReports\viewer\viewer.aspx 克隆到 .\viewerNoToolbar.aspx

  2. 在 viewerNoToolbar.aspx 中更新以下代码以从 SSRS 中删除工具栏:-

    function reportLoaded()
    {
    
    if (oFrame.readyState === "complete")
    {
        addToRecent();
    }
    

    function reportLoaded()
    {
    
    if (oFrame.readyState === "complete")
    {
        addToRecent();
        var frameDoc = oFrame.contentDocument || oFrame.contentWindow.document; 
        var reportViewerToolbar = frameDoc.getElementById("reportViewer_Toolbar");
        reportViewerToolbar.style.display = "none";
    }
    
  3. 插入 DIV 以隐藏现有 CRM 工具栏并将现有 resultFrame IFrame 移出 DIV

    </div>
    <table cellspacing="0" cellpadding="0" width="100%" height="100%">
    

    </div>
    <div style="display: none">
        <table cellspacing="0" cellpadding="0" width="100%" height="100%">
    

    也可以通过更改以下内容来关闭它

         </table>
     </body>
    

    到(并删除与resultFrame相关的现有td块)

            </table>
        </div>
        <table cellspacing="0" cellpadding="0" width="100%" height="100%">
            <tr style="height: 100%;">
                <td colspan="2" style="padding-top: 5px; padding-bottom: 10px; border-width: 2px;
                    border-color: #000000">
                    <div id="divResultFrame">
                        <iframe name="resultFrame" id="resultFrame" src="/_static/blank.htm" style="border: 0px;
                            margin: 0px; padding: 0px; width: 100%; height: 100%;"></iframe>
                    </div>
                </td>
            </tr>
        </table>
    </body>
    
  4. 将您的查询更改为

    var url="/"+orgname+"/crmreports/viewer/viewerNoToolBar.aspx? 
    

    不用担心 rc:Toolbar

祝你好运 格伦

【讨论】:

    【解决方案2】:

    根据这篇文章Pass parameters and options with a URL in SQL Reporting Services,你做得对。

    但是当我尝试做同样的事情时,我得到了这个错误,完全没有说明。

    要查看发生了什么,我建议您使用跟踪,请参阅此帖子 CrmDiagTool 2011,此工具将使使用它变得更加容易。 我的猜测是您需要以某种方式将这些参数设为可选。

    抱歉,没时间深入研究。 如果你在几天内没有解决它,请告诉我我们会解决的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-04
      • 1970-01-01
      相关资源
      最近更新 更多