|
Report Application Server .NET SDK Developer Guide |
|
To modify a subreport with the SubreportClientDocument class |
|
|
You can programmatically modify the structure of a subreport. This example shows how to modify the background color of the first field object in the subreport. The workflow for modifying a subreport is the same as for modifying a report. Use the main report's SubreportController class to retrieve an ISubreportClientDocument interface, and then use the standard controllers to modify the subreport.
|
Visual Basic |
|
|
Dim subreportController As SubreportController = rcd.SubreportController |
|
|
C# |
|
|
SubreportController subreportController = rcd.SubreportController; |
|
|
Visual Basic |
|
|
Dim subreportClientDocument As SubreportClientDocument = subreportController.GetSubreport(subreportName) |
|
|
C# |
|
|
SubreportClientDocument subreportClientDocument = subreportController.GetSubreport(subreportName); |
|
|
Visual Basic |
|
|
Dim subreportDefController As ReportDefController2 = subreportClientDocument.ReportDefController |
|
|
C# |
|
|
ReportDefController2 subreportDefController = subreportClientDocument.ReportDefController; |
|
|
Visual Basic |
|
|
Dim subreportObjectController As ReportObjectController = subreportDefController.ReportObjectController |
|
|
C# |
|
|
ReportObjectController subreportObjectController = subreportDefController.ReportObjectController; |
|
This example sets the background color of the field to java.awt.Color.YELLOW.
|
Visual Basic |
|
|
Dim newObject As FieldObject = DirectCast(fieldObject.Clone(True), FieldObject) |
|
|
C# |
|
|
FieldObject newObject = (FieldObject)fieldObject.Clone(true); |
|
|
Visual Basic |
|
|
subreportObjectController.Modify(fieldObject, newObject) |
|
|
C# |
|
|
subreportObjectController.Modify(fieldObject, newObject); |
|
This sample sets the background colour to yellow for the first field object in the subreport.
|
Visual Basic |
|
|
Private Sub ModifySubreportClientDocument(ByVal rcd As ISCDReportClientDocument, ByVal subreportName As String) |
|
|
C# |
|
|
private void ModifySubreportClientDocument(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: Easily create Help documents