|
Crystal Report XI Изменение параметров подключения в Runtime
|
|||
---|---|---|---|
#18+
Отчеты созданы в Crystal Report XI (полная версия) SP1 В качестве источника данных используются хранимые процедуры, все отчеты были сделаны используя Integrated Security В программе необходимо изменить параметры подключения и тип подключения Нашел статью http://support.businessobjects.com/communityCS/TechnicalPapers/crxi_r2_net_integrated_and_sql_authentication.pdf Делаю аналогичным образом но в результате при Integrated все работает, когда IntegratedSecurity устанавливается в false то сначала вылетает окно подключения с верными параметрами, потом Login failed: ReportDocument report = new ReportDocument(); report.Load("k1_r1.rpt"); TableLogOnInfo tableLogOn = new TableLogOnInfo(); ConnectionInfo crConnectionInfo = new ConnectionInfo(); crConnectionInfo.ServerName = sServer; crConnectionInfo.DatabaseName = sDatabase; crConnectionInfo.UserID = sUser; crConnectionInfo.Password = sPassword; if (sUser.Length==0) { //crConnectionInfo.IntegratedSecurity = true; report.DataSourceConnections[0].IntegratedSecurity = true; } else { //crConnectionInfo.IntegratedSecurity = false; report.DataSourceConnections[0].IntegratedSecurity = false; } for (int i=0;i<report.Database.Tables.Count;i++) { tableLogOn = report.Database.Tables .LogOnInfo; tableLogOn.ConnectionInfo = crConnectionInfo; report.Database.Tables.ApplyLogOnInfo(tableLogOn); report.Database.Tables.Location = report.Database.Tables.Location.Substring(report.Database.Tables.Location.LastIndexOf(".")+1); } CRViewer.ReportSource = report; ... |
|||
:
Нравится:
Не нравится:
|
|||
14.04.2006, 11:50 |
|
|
start [/forum/topic.php?fid=31&tid=1539097]: |
0ms |
get settings: |
9ms |
get forum list: |
12ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
138ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
30ms |
get tp. blocked users: |
1ms |
others: | 268ms |
total: | 475ms |
0 / 0 |