Example #1
0
        public IActionResult PreviewReport()
        {
            StiReport report = StiNetCoreDesigner.GetActionReportObject(this);


            return(StiNetCoreDesigner.PreviewReportResult(this, report));
        }
Example #2
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));
        }
Example #3
0
        private IActionResult GetReportPreviewResult()
        {
            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.PreviewReportResult(this, report));
        }
Example #4
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));
        }
        public IActionResult PreviewReport()
        {
            // Getting a preview report
            var report = StiNetCoreDesigner.GetActionReportObject(this);

            // Deleting connections in the report template
            report.Dictionary.Databases.Clear();

            // Loading data from the XML file
            var dataPath = StiNetCoreHelper.MapPath(this, "Reports/Data/Demo.xml");
            var data     = new DataSet();

            data.ReadXml(dataPath);

            // Registering data in the report
            report.RegData(data);

            // Syncing the data structure, if required
            //report.Dictionary.Synchronize();

            return(StiNetCoreDesigner.PreviewReportResult(this, report));
        }
Example #6
0
        public IActionResult PreviewReport(string reportPath, string dataKey = null)
        {
            EnsureAllowAccess(reportPath);

            // Get the report template
            var report = StiNetCoreDesigner.GetActionReportObject(this);

            // report.Dictionary.Variables["OrganizationName"].Value = "Awronore";
            // 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 the report snapshot result to the client
            return(StiNetCoreDesigner.PreviewReportResult(this, report));
        }