combit List & Label 30 - .NET Help
combit.Reporting.Dom Namespace / ProjectBase Class / GetFromParent Method
Example


GetFromParent Method

Allows to directly modify the project currently in use, e.g. after starting a print job. If a project is already opened, it will be closed. In databound mode this method has to be called in the context of the DefinePrintOptions event (see example below), as that is the exact point where the print project is opened and initialized. Can be used to change the project during printing with DOM functions for printing/exporting - the changes are only temporary and are not persistent or are not saved in the project.

Syntax
'Declaration
 
Public Sub GetFromParent() 
 
Remarks

To create new projects or to edit projects persistently before printing/exporting, use the calls Open, GetFromParent, Save und Close.

Example
private void LL_DefinePrintOptions(object sender, EventArgs e)
{
    // Create new DOM project of type LlProject.List
    ProjectList proj = new ProjectList(LL);

    // No proj.Open() is required. Instead the project of the component is used
    proj.GetFromParent();

    // Get Text object "Headline"
    ObjectText text = (ObjectText)proj.Objects["Headline"];
    
    // Create new paragraph
    Paragraph paragraph = text.Paragraphs.AddNew();
    paragraph.Font.SetFont(new Font("Courier New", 12));
    paragraph.Contents = "'Added text'";

}
Requirements

Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
.NET: .NET Framework 4.8, .NET 6, .NET 8, .NET 9

See Also