Solved

How do you get MySql Data into Active Reports?

Posted on 2009-05-06
4
1,843 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 500 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

733 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