隐藏CRM 2011中的SSRS参数

时间:2012-05-02 13:49:44

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

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

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添加到网址时,我会收到错误,如下图所示

有人可以告诉我如何解决这个问题


下面是日志文件的内容:

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)

2 个答案:

答案 0 :(得分:1)

Sample of working

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

  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:工具栏

  5. 祝你好运 格伦

答案 1 :(得分:0)

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

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

Error

要了解发生了什么,我建议您使用跟踪,请参阅此帖子CrmDiagTool 2011,此工具可以更轻松地使用它。 我的猜测是你需要以某种方式使这些参数可选。

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

相关问题