You can change the user name and password to a subreport, or set its database to a different location, using the ReportClientDocument class. It lets you retrieve the database object for a subreport, which contains tables from one or more databases. Using this object, you can change the subreport logon information.
|
Visual Basic |
|
|
Dim database As Database = rcd.SubreportController.GetSubreportDatabase(subreportName) |
|
|
C# |
|
|
Database database = rcd.SubreportController.GetSubreportDatabase(subreportName); |
|
This sample gets the first database table.
|
Visual Basic |
|
|
Dim table As ISCRTable = database.Tables(0) |
|
|
C# |
|
|
ISCRTable table = database.Tables[0]; |
|
|
Visual Basic |
|
|
Dim newTable As ISCRTable = table.Clone(False) |
|
|
C# |
|
|
ISCRTable newTable = table.Clone(false); |
|
|
Visual Basic |
|
|
newTable.ConnectionInfo.UserName = "username" |
|
|
C# |
|
|
newTable.ConnectionInfo.UserName = "username"; |
|
|
Visual Basic |
|
|
rcd.SubreportController.SetTableLocation(subreportName, table, newTable) |
|
|
C# |
|
|
rcd.SubreportController.SetTableLocation(subreportName, table, newTable); |
|
|
Visual Basic |
|
|
Private Sub SubreportLogon(ByVal rcd As ISCDReportClientDocument, ByVal subreportName As String) |
|
|
C# |
|
|
private void SubreportLogon(ISCDReportClientDocument rcd, string subreportName) |
|
This list includes the namespaces used by the sample code:
© 2021 SAP AG. All rights reserved.
http://www.sap.com/sapbusinessobjects/
Support services
http://service.sap.com/bosap-support/
Created with the Personal Edition of HelpNDoc: Free Web Help generator