combit List & Label 29 - .NET Help
Programming Introduction / Examples / General / Store Project Files in a Database
In This Topic
    Store Project Files in a Database
    In This Topic

    Project files can also be stored in a database. Besides the option to unpack these directly from the database and to store them in the local file system, this job can be passed to List & Label as well. The Print and Design methods have both overloads that allow passing a stream directly.

    When using these overloads, a few important changes in how these methods work are to be obeyed. The background for these changes is the missing local file context and therefore the missing possibility to create new files:

    In the case of designing it can happen of course that the passed stream is being modified. In this case you have to write the updated stream into the database after designing.

     

    However, the use of the repository mode is a more elaborate approach - without any restrictions in the designer. The basic structure and references to sample implementations can be found in the namespace combit.Reporting.Repository.

     

    using (ListLabel LL = new ListLabel())
    {
        // Define/Assign data source
        LL.DataSource = CreateDataSet();
    
        byte[] report = GetReportFromDatabase();
        MemoryStream memStream = new MemoryStream(report);
    
        // Print
        LL.Print(LlProject.List, memStream);
    }
    
    Using LL As New ListLabel()
        ' Define/Assign data source
        LL.DataSource = CreateDataSet()
    
        Dim report As Byte() = GetReportFromDatabase()
        Dim memStream As New MemoryStream(report)
    
        ' Print
        LL.Print(LlProject.List, memStream)
    End Using