Exemplo n.º 1
0
        public ActionResult GetReport()
        {
            var appPath   = Server.MapPath("~/");
            var dashboard = Helpers.Dashboard.CreateTemplate(appPath);

            return(StiMvcViewer.GetReportResult(dashboard));
        }
        public ActionResult GetReport(string id = "SimpleList")
        {
            // Create the report object and load data from xml file
            var report = new StiReport();

            // Load report from MDZ document file
            // If not found - load from MRT template
            switch (id)
            {
            // Interactive Reports
            case "DrillDownSorting":

            // Parameters
            case "ParametersDetailedCategories":
            case "ParametersDetailedOrders":
            case "ParametersHighlightCondition":
            case "ParametersSelectingCountry":
            case "ParametersInvoice":

            // {Today} function is used
            case "MultiColumnListContainers":
                var data = new DataSet("Demo");
                data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml"));
                report.Load(Server.MapPath("~/Content/ReportTemplates/" + id + ".mrt"));
                report.RegData(data);
                break;

            default:
                report.LoadPackedDocument(Server.MapPath("~/Content/ReportSnapshots/" + id + ".mdz"));
                break;
            }

            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 3
0
        public ActionResult GetReport(string fileName)
        {
            StoreService storeService = (StoreService)Ioc.Get <StoreService>();
            string       file, basePath = Server.MapPath("~/");
            string       reportFolder = string.Format("{0}\\Content\\DashboardReports\\ClientId{1}", basePath, storeService.StoreId.ToString());

            StiReport report = new StiReport();

            if (!string.IsNullOrEmpty(fileName))
            {
                file = string.Format("{0}\\{1}.mrt", reportFolder, fileName);
            }
            else if (Directory.Exists(reportFolder))
            {
                string[] files = Directory.GetFiles(reportFolder, "*.mrt");
                file = files.Length == 0 ? null : files[0];
            }
            else
            {
                file = null;
            }

            if (file != null)
            {
                report.Load(file);
                StiCacheCleaner.Clean();
                report.Dictionary.Synchronize();
                report.Dictionary.SynchronizeBusinessObjects();
            }

            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 4
0
        public ActionResult GetReport(string fileName = "WIP")
        {
            Report = fileName;
            Repository   repository   = new Repository();
            var          report       = new StiReport();
            StoreService storeService = (StoreService)Ioc.Get <StoreService>();
            string       basePath     = Server.MapPath("~/");
            //string reportFolder = string.Format("{0}\\Content\\DashboardReports\\ClientId{1}", basePath, storeService.StoreId.ToString());
            string reportFolder     = string.Format("{0}Content\\DashboardReports", basePath);
            string fileNameFullPath = string.Format("{0}\\{1}.mrt", reportFolder, fileName);

            // var path = Server.MapPath("~/Reports/WIP.mrt");
            report.Load(fileNameFullPath);
            try {
                var dbConnection = (StiSqlDatabase)report.Dictionary.Databases["Connection"];
                dbConnection.ConnectionString = repository.ConnectionString;

                report.Dictionary.Variables["Clientid"].ValueObject = storeService.StoreId.ToString();
                report.Dictionary.Variables["BaseUrl"].ValueObject  = Request.Url.Scheme + "://" + Request.Url.Authority;
            }
            catch
            {
            }
            return(StiMvcViewer.GetReportResult(report));
        }
        public ActionResult GetReport()
        {
            // Loading the report template
            var reportPath = Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt");
            var report     = new StiReport();

            report.Load(reportPath);

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

            // Loading data from the XML file
            var dataPath = Server.MapPath("~/Content/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(StiMvcViewer.GetReportResult(report));
        }
        public ActionResult GetReport(string id)
        {
            var report = StiReport.CreateNewDashboard();

            report.Load(Server.MapPath($"~/Dashboards/{id}.mrt"));

            return(StiMvcViewer.GetReportResult(report));
        }
        public ActionResult GetReport()
        {
            StiReport report = new StiReport();

            report.LoadDocument(Server.MapPath("~/Content/Reports/SimpleList.mdc"));

            return(StiMvcViewer.GetReportResult(report));
        }
        public ActionResult GetReport()
        {
            var report = new StiReport();

            report.Load(Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt"));

            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 9
0
        public ActionResult GetReportITypedList()
        {
            StiReport report = new StiReport();

            report.Load(Server.MapPath("~/Content/Reports/BusinessObjects_ITypedList.mrt"));
            report.RegData("EmployeeITypedList", CreateBusinessObjectsITypedList.GetEmployees());
            CheckReference(report);

            return(StiMvcViewer.GetReportResult(report));
        }
        public ActionResult GetReportIEnumerable()
        {
            var report = new StiReport();

            report.Load(Server.MapPath("~/Content/Reports/BusinessObjects_IEnumerable.mrt"));
            report.RegData("EmployeeIEnumerable", CreateBusinessObjectsIEnumerable.GetEmployees());
            CheckReference(report);

            return(StiMvcViewer.GetReportResult(report));
        }
        public ActionResult LoadExitReportSnapshot()
        {
            Guid exitId = new Guid(TempData["exitId"].ToString());

            var report = new StiReport();

            report.Load(Server.MapPath("~/Reports/MRT/ExitReport.mrt"));
            report.RegBusinessObject("ExitReport", GetExit(exitId));
            //  report.Dictionary.Variables.Add("today", DateTime.Today());
            return(StiMvcViewer.GetReportResult(report));
        }
        public ActionResult GetReportITypedListBO()
        {
            var report = new StiReport();

            report.Load(Server.MapPath("~/Content/Reports/BusinessObjects_ITypedList_BO.mrt"));
            report.RegBusinessObject("EmployeeITypedList", CreateBusinessObjectsITypedList.GetEmployees());
            report.Dictionary.SynchronizeBusinessObjects(2);
            CheckReference(report);

            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 13
0
        public ActionResult GetReport(string id = "DashboardChristmas")
        {
            // Create the dashboard object
            var report = StiReport.CreateNewDashboard();

            // Load dashboard template
            report.Load(Server.MapPath($"~/Dashboards/{id}.mrt"));

            // Return template to the Viewer
            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 14
0
        public ActionResult GetReport()
        {
            var       reportTempData = TempData[Helpers.TempReportName] as ReportList;
            StiReport report         = new StiReport();

            //StiOptions.Dictionary.BusinessObjects.ColumnsSynchronizationMode = Stimulsoft.Report.Dictionary.StiColumnsSynchronizationMode.KeepAbsentColumns;
            report.Load(Server.MapPath($"~/Content/Reports/{reportTempData.Name}.mrt"));
            report = ReportData.RegisterData(reportTempData.Data, report);
            TempData[Helpers.TempReportName] = reportTempData;

            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 15
0
        public ActionResult CreateReportResult(Stream input, ReportInfo ri)
        {
            var r = StiReportExtensions.CreateReport(input, ri.Name);

            r.AddDataModel(ri.DataModel);
            var vars = ri.Variables;

            if (vars != null)
            {
                r.AddVariables(vars);
            }
            return(StiMvcViewer.GetReportResult(r));
        }
Exemplo n.º 16
0
 public ActionResult GetReport()
 {
     System.Web.Routing.RouteValueDictionary routeValues = StiMvcViewer.GetRouteValues();
     if (routeValues["id"] != null)
     {
         var reportId = Guid.Parse(routeValues["id"].ToString());
     }
     else
     {
         throw new Exception("no id");
     }
     return(StiMvcViewer.GetReportResult(new StiReport()));
 }
        public ActionResult GetReport()
        {
            StiReport report = new StiReport();

            report.Load(Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt"));

            DataSet data = new DataSet("Demo");

            data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml"));

            report.RegData(data);

            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 18
0
        public ActionResult GetReport()
        {
            // Create the report object
            StiReport report = new StiReport();

            report.Load(Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt"));

            // Load data from XML file for report template
            DataSet data = new DataSet("Demo");

            data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml"));

            report.RegData(data);

            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 19
0
        public async Task <ActionResult> GetReport()
        {
            try
            {
                var rp   = StiMvcViewer.GetRequestParams();
                var Rep  = rp.HttpContext.Request.Params["Rep"];
                var Base = rp.HttpContext.Request.Params["Base"];
                var id   = rp.Routes["Id"];
                var url  = $"/_report/{Base}/{Rep}/{id}";

                //TODO: profile var token = Profiler.BeginReport("create");

                ReportInfo ri = await GetReportInfo(url, id);

                //TODO: image settings var rm = rm.ImageInfo;
                if (ri == null)
                {
                    throw new InvalidProgramException("invalid data");
                }
                var path = ri.ReportPath;
                var r    = StiReportExtensions.CreateReport(path, ri.Name);
                if (ri.DataModel != null)
                {
                    var dynModel = ri.DataModel.GetDynamic();
                    foreach (var x in dynModel)
                    {
                        r.RegBusinessObject(x.Key, x.Value);
                    }
                }
                var vars = ri.Variables;
                if (vars != null)
                {
                    r.AddVariables(vars);
                }
                return(StiMvcViewer.GetReportResult(r));
            }
            catch (Exception ex)
            {
                String msg = ex.Message;
                Int32  x   = msg.IndexOf(": error");
                if (x != -1)
                {
                    msg = msg.Substring(x + 7).Trim();
                }
                return(new HttpStatusCodeResult(500, msg));
            }
        }
Exemplo n.º 20
0
        public ActionResult GetReport(int?id)
        {
            // Create the report object
            StiReport report = new StiReport();

            switch (id)
            {
            // Dynamic sorting
            case 1:
                report.Load(Server.MapPath("~/Content/Reports/DrillDownSorting.mrt"));
                break;

            // Drill down
            case 2:
                report.Load(Server.MapPath("~/Content/Reports/DrillDownListOfProducts.mrt"));
                break;

            // Collapsing
            case 3:
                report.Load(Server.MapPath("~/Content/Reports/DrillDownGroupWithCollapsing.mrt"));
                break;

            // Bookmarks
            case 4:
                report = new StiMasterDetail();
                break;

            // Parameters
            case 5:
                report = new StiParametersSelectingCountryReport();
                break;

            default:
                report.Load(Server.MapPath("~/Content/Reports/DrillDownSorting.mrt"));
                break;
            }

            // Load data from XML file for report template
            DataSet data = new DataSet("Demo");

            data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml"));
            report.Dictionary.Databases.Clear();
            report.RegData(data);

            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 21
0
        public async Task <ActionResult> GetReport()
        {
            try
            {
                var rp   = StiMvcViewer.GetRequestParams();
                var Rep  = rp.HttpContext.Request.Params["Rep"];
                var Base = rp.HttpContext.Request.Params["Base"];
                var id   = rp.Routes["Id"];
                var url  = $"/_report/{Base.RemoveHeadSlash()}/{Rep}/{id}";

                //TODO: profile var token = Profiler.BeginReport("create");
                var prms = new ExpandoObject();
                prms.Append(_baseController.CheckPeriod(rp.HttpContext.Request.QueryString), toPascalCase: true);
                prms.RemoveKeys("Rep,rep,Base,base,Format,format");

                ReportInfo ri = await GetReportInfo(url, id, prms);

                //TODO: image settings var rm = rm.ImageInfo;
                if (ri == null)
                {
                    throw new InvalidProgramException("invalid data");
                }
                var path = ri.ReportPath;
                using (var stream = _baseController.Host.ApplicationReader.FileStreamFullPathRO(path))
                {
                    var r = StiReportExtensions.CreateReport(stream, ri.Name);
                    r.AddDataModel(ri.DataModel);
                    var vars = ri.Variables;
                    if (vars != null)
                    {
                        r.AddVariables(vars);
                    }
                    return(StiMvcViewer.GetReportResult(r));
                }
            }
            catch (Exception ex)
            {
                String msg = ex.Message;
                Int32  x   = msg.IndexOf(": error");
                if (x != -1)
                {
                    msg = msg.Substring(x + 7).Trim();
                }
                return(new HttpStatusCodeResult(500, msg));
            }
        }
Exemplo n.º 22
0
        public ActionResult GetReport(int?id)
        {
            // Create the report object
            StiReport report = new StiReport();

            // Load report
            switch (id)
            {
            // Load report snapshot
            case 1:
                report.LoadDocument(Server.MapPath("~/Content/Reports/SimpleList.mdc"));
                break;

            // Load report template
            case 2:
                report.Load(Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt"));
                break;

            // Load compiled report class
            case 3:
                report = new StiMasterDetail();
                break;

            // Load compiled report class
            case 4:
                report = new StiParametersSelectingCountryReport();
                break;

            // Load report snapshot
            default:
                report.LoadDocument(Server.MapPath("~/Content/Reports/SimpleList.mdc"));
                break;
            }

            // Load data from XML file for report template
            if (!report.IsDocument)
            {
                DataSet data = new DataSet("Demo");
                data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml"));

                report.RegData(data);
            }

            return(StiMvcViewer.GetReportResult(report));
        }
        public ActionResult LoadInvoiceReportSnapshot()
        {
            Guid exitId = new Guid(TempData["id"].ToString());


            Stimulsoft.Base.StiLicense.Key = "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE";


            var path = System.Web.HttpContext.Current.Server.MapPath("~/Content/license.key");

            Stimulsoft.Base.StiLicense.LoadFromFile(path);


            var report = new StiReport();

            report.Load(Server.MapPath("~/Reports/MRT/InvoiceReport.mrt"));
            report.RegBusinessObject("InvoiceReport", GetInvoice(exitId));
            //  report.Dictionary.Variables.Add("today", DateTime.Today());
            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 24
0
        public override ActionResult GetReportSnapshot()
        {
            var documentoId         = Int32.Parse(ParametrosReport["TablaId"]);
            TablaRegistroDTO entity = new TablaRegistroDTO();

            entity.Id = documentoId;
            var tablaregistro      = MapperHelper.Map <TablaRegistroDTO, TablaRegistro>(entity);
            var dataTabla          = TablaRegistroBL.Instancia.GetById(tablaregistro);
            var dataBtabladetablle = TablaRegistroBL.Instancia.GetAllPagingDetalle(new PaginationParameter <int>
            {
                AmountRows  = 100,
                WhereFilter = "WHERE tbpd_flag_estado=1 AND tbpc_iid_tabla_opciones =" + tablaregistro.Id + "",
                Start       = 0,
                OrderBy     = "",
            });

            var report = new StiReport();

            report.Load(Server.MapPath("~/Prints/M_Administrador/TablaRegistro/TablaOpciones.mrt"));
            report.RegBusinessObject("tabla", "tabla", dataTabla);
            report.RegBusinessObject("tabladetalle", "tabladetalle", dataBtabladetablle);

            return(StiMvcViewer.GetReportResult(report));
        }
        public ActionResult GetReport()
        {
            // Create new dashboard
            var report = StiReport.CreateNewDashboard();

            // Load dashboard template
            report.Load(Server.MapPath("~/Dashboards/Dashboard.mrt"));

            // Load a JSON file
            var jsonBytes = System.IO.File.ReadAllBytes(Server.MapPath("~/Dashboards/Demo.json"));

            // Get DataSet from JSON file
            var json    = StiJsonConnector.Get();
            var dataSet = json.GetDataSet(new StiJsonOptions(jsonBytes));

            // Remove all connections from the dashboard template
            report.Dictionary.Databases.Clear();

            // Register DataSet object
            report.RegData("Demo", "Demo", dataSet);

            // Return template to the Viewer
            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 26
0
        public ActionResult GetReport()
        {
            var report = Helpers.Dashboard.CreateTemplate();

            return(StiMvcViewer.GetReportResult(report));
        }
Exemplo n.º 27
0
 public ActionResult GetReport()
 {
     return(StiMvcViewer.GetReportResult(SessionParameters.Report));
 }