|
-
October 12th, 2011, 09:21 PM
#1
C# and Crystal Report
Hi C#Sharp and Crystal Report Guru,
Please help or guide me on my problem regarding passing a datasource to crystal report.
Scenario:
Crystal Report files are created and pointed to a Database View (ie VW_DATA)
Problem:
Using CrystalReportViewer and ReportDocument, how to dynamically point a ReportDocument to use different database VIEW aside from using the VW_DATA?
Please help me on this one.
Thanks heaps Gurus!
Student,
Kiko
-
October 12th, 2011, 10:15 PM
#2
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!
-
October 12th, 2011, 10:26 PM
#3
Re: C# and Crystal Report
thanks for the reply quinn. i will check on the site.
regards,
kiko
-
October 12th, 2011, 10:47 PM
#4
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
-
October 12th, 2011, 10:49 PM
#5
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"
-
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
|