Esempio n. 1
0
        public IActionResult GetReport()
        {
            var reportName  = "MasterDetail.mrt";
            var httpContext = new Stimulsoft.System.Web.HttpContext(this.HttpContext);
            var properties  = httpContext.Request.Params["properties"]?.ToString();

            if (properties != null)
            {
                var        data      = Convert.FromBase64String(properties);
                var        json      = Encoding.UTF8.GetString(data);
                JContainer container = JsonConvert.DeserializeObject <JContainer>(json);
                foreach (JToken token in container.Children())
                {
                    if (((JProperty)token).Name == "reportName")
                    {
                        reportName = ((JProperty)token).Value.Value <string>();
                    }
                }
            }

            var report = StiReport.CreateNewReport();
            var path   = StiAngularHelper.MapPath(this, $"Reports/{reportName}");

            report.Load(path);

            return(StiAngularViewer.GetReportResult(this, report));
        }
        public IActionResult ViewerEvent()

        {
            var requestParams = StiAngularViewer.GetRequestParams(this);
            var reportName    = GetReportName();
            var data          = GetData();

            var dt = JsonConvert.DeserializeObject(data.ToString());

            //var json = StiJsonConnector.Get();
            //var dataSet = json.GetDataSet(new StiJsonOptions(data));÷


            if (requestParams.Action == StiAction.GetReport)

            {
                var report = StiReport.CreateNewReport();
                System.Globalization.PersianCalendar pc = new System.Globalization.PersianCalendar();
                var    path        = StiAngularHelper.MapPath(this, "wwwroot/Reports/Currency/" + reportName);
                string Date_shamsi = pc.GetYear(DateTime.Now) + "/" + pc.GetMonth(DateTime.Now) + "/" +
                                     pc.GetDayOfMonth(DateTime.Now);
                report.Load(path);
                //report.RegData("dt", data.ToString());
                report.RegData("dt", dt);
                report.Dictionary.Variables["shamsiDate"].Value = Date_shamsi;
                return(StiAngularViewer.GetReportResult(this, report));
            }

            return(StiAngularViewer.ProcessRequestResult(this));
        }
Esempio n. 3
0
        public IActionResult GetReport()
        {
            var report = StiReport.CreateNewReport();
            var path   = StiAngularHelper.MapPath(this, "Reports/MasterDetail.mrt");

            report.Load(path);

            return(StiAngularDesigner.GetReportResult(this, report));
        }
Esempio n. 4
0
        public IActionResult SaveReport()
        {
            var report = StiAngularDesigner.GetReportObject(this);

            var path = StiAngularHelper.MapPath(this, "Reports/MasterDetail.mrt");

            report.Save(path);

            return(StiAngularDesigner.SaveReportResult(this));
        }
        public IActionResult InitViewer()
        {
            var requestParams = StiAngularViewer.GetRequestParams(this);

            var options = new StiAngularViewerOptions();

            options.Actions.GetReport         = "GetReport";
            options.Actions.ViewerEvent       = "ViewerEvent";
            options.Appearance.ScrollbarsMode = true;
            options.Localization = StiAngularHelper.MapPath(this, "Localization/de.xml");

            return(StiAngularViewer.ViewerDataResult(requestParams, options));
        }
Esempio n. 6
0
        public IActionResult ViewerEvent()
        {
            var requestParams = StiAngularViewer.GetRequestParams(this);

            if (requestParams.Action == StiAction.GetReport)
            {
                var report = StiReport.CreateNewReport();
                var path   = StiAngularHelper.MapPath(this, $"Reports/EmployeeReport.mrt");
                report.Load(path);
                return(StiAngularViewer.GetReportResult(this, report));
            }
            return(StiAngularViewer.ProcessRequestResult(this));
        }