Stimulsoft margininsPx [i] .replace不是MVC5中的函数JavaScript错误?

时间:2016-02-07 11:01:32

标签: javascript web asp.net-mvc-5 stimulsoft

我正在使用VS2013 Asp.Net MVC 5和Stimulsoft Report 2013.5

没关系,但View上的以下javascript异常:

marginsPx[i].replace is not a function

Stimulsoft report error

我的观点:

<div class="@Model.ReportParametersVisibilityCssClass">
    @using (Html.BeginForm("Kardex", "KaraReports", FormMethod.Post, new Dictionary<string, object> { { "id", "ReportForm" }, { "class", "form-horizontal" }, { "role", "form" } }))
    {
        @Html.AntiForgeryToken()
        @Html.HiddenFor(model => model.SelectedEmployeesEmpNoInJsonFormat)
        @Html.HiddenFor(model => model.SelectedEmployeesFiltering)
        @Html.HiddenFor(model => model.StartDate)
        @Html.HiddenFor(model => model.EndDate)
        @Html.HiddenFor(model => model.Month)

        <div class="maxwidth500 center-block">
            <div class="form-group">
                @Html.Action("MonthSelector", "CommonActions", new { month = Model.Month, startDate = Model.StartDate, endDate = Model.EndDate })
            </div>
            <hr />
            <div class="form-group">
                <div class="col-sm-3"></div>
                <div class="col-sm-6">
                    <button type="button" class="btn btn-default" data-name="select-personnels" data-toggle="modal" data-target="#SelectableSearchEmployeeModal">@Resources.SelectPersonals</button>
                    <span data-name="selected-employees-numbers"></span>
                </div>
            </div>
            <div class="form-group">
                @Html.BootstrapCheckBoxFor(model => model.ShowReportSectionBySection)
                @Html.BootstrapCheckBoxFor(model => model.ShowEachGroupInSeperatedPage)
            </div>
            <hr />
            <div class="form-group">
                @Html.BootstrapSubmitButton(false, new Dictionary<string, object> { { "name", "command" }, { "value", Resources.Observation } }, Resources.Observation)
                @Html.BootstrapSubmitButton(false, new Dictionary<string, object> { { "name", "command" }, { "value", Resources.Print }, { "class", "btn btn-default" } }, string.Format("<span title=\"{0}\" class=\"glyphicon glyphicon-print\"></span>", Resources.Print))
                @Html.BootstrapCancelButton()
            </div>
        </div>
    }
</div>

<div class="@Model.ReportViewerVisibilityCssClass" style="direction: ltr;">
    <hr />
    @Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions
    {
        Actions =
        {
            GetReportSnapshot = "KardexStimulsoftReport",
            ViewerEvent = "KardexViewerEvent"
        },
        Toolbar =
        {
            //Visible = false,
            ShowParametersButton = false
        }
    })
</div>

我的行动:

[AuthorizeUser(Permissions = "131213")]
public ActionResult KardexStimulsoftReport()
{
    KardexReportModel model = TempData[ReportTempDataName] as KardexReportModel;
    if (model == null)
    {
        StiReport emptyStiReport = new StiReport();
        return StiMvcViewer.GetReportSnapshotResult(emptyStiReport);
    }

    ServicePredicateBuilder<DtoEmployee> servicePredicateBuilder = MdsGridViewHelper.CreateGridViewCriteria<DtoEmployee>(model.SelectedEmployeesFiltering, "", 0, 0, new List<string>());
    servicePredicateBuilder.PaginationData = null;
    MorMamReports morMamReports = new MorMamReports(SecurityContext.GetCurrentUserForReport);

    #region بدست آوردن شروط

    if (!string.IsNullOrWhiteSpace(model.SelectedEmployeesEmpNoInJsonFormat))
    {
        var selectedEmpNos = JsonConvert.DeserializeObject<List<int>>(model.SelectedEmployeesEmpNoInJsonFormat);
        if (selectedEmpNos.Count > 0)
            servicePredicateBuilder.Criteria = servicePredicateBuilder.Criteria.And(q => q.Emp_No, OperatorEnum.Contain, selectedEmpNos);
    }

    #endregion

    StiReport stiReport = morMamReports.GetKardex(
                            servicePredicateBuilder,
                            model.StartPersianDateTime,
                            model.EndPersianDateTime,
                            Resources.Menu_131213,
                            string.Format("{0} {1} {2} {3}", Resources.FromDate, model.StartPersianDateTime.ToShortDateString(), Resources.ToDate, model.EndPersianDateTime.ToShortDateString()),
                            model.ShowEachGroupInSeperatedPage,
                            model.ShowReportSectionBySection ? GroupByItemEnum.Section : GroupByItemEnum.Employee);
    return StiMvcViewer.GetReportSnapshotResult(stiReport);
}


[AuthorizeUser(Permissions = "131213")]
public ActionResult KardexViewerEvent()
{
    return StiMvcViewer.ViewerEventResult();
}

2 个答案:

答案 0 :(得分:0)

此问题将在Stimulsoft Reports的下一个正式版本中修复。它将是2016.1版本。

答案 1 :(得分:0)

我在2016.1版本中遇到了这个问题。

在stimulsoft.viewer.js的缩小版本中,代码行如下所示:

for(o in e)u.push(parseInt(e[o].replace("px","")));

在设计者的代码中可以找到使用in的相同方法。我被迫编辑缩小的代码来解决问题。