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";
        }
        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 IActionResult GetReport(string id)
        {
            // Create new report
            var report = new StiReport();

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

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

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

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

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

            // Return template to the Viewer
            return(StiNetCoreViewer.GetReportResult(this, 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));
        }