Javascript ReportViewer 15.0.0重新记录:Sys.ArgumentNullException:值不能为null。参数名称:元素

Javascript ReportViewer 15.0.0重新记录:Sys.ArgumentNullException:值不能为null。参数名称:元素,javascript,webforms,reportviewer,Javascript,Webforms,Reportviewer,我在使用MS ReportViewer呈现报告(具有特定参数集)时遇到以下问题。从内部ReportViewer JS代码调用的JS失败,特别是“ScriptResource.axd”的这一部分: 这将破坏呈现的报告。我不知道如何进一步追踪,我知道可以使用不同的参数格式化报告,但我不明白如何调试ReportViewer库内部的小型JS 这种JS故障是某些报告的已知问题吗?我正在运行库的最新版本(15.0.0)。我将发布报告和参数,但它们包含敏感信息。如何调试ReportViewer库内部的问题以解

我在使用MS ReportViewer呈现报告(具有特定参数集)时遇到以下问题。从内部ReportViewer JS代码调用的JS失败,特别是“ScriptResource.axd”的这一部分:

这将破坏呈现的报告。我不知道如何进一步追踪,我知道可以使用不同的参数格式化报告,但我不明白如何调试ReportViewer库内部的小型JS

这种JS故障是某些报告的已知问题吗?我正在运行库的最新版本(15.0.0)。我将发布报告和参数,但它们包含敏感信息。如何调试ReportViewer库内部的问题以解决此类问题?

非常棘手,我在母版页中运行了一个C#方法,禁用了某些类型的控件,因此用户无法“编辑”页面,如下所示:

//CommonFunctions
public static List<T> GetAllControlsRecursiveByType<T>(ControlCollection Controls) where T : Control
{
    List<T> results = new List<T>();
    foreach (Control c in Controls)
    {
        if (c is T)
        {
            results.Add((T)c);
        }

        if (c.HasControls())
        {
            results.AddRange(GetAllControlsRecursiveByType<T>(c.Controls));
        }
    }
    return results;
}

public void DisableControls(Control control)
{
    if (control == null)
    {
        return;
    }

    DisableControl(control);
    foreach (System.Web.UI.Control c in control.Controls)
    {
        DisableControl(c);

        // Recurse into child controls.
        if (c.Controls.Count > 0)
        {
            DisableControls(c);
        }
    }
}

foreach (Control element in CommonFunctions.GetAllControlsRecursiveByType<Control>(FindControl("ApplicationBody").Controls))
{
    List<string> excludedIDs = new List<string>() { "btnAjaxDynamicFilterApplyFilter", "btnClose", "btnCancel", "btnExport" };
    List<Type> includedTypes = new List<Type>() { typeof(LinkButton), typeof(Button), typeof(ImageButton), typeof(Repeater), typeof(ABC.Controls.ABCRepeater),
        typeof(GridView), typeof(ABC.Controls.ABCGridView), typeof(ABC.Controls.ImageCheckBox) };

    if (!excludedIDs.Contains(element.ID) && includedTypes.Contains(element.GetType()))
    {
        DisableControls(element);
    }
}
非常棘手,我在母版页中运行了一个C#方法,禁用了某些类型的控件,因此用户无法“编辑”页面,如下所示:

//CommonFunctions
public static List<T> GetAllControlsRecursiveByType<T>(ControlCollection Controls) where T : Control
{
    List<T> results = new List<T>();
    foreach (Control c in Controls)
    {
        if (c is T)
        {
            results.Add((T)c);
        }

        if (c.HasControls())
        {
            results.AddRange(GetAllControlsRecursiveByType<T>(c.Controls));
        }
    }
    return results;
}

public void DisableControls(Control control)
{
    if (control == null)
    {
        return;
    }

    DisableControl(control);
    foreach (System.Web.UI.Control c in control.Controls)
    {
        DisableControl(c);

        // Recurse into child controls.
        if (c.Controls.Count > 0)
        {
            DisableControls(c);
        }
    }
}

foreach (Control element in CommonFunctions.GetAllControlsRecursiveByType<Control>(FindControl("ApplicationBody").Controls))
{
    List<string> excludedIDs = new List<string>() { "btnAjaxDynamicFilterApplyFilter", "btnClose", "btnCancel", "btnExport" };
    List<Type> includedTypes = new List<Type>() { typeof(LinkButton), typeof(Button), typeof(ImageButton), typeof(Repeater), typeof(ABC.Controls.ABCRepeater),
        typeof(GridView), typeof(ABC.Controls.ABCGridView), typeof(ABC.Controls.ImageCheckBox) };

    if (!excludedIDs.Contains(element.ID) && includedTypes.Contains(element.GetType()))
    {
        DisableControls(element);
    }
}
//CommonFunctions
public static List<T> GetAllControlsRecursiveByType<T>(ControlCollection Controls) where T : Control
{
    List<T> results = new List<T>();
    foreach (Control c in Controls)
    {
        if (c is T)
        {
            results.Add((T)c);
        }

        if (c.HasControls())
        {
            results.AddRange(GetAllControlsRecursiveByType<T>(c.Controls));
        }
    }
    return results;
}

public void DisableControls(Control control)
{
    if (control == null)
    {
        return;
    }

    DisableControl(control);
    foreach (System.Web.UI.Control c in control.Controls)
    {
        DisableControl(c);

        // Recurse into child controls.
        if (c.Controls.Count > 0)
        {
            DisableControls(c);
        }
    }
}

foreach (Control element in CommonFunctions.GetAllControlsRecursiveByType<Control>(FindControl("ApplicationBody").Controls))
{
    List<string> excludedIDs = new List<string>() { "btnAjaxDynamicFilterApplyFilter", "btnClose", "btnCancel", "btnExport" };
    List<Type> includedTypes = new List<Type>() { typeof(LinkButton), typeof(Button), typeof(ImageButton), typeof(Repeater), typeof(ABC.Controls.ABCRepeater),
        typeof(GridView), typeof(ABC.Controls.ABCGridView), typeof(ABC.Controls.ImageCheckBox) };

    if (!excludedIDs.Contains(element.ID) && includedTypes.Contains(element.GetType()))
    {
        DisableControls(element);
    }
}
public bool ControlHasParentWithType(Control control, Type type)
{
    if (control == null || control.Parent == null)
    {
        return false;
    }
    else if (control.Parent.GetType() == type)
    {
        return true;
    }

    return ControlHasParentWithType(control.Parent, type);
}

//Within Method before disabling the control
if (ControlHasParentWithType(element, typeof(ReportViewer)))
{
    continue;
}