Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do you get MySql Data into Active Reports?

Posted on 2009-05-06
4
Medium Priority
?
1,940 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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 …
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
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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