Page 1 of 1

use dataset for dashboard

Posted: Thu Apr 23, 2020 9:32 pm
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

Re: use dataset for dashboard

Posted: Mon Apr 27, 2020 10:55 am
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.