I get error when saving stimulsoft design in dotnet core

0

I'm using this code for designing reports. So When I want to save my template, then my application crash and I get this message in terminal:

The target process exited with code 0 (0x00000000) while evaluating the function 'Stimulsoft.Report.Mvc.StiNetCoreDesigner.DesignerEventResult'.

Also I get "Timeout response from the server." in console log.

I'm using dotnet core 3.1.

    [HttpGet]
    [GrantAuthorize("0")]
    public IActionResult ReportDesigner(Guid id)
    {
        var reportTemplateModel = this.GetById(id);

        var model = new StiNetCoreDesignerOptions()
        {
            Localization = "~/Content/Localization/fa.xml",
            Actions =
            {
                GetReport = "GetDesignerReport",
                CreateReport = "CreateReport",
                DesignerEvent = "DesignerEvent",
                SaveReport="SaveReport",
                //SaveReportAs="SaveReport",
            },
            Appearance ={
                //ReportDisplayMode=Stimulsoft.Report.Web.StiReportDisplayMode.Div,
                ShowDialogsHelp=false,
                 //important
                 //ShowSystemFonts=false
            },
            FileMenu =
            {
                ShowSaveAs=false,
                Visible=false
            },
            Dictionary =
            { 
                //PermissionDataSources = Stimulsoft.Report.Web.StiDesignerPermissions.View,
                //PermissionResources=Stimulsoft.Report.Web.StiDesignerPermissions.View
            }
        };
        if (IsAjaxRequest) return PartialView(model);
        return View(model);
    }
    [GrantAuthorize("0")]
    public IActionResult GetDesignerReport(Guid id)
    {
        var reportTemplate = this.Service.GetById(id);
        if (reportTemplate == null)
        {
            throw new Gamma.Core.Exceptions.GammaException(Localizer["Msg_NoDataFoundOrDeleted"], statusCode: Core.Exceptions.ErrorCodes.NoDataFound.GetHashCode());
        }
        StiReport report = new StiReport();
        if (System.IO.File.Exists(System.IO.Path.Combine(_environment.WebRootPath, reportTemplate.FilePath)))
        {
            report.Load(StiNetCoreHelper.MapWebRootPath(this, reportTemplate.FilePath));
        }
        return StiNetCoreDesigner.GetReportResult(this, report);
    }

    [GrantAuthorize("0")]
    public IActionResult CreateReport(Guid id)
    {
        var report = new StiReport();
        DataSet data = new DataSet("Demo");
        report.RegData(data);
        report.Dictionary.Synchronize();
        return StiNetCoreDesigner.GetReportResult(this, report);
    }
    [GrantAuthorize("0")]
    public IActionResult SaveReport(Guid id)
    {

        try
        {
            var reportTemplateModel = this.Service.GetById(id);
            if (reportTemplateModel == null)
            {
                throw new Gamma.Core.Exceptions.GammaException(Localizer["Msg_NoDataFoundOrDeleted"], statusCode: Core.Exceptions.ErrorCodes.NoDataFound.GetHashCode());
            }
            var report = new StiReport();
            var requestParams = StiNetCoreDesigner.GetRequestParams(this);
            var reportName = requestParams.Designer.FileName;
            var filePath = $"reportTemplate/{reportName}";
            reportTemplateModel.FilePath = filePath;
            var rootpath = StiNetCoreHelper.MapWebRootPath(this, filePath);
            report.Save(rootpath);
            this.Service.Update(reportTemplateModel);
            return StiNetCoreDesigner.SaveReportResult(this);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    [GrantAuthorize("0")]
    public IActionResult DesignerEvent()
    {
        return StiNetCoreDesigner.DesignerEventResult(this);
    }
.net-core
crash
stimulsoft
asked on Stack Overflow Jan 27, 2021 by Bahman Shafiei • edited Jan 27, 2021 by Bahman Shafiei

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0