ReportPartNodes.Add Method
Adds a ReportPartNode object to the collection.
Namespace CrystalDecisions.Web Assembly CrystalDecisions.Web (CrystalDecisions.Web.dll)
Syntax
'Declaration
Public Sub Add ( _
ByVal node As CrystalDecisions.Web.ReportPartNode _
)
public void Add (
CrystalDecisions.Web.ReportPartNode node
)
Parameters
- node
The ReportNode object to add to the collection.
Example
The following example checks for existence of a report part node to ensure uniqueness of each node in the ReportPartNodes collection.
'Declaration
Private Sub AddUnique(ByVal myCrystalReportPartsViewer As CrystalReportPartsViewer, _
ByVal myReportPartNode As ReportPartNode)
Dim myReportPartsDefinition As ReportPartsDefinition = myCrystalReportPartsViewer.ReportParts
Dim myExistingReportPartNode As ReportPartNode = _
myReportPartsDefinition.ReportPartNodes.Item(myReportPartNode.Name)
If (myExistingReportPartNode Is Nothing) Then
myReportPartsDefinition.ReportPartNodes.Add(myReportPartNode)
End If
End Sub
private void AddUnique(CrystalReportPartsViewer crystalReportPartsViewer,
ReportPartNode reportPartNode)
{
ReportPartsDefinition reportPartsDefinition = (ReportPartsDefinition)crystalReportPartsViewer.ReportParts;
ReportPartNode existingReportPartNode = reportPartsDefinition.ReportPartNodes[reportPartNode.Name];
if (existingReportPartNode == null)
{
reportPartsDefinition.ReportPartNodes.Add(reportPartNode);
}
}
Version Information
Crystal Reports Basic for Visual Studio 2008
Supported since: Crystal Reports for Visual Studio .NET 2002
See Also
Reference
ReportPartNodes Class
ReportPartNodes Members
CrystalDecisions.Web Namespace