public IActionResult GetReport()
        {
            var report = new StiReport();

            //Load and add font to the resources
            var fileContent = System.IO.File.ReadAllBytes(StiNetCoreHelper.MapPath(this, "Fonts/Roboto-Black.ttf"));
            var resource    = new StiResource("Roboto-Black", "Roboto-Black", false, StiResourceType.FontTtf, fileContent, false);

            report.Dictionary.Resources.Add(resource);

            //Add resource font to the font collection
            StiFontCollection.AddResourceFont(resource.Name, resource.Content, "ttf", resource.Alias);

            //Create a text component
            var dataText = new StiText();

            dataText.ClientRectangle = new RectangleD(1, 1, 3, 2);
            dataText.Text            = "Sample Text";
            dataText.Font            = StiFontCollection.CreateFont("Roboto-Black", 12, FontStyle.Regular);
            dataText.Border.Side     = StiBorderSides.All;

            report.Pages[0].Components.Add(dataText);

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
Exemplo n.º 2
0
        public IActionResult ReportDesigner()
        {
            string Report = "demoreport";

            var       reportPath = HostEnvironment.WebRootPath + "\\Reports\\" + Report + ".mrt";
            StiReport report     = new StiReport();

            //report.Load(reportPath);

            ///What is the code for desgining from  json her
            ///The link to json is , considering that the json api is protected
            ///http://localhost:52507/api/Reports/GetEmployees

            report.Load(StiNetCoreHelper.MapPath(this, reportPath));

            var jsonString = "{ }"; // Your code to autorization and get JSON string
            var dataSet    = StiJsonToDataSetConverter.GetDataSet(jsonString);

            report.RegData("ConnectionName", dataSet);
            report.Dictionary.Synchronize();



            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
Exemplo n.º 3
0
        public IActionResult PreviewReport()
        {
            StiReport report = StiNetCoreDesigner.GetActionReportObject(this);


            return(StiNetCoreDesigner.PreviewReportResult(this, report));
        }
Exemplo n.º 4
0
        public IActionResult GetReport(string reportPath, string dataKey = null)
        {
            if (!string.IsNullOrWhiteSpace(reportPath))
            {
                EnsureAllowAccess(reportPath);

                var report = new StiReport();

                string contentRootPath = _hostingEnvironment.ContentRootPath;
                Stimulsoft.Base.StiLicense.LoadFromFile(contentRootPath + "/Stimulsoft/license.key");

                report.Load(StiNetCoreHelper.MapPath(this, reportPath));
                // report.Dictionary.Variables["OrganizationName"].Value = "AwoNore";
                // report.Dictionary.Variables["OrganizationLogo"].Value = $"{Request.Scheme}://{Request.Host}{""}";
                if (!string.IsNullOrWhiteSpace(dataKey))
                {
                    var reportDatasource = _context.HttpContext.Session.Get <List <ReportDatasourceModel> >(dataKey);
                    foreach (var item in reportDatasource)
                    {
                        report.RegData(item.Name, item.Name, item.Value);
                    }
                    report.Render();
                }
                return(StiNetCoreDesigner.GetReportResult(this, report));
            }
            else
            {
                //Raise error path is empty;
                return(null);
            }
        }
Exemplo n.º 5
0
        public IActionResult GetReport()
        {
            StiReport report = new StiReport();

            report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt"));

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
        public IActionResult GetReport()
        {
            StiReport report = new StiReport();

            report.Load(StiNetCoreHelper.MapPath(this, "Reports/relatorio_teste.mrt"));

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> DesignerEvent()
        {
            var requestParams = StiNetCoreDesigner.GetRequestParams(this);



            return(StiNetCoreDesigner.DesignerEventResult(this));
        }
        public IActionResult GetReport(string id)
        {
            var report = StiReport.CreateNewDashboard();

            report.Load(StiNetCoreHelper.MapPath(this, "/Dashboards/" + id + ".mrt"));

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
        public IActionResult GetReport(string id)
        {
            var report = new StiReport();

            report.Load(StiNetCoreHelper.MapPath(this, $"Dashboards/{id}.mrt"));

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
Exemplo n.º 10
0
        public IActionResult GetReport(string id = "SimpleList")
        {
            // Create the report object and load data from xml file
            var report = new StiReport();

            report.Load(StiNetCoreHelper.MapPath(this, "/Reports/" + id + ".mrt"));

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
Exemplo n.º 11
0
        public IActionResult SaveReport()
        {
            StiReport report = StiNetCoreDesigner.GetReportObject(this);

            // Save the report template, for example to JSON string
            string json = report.SaveToJsonString();

            return(StiNetCoreDesigner.SaveReportResult(this));
        }
Exemplo n.º 12
0
        public IActionResult SaveReport()
        {
            StiReport    report = StiNetCoreDesigner.GetReportObject(this);
            StreamWriter sw     = new StreamWriter($"{report.ReportName}.mrt");

            report.Save(sw.BaseStream);
            sw.Close();
            return(StiNetCoreDesigner.SaveReportResult(this));
        }
Exemplo n.º 13
0
        public IActionResult GetReport()
        {
            // You can use report string or path to report template MRT file
            string reportString = System.IO.File.ReadAllText(_hostEnvironment.WebRootPath + "\\reports\\SimpleList.mrt");

            return(StiNetCoreDesigner.GetReportResult(this, reportString));

            //return StiNetCoreDesigner.GetReportResult(this, _hostEnvironment.WebRootPath + "\\reports\\SimpleList.mrt");
        }
        public async Task <IActionResult> GetReport()
        {
            StiReport report = new StiReport();


            report.Load(StiNetCoreHelper.MapPath(this, "Reports/payments-preset.mrt"));


            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
        public IActionResult GetReport()
        {
            // Loading the report template
            var reportPath = StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt");
            var report     = new StiReport();

            report.Load(reportPath);

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
Exemplo n.º 16
0
        public IActionResult GetReport()
        {
            var report = new StiReport();

            //Adding a connection to the report from code
            var database = new CustomPostgreSQLDatabase("CustomData1", "Server=127.0.0.1; Port=5432; Database=myDataBase; User Id=myUsername; Password=myPassword;");

            report.Dictionary.Databases.Add(database);

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
Exemplo n.º 17
0
        public IActionResult GetReport(string selectedreport)
        {
            var report = new StiReport();

            if (!string.IsNullOrWhiteSpace(selectedreport))
            {
                report.Load(StiNetCoreHelper.MapPath(this, $"Reports/{selectedreport}.mrt"));
            }

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
        public IActionResult GetReport()
        {
            // Create the dashboard object
            var report = StiReport.CreateNewDashboard();

            // Load dashboard template
            report.Load(StiNetCoreHelper.MapPath(this, "Dashboards/DashboardChristmas.mrt"));

            // Return template to the Designer
            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
Exemplo n.º 19
0
            public async Task <IActionResult> SaveReport([FromQuery] Guid template)
            {
                var report = StiNetCoreDesigner.GetReportObject(this);

                await using var ms = new MemoryStream();
                report.Save(ms);
                ms.Position = 0;

                _memoryCache.Set(template.ToString("D"), ms.ToArray());

                return(await StiNetCoreDesigner.SaveReportResultAsync(this));
            }
        public IActionResult SaveReport()
        {
            var report = StiNetCoreDesigner.GetReportObject(this);

            // string packedReport = report.SavePackedReportToString();
            // ...
            // The save report code here
            // ...

            // Completion of the report saving without dialog box
            return(StiNetCoreDesigner.SaveReportResult(this));
        }
Exemplo n.º 21
0
        public IActionResult PreviewReport()
        {
            StiReport report = StiNetCoreDesigner.GetActionReportObject(this);

            DataSet data = new DataSet("Demo");

            data.ReadXml(StiNetCoreHelper.MapPath(this, "Reports/Data/Demo.xml"));

            report.RegData(data);

            return(StiNetCoreDesigner.PreviewReportResult(this, report));
        }
Exemplo n.º 22
0
        private async Task <IActionResult> SaveReport(Guid key)
        {
            var report = StiNetCoreDesigner.GetReportObject(this);

            await using var ms = new MemoryStream();
            report.Save(ms);
            ms.Position = 0;

            _memoryCache.Set(key.ToString("D"), ms.ToArray());

            return(await StiNetCoreDesigner.SaveReportResultAsync(this));
        }
Exemplo n.º 23
0
        private async Task <IActionResult> GetPreview(Guid key)
        {
            var stiReport = StiNetCoreDesigner.GetReportObject(this);

            stiReport.RegBusinessObject("Data", new
            {
                Test = "Test"
            });
            stiReport.Dictionary.SynchronizeBusinessObjects(5);
            await stiReport.Dictionary.SynchronizeAsync();

            return(await StiNetCoreDesigner.PreviewReportResultAsync(this, stiReport));
        }
Exemplo n.º 24
0
        public IActionResult SaveReport()
        {
            string reportString = StiNetCoreDesigner.GetReportString(this);
            string reportName   = StiNetCoreDesigner.GetReportName(this);

            try
            {
                System.IO.File.WriteAllText(_hostEnvironment.WebRootPath + "\\reports\\" + reportName + ".mrt", reportString);
                return(StiNetCoreDesigner.SaveReportResult(this, true, "The report is saved successfully"));
            }
            catch (Exception e)
            {
                return(StiNetCoreDesigner.SaveReportResult(this, false, "Error at saving: " + e.Message));
            }
        }
Exemplo n.º 25
0
        private IActionResult GetReportResult()
        {
            var dataSet = new DataSet();
            var data    = StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt");
            var mrt     = StiNetCoreHelper.MapPath(this, "Reports/Data/Demo.xml");

            dataSet.ReadXml(mrt);
            var report = new StiReport();

            report.Load(data);
            report.RegData(dataSet);
            report.Dictionary.Synchronize();

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
Exemplo n.º 26
0
        public IActionResult PreviewReport()
        {
            // Get the report template
            StiReport report = StiNetCoreDesigner.GetActionReportObject(this);

            // Register data, if necessary
            var data = new DataSet("Demo");

            data.ReadXml(StiNetCoreHelper.MapPath(this, "Data/Demo.xml"));
            report.Dictionary.Databases.Clear();
            report.RegData(data);

            // Return the report snapshot result to the client
            return(StiNetCoreDesigner.PreviewReportResult(this, report));
        }
Exemplo n.º 27
0
        public IActionResult Post()
        {
            var requestParams = StiNetCoreDesigner.GetRequestParams(this);

            switch (requestParams.Action)
            {
            case StiAction.GetReport:
                return(GetReportResult());

            case StiAction.PreviewReport:
                return(GetReportPreviewResult());

            default:
                return(StiNetCoreDesigner.ProcessRequestResult(this));
            }
        }
Exemplo n.º 28
0
            public async Task <IActionResult> PreviewReport([FromQuery] Guid template)
            {
                var stiReport = StiNetCoreDesigner.GetReportObject(this);

                if (stiReport != null)
                {
                    stiReport.RegBusinessObject("Data", new
                    {
                        Test = "Test"
                    });
                    stiReport.Dictionary.SynchronizeBusinessObjects(5);
                    await stiReport.Dictionary.SynchronizeAsync();
                }

                return(await StiNetCoreDesigner.PreviewReportResultAsync(this, stiReport));
            }
Exemplo n.º 29
0
            public async Task <IActionResult> GetReport([FromQuery] Guid template)
            {
                var stiReport = StiReport.CreateNewReport();

                if (_memoryCache.TryGetValue <byte[]>(template.ToString("D"), out var data))
                {
                    stiReport.Load(data);
                }

                stiReport.RegBusinessObject("Data", new
                {
                    Test = "Test"
                });
                stiReport.Dictionary.SynchronizeBusinessObjects(5);
                await stiReport.Dictionary.SynchronizeAsync();

                return(await StiNetCoreDesigner.GetReportResultAsync(this, stiReport));
            }
Exemplo n.º 30
0
        public IActionResult SaveReport(string reportPath, string dataKey = null)
        {
            if (!string.IsNullOrWhiteSpace(reportPath))
            {
                EnsureAllowAccess(reportPath);

                StiReport report = StiNetCoreDesigner.GetReportObject(this);

                report.Save(StiNetCoreHelper.MapPath(this, reportPath));

                // Completion of the report saving without dialog box
                return(StiNetCoreDesigner.SaveReportResult(this));
            }
            else
            {
                //Raise error path is empty;
                return(null);
            }
        }