Store Project Files in a Database

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:

  It is not possible to create a new project in the Designer

  The menu items File > Save as and File > Open are not available

  Project includes are deactivated

  Drilldown is not available

  The Designer function "ProjectPath$” is not available

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 chapter Repository Mode for Distributed (Web) Applications.

ListLabel LL = new ListLabel();
LL.DataSource = CreateDataSet();

byte[] report = GetReportFromDatabase();

MemoryStream memStream = new MemoryStream(report);

 

LL.Print(LlProject.List, memStream);

LL.Dispose();