|
-
October 12th, 2011, 10:58 PM
#6
Re: C# and Crystal Report
 Originally Posted by kikoph
to add further info, is there a way to dynamically change the table.LogOnInfo.TableName ?
ie:
Code:
table.LogOnInfo.TableName = "dynamic view or tablename"
In leiu of that question, from that link I gave,
Code:
private void AssignConnectionInfo(ReportDocument document,ConnectionInfo crConnection)
{
foreach (CrystalDecisions.CrystalReports.Engine.Table table in document.Database.Tables)
{
TableLogOnInfo logOnInfo = table.LogOnInfo;
if (logOnInfo != null)
{
table.ApplyLogOnInfo(table.LogOnInfo);
table.LogOnInfo.TableName = table.Name;
table.LogOnInfo.ConnectionInfo.UserID = crConnection.UserID;
table.LogOnInfo.ConnectionInfo.Password = crConnection.Password;
table.LogOnInfo.ConnectionInfo.DatabaseName = crConnection.DatabaseName;
table.LogOnInfo.ConnectionInfo.ServerName = crConnection.ServerName;
CrystalReportViewer1.LogOnInfo.Add(table.LogOnInfo);
}
}
}
Apparently, according to http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx, that TableName is just passed as a "String*".
Last edited by QuinnJohns; October 12th, 2011 at 11:03 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|