use dataset for dashboard

Stimulsoft Dashboards.WEB discussion
Post Reply
luigi.arena
Posts: 36
Joined: Thu Feb 12, 2015 12:49 am

use dataset for dashboard

Post by luigi.arena »

Hello,
I want to pass dataset to my report but the report is empty this is my code in controller:

Code: Select all

 public IActionResult GetReport()
        {
            SqlConnection connection = new SqlConnection(@"Server=.\MSSQLSERVERNEW;Database=xxdat;Trusted_Connection=True;");

            string queryString = "SELECT *  FROM customer";
            SqlDataAdapter adapter = new SqlDataAdapter(queryString, connection);

            DataSet customers = new DataSet();
            adapter.Fill(customers, "Customers");

            StiReport report = new StiReport();
            report.Load(StiNetCoreHelper.MapPath(this, "Report/report.mrt"));
            report.Dictionary.Databases.Clear();
            report.RegData("errords", "errords", customers);
            report.Dictionary.Synchronize();
            return StiNetCoreViewer.GetReportResult(this, report);
                        
        }
In attachment my report
thank
Attachments
Report.mrt
(4.63 KiB) Downloaded 154 times
Lech Kulikowski
Posts: 6259
Joined: Tue Mar 20, 2018 5:34 am

Re: use dataset for dashboard

Post by Lech Kulikowski »

Hello,

The data source and columns should have the same names. Please check that DataTable in your dataset with "errords" name.

Thank you.
Post Reply