Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

crystal reports data source in design sql in runtime mdb?

$
0
0

hi everyone,

i have a crystal reports designed with datasource from ms sql 2008 server on Crystal Reports 2011 . But in runtime there is an option in c# program to use mdb as datasource. Now my question is is there an opportunity to use mdb as datasource to connect  this report file?   tables names and columns names are identically in mdb and sql db.

here a picture from designmode

http://social.msdn.microsoft.com/Forums/getfile/273497

and here a line of code i use in runtime for mdb connection but it's not working .

 

TableLogOnInfo logOnInfo;

                ConnectionInfo connectionInfo = new ConnectionInfo();

 

 

                cryRpt.Load(@"c:\********.rpt");

 

                connectionInfo.Type = ConnectionInfoType.CRQE;

                connectionInfo.ServerName = connectionInfo.DatabaseName = @"C:\**************.mdb";

                connectionInfo.UserID = null;

                connectionInfo.Password = "";

                 connectionInfo.AllowCustomConnection = false;

                connectionInfo.IntegratedSecurity = false;

 

 

 

                foreach (Table table in cryRpt.Database.Tables)

                {

 

 

 

                    logOnInfo = table.LogOnInfo;

                    logOnInfo.ConnectionInfo = connectionInfo;

                    logOnInfo.TableName = table.Name;

 

 

                    table.ApplyLogOnInfo(logOnInfo);

 

 

 

                    table.TestConnectivity();

 

 

                }

 

                crystalReportViewer1.ReportSource = cryRpt;

                crystalReportViewer1.Refresh();

Any suggestions are welcome

thanks by advance


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>