combit List & Label 24 - .NET Online Web Help
Print Card With Simple Placeholders
Programming Introduction > Examples > General > Print Card With Simple Placeholders

Printing a full-page project which simply contains placeholders set by the application is achieved easily by binding it to a suitable object.

public class DataSource
{
    public string Text1 { get; set; }
    public double Number1 { get; set; }
    // ...
}

//...

using (ListLabel LL = new ListLabel())
{
    // Prepare data source
    object dataSource = new DataSource { Text1 = "Test", Number1 = 1.234 };

    // Define/Assign data source
    LL.DataSource = new ObjectDataProvider(dataSource);

    // Select card as project type
    LL.AutoProjectType = LlProject.Card;

    // Call the Designer
    LL.Design();

    // Print
    LL.Print();
}
Public Class DataSource
    Public Property Text1() As String
        Get
            Return m_Text1
        End Get
        Set
            m_Text1 = Value
        End Set
    End Property
    Private m_Text1 As String

    Public Property Number1() As Double
        Get
            Return m_Number1
        End Get
        Set
            m_Number1 = Value
        End Set
    End Property
    Private m_Number1 As Double

    ' ...
End Class

'...

Using LL As New ListLabel()
    ' Prepare data source
    Dim dataSource As Object = New DataSource() With { _
        Key .Text1 = "Test", _
        Key .Number1 = 1.234 _
    }

    ' Define/Assign data source
    LL.DataSource = New ObjectDataProvider(dataSource)

    ' Select card as project type
    LL.AutoProjectType = LlProject.Card

    ' Call the Designer
    LL.Design()

    ' Print
    LL.Print()
End Using