protected void Page_Load(object sender, EventArgs e)
        {
            var name = Page.Request.QueryString["name"];

            if (!string.IsNullOrEmpty(name))
            {
                var dashboardPath = Server.MapPath($"Dashboards/{name}.mrt");
                var report        = StiReport.CreateNewDashboard();
                report.Load(dashboardPath);

                // Get theme colors from the dashboard page
                var dashboard = report.Pages[0] as StiDashboard;
                var bashboardBackHtmlColor = ColorTranslator.ToHtml(dashboard != null ? StiDashboardStyleHelper.GetDashboardBackColor(dashboard, true) : Color.White);
                var backHtmlColor          = ColorTranslator.ToHtml(dashboard != null ? StiDashboardStyleHelper.GetBackColor(dashboard) : Color.White);
                var foreHtmlColor          = ColorTranslator.ToHtml(dashboard != null ? StiDashboardStyleHelper.GetForeColor(dashboard) : Color.Black);

                // Set styles
                Body.Style.Add("background", bashboardBackHtmlColor);
                NavigationBar.Style.Add("background", backHtmlColor);
                LinkTitle.Style.Add("color", foreHtmlColor);
                LinkHome.Style.Add("color", foreHtmlColor);
                LinkAbout.Style.Add("color", foreHtmlColor);
                LinkContacts.Style.Add("color", foreHtmlColor);
                TextCopyright.Style.Add("color", foreHtmlColor);
            }
        }
        private void buttonJson_Click(object sender, EventArgs e)
        {
            textBoxLog.Clear();

            var report = StiReport.CreateNewDashboard();

            textBoxLog.Text += "New dashboard created\r\n";

            report.Load("Dashboards\\Dashboard.mrt");
            textBoxLog.Text += "Dashboard template loaded\r\n";

            var jsonBytes = File.ReadAllBytes("Dashboards\\Demo.json");

            textBoxLog.Text += "Load a JSON file\r\n";

            var json    = StiJsonConnector.Get();
            var dataSet = json.GetDataSet(new StiJsonOptions(jsonBytes));

            textBoxLog.Text += "Get DataSet from JSON file\r\n";

            report.Dictionary.Databases.Clear();
            textBoxLog.Text += "Remove all connections from the dashboard template\r\n";

            report.RegData("Demo", "Demo", dataSet);
            textBoxLog.Text += "Register DataSet object\r\n";

            report.Show(false);
            textBoxLog.Text += "Show Dashboard\r\n";
        }
Esempio n. 3
0
        public IActionResult Dashboards()
        {
            var dashboardFiles = Directory.GetFiles($"{environment.ContentRootPath}\\Dashboards", "*.mrt");
            var fileNames      = new string[dashboardFiles.Length];
            var index          = 0;

            foreach (var filePath in dashboardFiles)
            {
                fileNames[index++] = Path.GetFileNameWithoutExtension(filePath);
            }

            ViewBag.FileNames = fileNames;

            var fileName = RouteData.Values["id"].ToString();
            var report   = StiReport.CreateNewDashboard();

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

            var dashboard = report.Pages[0] as StiDashboard;

            ViewBag.ForeHtmlColor = ColorTranslator.ToHtml(dashboard != null ? StiDashboardStyleHelper.GetForeColor(dashboard) : Color.Black);
            ViewBag.BackHtmlColor = ColorTranslator.ToHtml(dashboard != null ? StiDashboardStyleHelper.GetDashboardBackColor(dashboard, true) : Color.White);
            ViewBag.BackColor     = dashboard != null?StiDashboardStyleHelper.GetDashboardBackColor(dashboard, true) : Color.White;

            return(View());
        }
        private void buttonDesigner_Click(object sender, EventArgs e)
        {
            var report = StiReport.CreateNewDashboard();

            report.Load("Dashboards\\DashboardChristmas.mrt");

            report.Design();
        }
        private StiReport GetTemplate()
        {
            var report = StiReport.CreateNewDashboard();

            report.Load(Server.MapPath("Dashboards/DashboardChristmas.mrt"));

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

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

            return(StiNetCoreViewer.GetReportResult(this, report));
        }
Esempio n. 7
0
        public ActionResult GetReport(string id)
        {
            var report = StiReport.CreateNewDashboard();

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

            return(StiMvcDesigner.GetReportResult(report));
        }
        private StiReport GetTemplate()
        {
            var report = StiReport.CreateNewDashboard();

            report.Load("Dashboards\\DashboardChristmas.mrt");

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

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

            return(StiNetCoreDesigner.GetReportResult(this, report));
        }
        protected void StiWebDesigner1_GetReport(object sender, Stimulsoft.Report.Web.StiReportDataEventArgs e)
        {
            var dashboardPath = Server.MapPath("Dashboards/DashboardChristmas.mrt");
            var report        = StiReport.CreateNewDashboard();

            report.Load(dashboardPath);

            e.Report = report;
        }
        private StiReport GetDashboard()
        {
            var reportPath = Server.MapPath("~/Dashboards/DashboardChristmas.mrt");
            var report     = StiReport.CreateNewDashboard();

            report.Load(reportPath);

            return(report);
        }
        private StiReport GetDashboard()
        {
            var reportPath = StiNetCoreHelper.MapPath(this, "Dashboards/DashboardChristmas.mrt");
            var report     = StiReport.CreateNewDashboard();

            report.Load(reportPath);

            return(report);
        }
Esempio n. 13
0
        public static StiReport CreateTemplate(string appPath)
        {
            var report    = StiReport.CreateNewDashboard();
            var dashboard = report.Pages[0] as StiDashboard;

            var dataPath = Path.Combine(appPath, "Data/Demo.xml");
            var data     = new DataSet();

            data.ReadXml(dataPath);

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

            var tableElement = new StiTableElement();

            tableElement.Left        = 0;
            tableElement.Top         = 0;
            tableElement.Width       = 700;
            tableElement.Height      = 500;
            tableElement.Border.Side = StiBorderSides.All;
            tableElement.BackColor   = Color.LightGray;
            tableElement.Name        = "Example";

            var dataBase = new StiDimensionColumn();

            dataBase.Expression = "Products.ProductID";
            tableElement.Columns.Add(dataBase);

            var dataBase1 = new StiDimensionColumn();

            dataBase1.Expression = "Products.ProductName";
            tableElement.Columns.Add(dataBase1);

            var dataBase2 = new StiDimensionColumn();

            dataBase2.Expression = "Products.UnitPrice";
            tableElement.Columns.Add(dataBase2);

            var filter1 = new StiDataFilterRule();

            filter1.Condition = StiDataFilterCondition.BeginningWith;
            filter1.Path      = "Products.ProductID";
            filter1.Value     = "1";
            tableElement.DataFilters.Add(filter1);

            var filter2 = new StiDataFilterRule();

            filter2.Condition = StiDataFilterCondition.EndingWith;
            filter2.Path      = "Products.UnitPrice";
            filter2.Value     = "1";
            tableElement.DataFilters.Add(filter2);

            dashboard.Components.Add(tableElement);

            return(report);
        }
        protected void StiWebViewer1_GetReport(object sender, Stimulsoft.Report.Web.StiReportDataEventArgs e)
        {
            var name          = Page.Request.QueryString["name"] ?? "DashboardChristmas";
            var dashboardPath = Server.MapPath($"Dashboards/{name}.mrt");
            var report        = StiReport.CreateNewDashboard();

            report.Load(dashboardPath);

            e.Report = 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));
        }
        public IActionResult GetReport(string id = "DashboardChristmas")
        {
            // Create the dashboard object
            var report = StiReport.CreateNewDashboard();

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

            // Return template to the Viewer
            return(StiNetCoreViewer.GetReportResult(this, report));
        }
        public ActionResult GetReport()
        {
            // Create the dashboard object
            var report = StiReport.CreateNewDashboard();

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

            // Return template to the Designer
            return(StiMvcDesigner.GetReportResult(report));
        }
Esempio n. 18
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));
        }
Esempio n. 19
0
        private StiReport GetTemplate()
        {
            //var report = new StiReport();
            var report = StiReport.CreateNewDashboard();

            System.Diagnostics.Debug.Assert(cmbTemplates.SelectedValue != null);
            string key   = ((KeyValuePair <String, String>)cmbTemplates.SelectedItem).Key;
            string value = ((KeyValuePair <String, String>)cmbTemplates.SelectedItem).Value;

            report.Load(value);
            return(report);
        }
        protected void StiWebViewer1_GetReport(object sender, StiReportDataEventArgs e)
        {
            var report     = StiReport.CreateNewDashboard();
            var reportName = "DashboardChristmas";

            if (!string.IsNullOrEmpty(Page.Request.QueryString.Get("reportname")))
            {
                reportName = Page.Request.QueryString.Get("reportname");
            }

            report.Load(string.Format("{0}\\Dashboards\\{1}.mrt", appDirectory, reportName));

            e.Report = report;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Get the report name fror URL query
            string keyValue = Page.Request.QueryString.Get("reportname");

            if (keyValue == null)
            {
                keyValue = "DashboardChristmas";
            }

            var report = StiReport.CreateNewDashboard();

            report.Load(string.Format("{0}\\Dashboards\\{1}.mrt", appDirectory, keyValue));
            StiWebDesigner1.Report = report;
        }
Esempio n. 22
0
        // GET: Viewer
        public ActionResult Index(string id = "DashboardChristmas")
        {
            var report = StiReport.CreateNewDashboard();

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

            // Get theme colors from the dashboard page
            var dashboard = report.Pages[0] as StiDashboard;

            ViewBag.DashboardBackHtmlColor = ColorTranslator.ToHtml(dashboard != null ? StiDashboardStyleHelper.GetDashboardBackColor(dashboard, true) : Color.White);
            ViewBag.BackHtmlColor          = ColorTranslator.ToHtml(dashboard != null ? StiDashboardStyleHelper.GetBackColor(dashboard) : Color.White);
            ViewBag.ForeHtmlColor          = ColorTranslator.ToHtml(dashboard != null ? StiDashboardStyleHelper.GetForeColor(dashboard) : Color.Black);
            // Then use it on the _Layout.cshtml

            return(View());
        }
        ///Modified by Ken Huynh, 4/19/2020, adding more templates and comboBox

        private void buttonDesigner_Click(object sender, EventArgs e)
        {
            var report = StiReport.CreateNewDashboard();

            if (cmbTemplates.SelectedValue != null)
            {
                string key   = ((KeyValuePair <String, String>)cmbTemplates.SelectedItem).Key;
                string value = ((KeyValuePair <String, String>)cmbTemplates.SelectedItem).Value;
                //MessageBox.Show(key + " , " + value);
                report.Load(value);
            }
            else
            {
                report.Load("Dashboards\\Christmas.mrt");
            }

            report.Design();
        }
Esempio n. 24
0
        public static StiReport CreateTemplate()
        {
            var report    = StiReport.CreateNewDashboard();
            var dashboard = report.Pages[0] as StiDashboard;

            var textElement = new StiTextElement();

            textElement.Left        = 100;
            textElement.Top         = 100;
            textElement.Width       = 300;
            textElement.Height      = 100;
            textElement.Text        = "Sample Text";
            textElement.Border.Side = StiBorderSides.All;
            textElement.BackColor   = Color.LightGray;

            dashboard.Components.Add(textElement);

            return(report);
        }
        private void buttonJson_Click(object sender, EventArgs e)
        {
            textBoxLog.Clear();

            var report = StiReport.CreateNewDashboard();

            textBoxLog.Text += "New dashboard created\r\n";

            if (cmbTemplates.SelectedValue != null)
            {
                string key   = ((KeyValuePair <String, String>)cmbTemplates.SelectedItem).Key;
                string value = ((KeyValuePair <String, String>)cmbTemplates.SelectedItem).Value;
                report.Load(value);
            }
            else
            {
                report.Load("Dashboards\\Dashboard.mrt");
            }
            //report.Load("Dashboards\\Dashboard.mrt");

            textBoxLog.Text += "Dashboard template loaded\r\n";

            var jsonBytes = File.ReadAllBytes("Dashboards\\Demo.json");

            textBoxLog.Text += "Load a JSON file\r\n";

            var json    = StiJsonConnector.Get();
            var dataSet = json.GetDataSet(new StiJsonOptions(jsonBytes));

            textBoxLog.Text += "Get DataSet from JSON file\r\n";

            report.Dictionary.Databases.Clear();
            textBoxLog.Text += "Remove all connections from the dashboard template\r\n";

            report.RegData("Demo", "Demo", dataSet);
            textBoxLog.Text += "Register DataSet object\r\n";

            report.Show(false);
            textBoxLog.Text += "Show Dashboard\r\n";
        }
        protected void StiWebViewer1_GetReport(object sender, StiReportDataEventArgs e)
        {
            // Create new dashboard
            var report = StiReport.CreateNewDashboard();

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

            // Load a JSON file
            var jsonBytes = 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);

            // Show dashboard in the Web Viewer
            e.Report = 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));
        }
        private void buttonNew_Click(object sender, EventArgs e)
        {
            var report = StiReport.CreateNewDashboard();

            report.Design();
        }