Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Report Class / AddReportSources Method
Collection of source documents.
Example
In This Topic
    AddReportSources Method
    In This Topic
    Add new sources for this report.
    Syntax
    public void AddReportSources( 
       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
    Add one or more wire harnesses and/or cable units.
    Example
    The following example shows how to add report sources to the currently open report.
    // Report was obtained before...
    // Report report = ...
    
    report.Open(false, false);
    
    // Add a wire harness as a report source.
    report.AddReportSources(report.GetAllWireHarnessInfos().Where(s => s.Name == "harness_00001"));
    
    // Add a cable unit as a report source.
    report.AddReportSources(report.GetAllCableUnitInfos().Where(s => s.Name == "Cable unit:1"));
    
    // Add 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.AddReportSources(desiredSources);
    
    // Save and close this report.
    report.Save();
    report.Close();
    See Also