Re: C# and Crystal Report
I hope this will be of some help to you, please visit this site, and let me know if it helps! I'm not too familiar with Crystal Reports, but if you ever have any questions regarding SQL Server Reporting Services (SSRS) as a Crystal Reports alternative, feel free to message me.
Regards,
Quinn
If this helps, please rate up!
Re: C# and Crystal Report
thanks for the reply quinn. i will check on the site.
regards,
kiko
Re: C# and Crystal Report
hi quinn,
the solution on the site didn't worked. the ReportDocument is still pointing on the view which was used during during the design time.
regards,
kiko
Re: C# and Crystal Report
to add further info, is there a way to dynamically change the table.LogOnInfo.TableName ?
ie:
Code:
table.LogOnInfo.TableName = "dynamic view or tablename"
Re: C# and Crystal Report
Quote:
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*".