combit List & Label 29 - .NET Help
In This Topic
    combit.ListLabel29 Assembly
    In This Topic
    Namespaces
    NamespaceDescription
    The main component which holds all important List & Label base functions for print and design. Comfortable class wrappers are available. Advice for their usage can be found in this help.
    The DataProviders namespace contains all available DataProviders for List & Label. They allow to connect directly to sources like SqlConnection, XML files or object hierarchies. The interfaces contained in this namespace also allow to write custom DataProviders to connect to sources not covered so far.
    The DesignerExtensions namespace contains classes and interfaces that deal with extending the Designer. These classes can be used to create rich DesignerObjects for example.

    To create project files dynamically at runtime or to edit project files via code, you can work with the List & Label DOM functions. Comfortable class wrappers are available. Advice for their usage can be found in this help.

    To create a new project, you need the Open Method of the ProjectBase Class. To edit existing projects, use the GetFromParent Method.

    Important note: It is also possible when opening a project with DOM to specify that any errors should be ignored when editing. So it is possible to edit the project file even without accessing the original data source.

    But changes to the (data-) structure of the project, which are based on formulas or variables/fields of the data source, can not be considered and implemented. Because without data source then the formulas in the project are treated like placeholders, and thus then the section with the used variables (see LlGetUsedIdentifiers()) cannot be written correctly, if you append e.g. in a table further columns. The content of this section is then left unchanged when saving. The same applies in case a new table is inserted in a report container, which was not used before. In addition, the DOM types of individual elements in the project file cannot be correctly identified in this case.

    Only when the data source in the ListLabel object used is also known can the project be processed with DOM completely and without restrictions. Only then can any formulas etc. be interpreted to use the correct DOM type.

     

    If reports are to be used in distributed applications such as web applications, all required files need to be shared between the systems involved or between the client and the server and kept synchronized at all times. Hence, it is a good idea to save the project files in a central database. However, this solution can become rather complex, especially when a project references pictures, drilldown projects, and other external files via local data paths, which then also need to be valid on another system.


    With repository mode, the use of local files in a project can be done away with entirely, and List & Label projects as well as all the files they require can be managed at a central location (the so-called repository) with little effort - such as in a database or by a web service.

     

    Basic Principles

    In repository mode, List & Label does not save and load the files used in a report on its own. Instead of file paths and names, unique repository IDs are used. You will need to implement the IRepository Interface yourself and pass it to the ListLabel object. From this point onwards, List & Label will query your user-defined repository for the file content belonging to a repository ID, or transmit the ID along with the corresponding file content to the repository to be saved. Whether the files in the repository are managed by an SQL database, a web service, or some other storage solution depends entirely on your IRepository implementation. In this case, loading and saving of entries in the repository takes place exclusively via streams.
    The following schematic diagram shows how a report with the ID "123" is loaded via an IRepository implementation managing an internal SQL database:

     

    Implementation

    All functions to which the file path of the project was previously passed are now assigned the repository ID instead:

    // Without repository mode:
    LL.Design(LlProject.List, "C:\Reports\Invoice.lst")
    
    // With repository mode — also applies to Export() and/or Print():
    LL.FileRepository = new MyCustomRepository(…);
    LL.Design(LlProject.List, "repository://{53F875F0-6177-8AD5-01B44E3A9867}")
    

    In repository mode, "files" become "repository items", and filenames become "repository IDs". In addition to its ID, each repository item possesses a type, a time stamp, and a descriptor (string with variable length which contains internal information). Hence, in addition to the file content, your repository implementation will also need to be able to save and retrieve at least these four pieces of information for each repository item.

     

    Here you can find a instruction how to use the repository:

    Using the Repository-Mode

     

    You will find a complete simple repository implementation in the ASP.NET sample projects (class SQLiteFileRepository) which provides a repository with an SQLite database for data storage.

     

    Tips

    • Use the class RepositoryImportUtil to import existing local files and/or create new projects in the repository.
    • You can use the RepositoryItemDescriptor class to change the display name shown in the selection dialogs in the Designer instead of the internal repository ID.
    • Accessing the repository takes place sequentially. However, if you use the same repository object for multiple List & Label instances, or if the data storage used is not thread-safe, then synchronization is required.
    • Web applications: In order to be able to add large files into the repository, the two parameters maxRequestLength and executionTimeout should be set in the web.config to sufficiently large values. This is also shown in the included ASP.NET samples:
      ...
      <system.web>
          <!-- combit: adapt maxRequestLength and executionTimeout when uploading huge files -->
          <httpRuntime targetFramework="4.8" maxRequestLength="200000" executionTimeout="600" />
          <!-- ... -->
      </system.web>
      ...