Below is my code sample:
DataSet dataSet;
ConnectionInfo conn = new ConnectionInfo();
conn.DatabaseName = "test";
conn.ServerName = "test_server";
conn.UserID = "test_user";
conn.Password = "xxxx";
//Store the above connection info into a hash -- this is temp
Hashtable _conn = new Hashtable();
_conn.Add("TEST", conn);
_myRPT = new ReportDocument();
_tableLogins = new TableLogOnInfos();
//Load the Crystal template
_myRPT.Load(crystalReportPath + "test.rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy);
//Read all the tables from Crystal report
foreach (Table tbl in _myRPT.Database.Tables)
{
//If the table name matches the connection hash
if (_conn.ContainsKey(table.Name))
{
TableLogOnInfo _info = table.LogOnInfo;
_info.ConnectionInfo = (ConnectionInfo)htCon[table.Name];
table.ApplyLogOnInfo(_info);
_tableLogins.Add(_info);
}
}
/* Set up the parms */
_myRpt.Refresh();
I think it looks like it does not bind the data to the crystal template.. I thought that _myRpt reporting object should contain all the data from the above logic.. so, I can just take the object and call the export by passing the export options.
What am i doing wrong?
Thanks