Unable to retrieve data from MySQL

Stimulsoft Reports.NET discussion
Post Reply
AdrianFS
Posts: 16
Joined: Mon Jul 25, 2011 4:36 pm

Unable to retrieve data from MySQL

Post by AdrianFS »

I am trying to evaluate Stimulsoft Reports but I am having trouble retrieving any data.

In a C# application (Visual Studio 2010) I added a DataSet (DataSet1) and using the Server Explorer added one of my database tables. When I right-click on the table and click Preview Data it shows the records from the table. On my form I added a typed dataset as an instance of that DataSet1 class. I put a StiReport on the form, right-click Choose Data Sources, and selected DataSet1.

Now when I right-click the StiReport and select Design Report, DataSet1 is listed under Data Sources. My table is listed under DataSet1 with all of the columns, but when I right-click on the table and select View Data there are no records in the list. If I create a Data band with that table it doesn't print anything.

I can see the records from Visual Studio but I can't get them to show up in the report. What am I doing wrong?


Thank you very much.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Unable to retrieve data from MySQL

Post by Alex K. »

Hello,

This is correct. If you select Design Report from the context menu in the Visual Studio, then only data structure will be passed to a report, the data in this case cannot be obtained.

Thank you.
AdrianFS
Posts: 16
Joined: Mon Jul 25, 2011 4:36 pm

Unable to retrieve data from MySQL

Post by AdrianFS »

Thank you very much for your response.

Unfortunately I am not able to access the data at runtime either. After my report is designed I added the following code to a button-click event:


StiReport report = new StiReport();
report.Load("C:\\JobList.mrt");

//DataSet1 has been added to the solution with the tables from the Server Explorer.
DataSet1 reportDataSet = new DataSet1();
report.RegData(reportDataSet);

report.Show();


The report still shows no data. What am I missing?

Thank you.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Unable to retrieve data from MySQL

Post by Ivan »

Hello,

Please try to modify your code:

Code: Select all

            StiReport report = new StiReport();
            report.Load("C:\\JobList.mrt");

            //DataSet1 has been added to the solution with the tables from the Server Explorer.
            DataSet1 reportDataSet = new DataSet1();

            yourTableAdapter.Fill(this.reportDataSet);

            report.RegData(reportDataSet);
            report.Show();
Thank you.
AdrianFS
Posts: 16
Joined: Mon Jul 25, 2011 4:36 pm

Unable to retrieve data from MySQL

Post by AdrianFS »

That worked great, thank you very much!
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Unable to retrieve data from MySQL

Post by Andrew »

Hello,

Perfect.

Let us know if you have additional questions.
Thank you.
Post Reply