?
Solved

How do you get MySql Data into Active Reports?

Posted on 2009-05-06
4
Medium Priority
?
1,911 Views
1 Endorsement
Last Modified: 2012-05-06
I am learning about how to use Active Reports.  It looks very straight forward but they have their own custom DataSource object that holds and requests the data for the report.

For example their sample shows to get the data from MS Jet ODBC 4.0 you would use -->
this.DataSource = new DataDynamics.ActiveReports.DataSources.OleDBDataSource("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Program Files (x86)\\Data Dynamics\\ActiveReports for .NET 3.0\\Data\\NWIND.MDB;Persist Security Info=False", "SELECT Categories.*, Products.*\r\nFROM Categories INNER JOIN Products ON Categorie" +
                        "s.CategoryID = Products.CategoryID\r\nORDER BY Categories.CategoryName;", 30);

Then when the fetch data is fired the data is grabbed.


But My Database is MySql.  I can get data from the MySql and put it into a
System.Data.DataTable or System.Data.DataSource objects but cannot figure out how to hook this object to the report data.

Help on this matter is greatly appreciated.
1
Comment
Question by:dwkrueger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:Wikkard
ID: 24321826
1. You will need to get the odbc connector for mySQL. http://dev.mysql.com/downloads/connector/odbc/

2. Then you need to create an ODBC data source for your mySQL database.

3. Once this is done you can build you active report.  Add a new active report to your project.

4. Now you need an OLEDB datasource for your report.  This datasource should use the "OLEDB provider for ODBC".

5.  Then you can select the ODBC connection made in step 2, as the data source for your report.

Hope this helps

0
 

Author Comment

by:dwkrueger
ID: 24321916
I've got the connector.  I know this sounds odd but I have always connected at runtime.  I have never relied on the 'Visual Studio Environment' to maintain my connectors.
So can you please elaborate on step #2.  How is this done? Attached is how I have been doing this.  This is a funny problem becuase I have been doing this for years and for others out there I am sure that  the step of "create an ODBC data source for your mySQL database."  probably seems so basic that anybody should know this.
 
Thanks in advance.
Dan

string conString = "Server=" + m_ConData1.ComputerName
                + ";Database=" + m_ConData1.Database
                + ";User ID=" + m_ConData1.DbUser
                + ";Password=" + m_ConData1.Password
                + ";CharSet=" + m_ConData1.CharacterSet;
MySql.Data.MySqlClient.MySqlConnection con = new MySql.Data.MySqlClient.MySqlConnection(conString)
 
 con.Open();
                System.Data.DataTable WorkingTable = new System.Data.DataTable();
                MySql.Data.MySqlClient.MySqlDataAdapter da = new MySql.Data.MySqlClient.MySqlDataAdapter(command, con);
                da.Fill(WorkingTable);

Open in new window

0
 
LVL 8

Accepted Solution

by:
Wikkard earned 2000 total points
ID: 24324513
The problem I think is that active reports custom datasource probably cant work with ado.net providers other than the basic oledb and sql ones. Im guessing the oracle provider or mysql data providers arent supported.

To configure the odbc connection follow the following steps:
Going to control panel -> administrative tools -> data sources (odbc). Then go to the system dsn tab and click add. On the first step of the wizard select the mysql odbc driver then fill out the connection details. If you dont see the mysql odbc driver then you need to get it http://dev.mysql.com/get/Downloads/Connector-ODBC/5.1/mysql-connector-odbc-5.1.5-win32.msi/from/pick (but you said you did already).

Once you finish the wizard you should be able to access this odbc data source with active reports using the oledb odbc driver.

0
 

Author Comment

by:dwkrueger
ID: 24332401
I did find an example that illustrated using the same modality of connecting to the database at runtime.  In the ActiveReports for .net 3 user guid the Sample of "Unbound Data Sample"  on Page 180 of this pdf guide shows how to Connect datatables and other data  to the report.
Using the unbound data it does not matter where the data comes from and any method of collecting the data can then be used.
http://www.datadynamics.com/ 
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question