Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Report Class / RemoveReportSources Method
Collection of source documents.
Example
In This Topic
    RemoveReportSources Method
    In This Topic
    Remove some sources of this report.
    Syntax
    public void RemoveReportSources( 
       IEnumerable<DerivationSource> sources
    )

    Parameters

    sources
    Collection of source documents.
    Exceptions
    ExceptionDescription
    This file is not opened.
    You can not perform this action on a document opened as read only.
    Argument is null.
    Remarks
    Remove one or more sources from which this report is derived.
    Example
    The following example shows how to remove report sources from the currently open report.
    // Report was obtained before...
    // Report report = ...
    
    report.Open(false, false);
    
    // Remove a wire harness from report sources of this report.
    report.RemoveReportSources(report.GetAllWireHarnessInfos().Where(s => s.Name == "harness_00001"));
    
    // Remove a cable unit from report sources of this report.
    report.RemoveReportSources(report.GetAllCableUnitInfos().Where(s => s.Name == "Cable unit:1"));
    
    // Remove both - wire harness and cable unit.
    List<DerivationSource> desiredSources = new List<DerivationSource>();
    desiredSources.AddRange(report.GetAllWireHarnessInfos().Where(s => s.Name == "harness_00001"));
    desiredSources.AddRange(report.GetAllCableUnitInfos().Where(s => s.Name == "Cable unit:1"));
    
    report.RemoveReportSources(desiredSources);
    
    // Save and close this report.
    report.Save();
    report.Close();
    See Also