1

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

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)
4

2 回答 2

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>
    

    to(并删除与 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

祝格伦好运

于 2012-07-27T04:09:43.853 回答
0

根据这篇文章在 SQL Reporting Services 中使用 URL 传递参数和选项,您做得对。

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

错误

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

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

于 2012-05-04T11:51:21.660 回答