![]() ![]() For example, when you are reporting off of a Northwind database on SQL server you should have the following line of code:ĬrTable.Location = "Northwind.dbo." ((".") 1) If your DatabaseName is changing at runtime, specify the table location. Loop through all tables in the report and apply the connection information for each table.ĬrTableLogOnInfo.ConnectionInfo = crConnectionInfo ĬrTable.ApplyLogOnInfo(crTableLogOnInfo) ![]() This code works for both user tables and stored procedures. Get the table information from the report crConnectionInfo.DatabaseName = "" ĬrConnectionInfo.DatabaseName = "DatabaseName" ĬrConnectionInfo.Password = "Your Password" If you are connecting to Oracle there is no DatabaseName. If using OLEDB, etc, this should be the physical server nameĬrConnectionInfo.ServerName = "DSN or Server Name" If using ODBC, this should be the DSN. Setup the connection information structure to log on to the data source for the report. Private ConnectionInfo crConnectionInfo = new ConnectionInfo () Private CrystalReport1 crReportDocument = new 'Set the viewer to the report object to be previewed.ĬrystalReportViewer1.ReportSource = crReportDocument 'For example, when you are reporting off of a Northwind database on SQL server you should have the following line of code:ĬrTable.Location = "Northwind.dbo."
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |