Coder Social home page Coder Social logo

devexpress-examples / reporting_winforms-eud-how-to-create-a-control-template-gallery-with-reusable-control-sets-t341218 Goto Github PK

View Code? Open in Web Editor NEW
0.0 57.0 0.0 299 KB

.NET, WinForms, XtraReports Suite

License: Other

C# 49.49% Visual Basic .NET 50.51%
dotnet xtrareports-suite winforms

reporting_winforms-eud-how-to-create-a-control-template-gallery-with-reusable-control-sets-t341218's Introduction

With version 17.1, we introduced the Report Gallery out of the box. It lets you store report controls, data sources, layouts and styles, and keep them for later use. Click the following links for more details.
Video: Reporting: The Report Gallery
Documentation: Report Gallery




Files to look at:

WinForms EUD - How to create a Control Template Gallery with reusable control sets

This example demonstrates how to add the capability to save selected controls and reuse them in this or other reports like UserControls in standard Windows Forms applications. Starting with the version 17.1, the Report Gallery is available in WinForms End-User Report Designer out of the box, so writing any code is no longer required to implement this functionality.

Implementation Details:
In the scope of this example, we add a custom End-User Designer DockPanel and fill it from the predefined storage (if this storage is not empty), which can be passed to the constructor or Storage property of a custom ReportDesignTool descendant. The storage should implement the IControlTemplateStorage interface, which declares the following members:

- GetCategoryNames. This method should return string representations of all template categories in your storage.
- GetTemplateNamesForCategory. This method returns template names for the specified category.
- GetData. This method returns a byte array containing stored controls.
- SetData. This method allows you to save a byte array representing saved controls.
- DeleteTemplate. Use this method to delete the specified template from your storage.
- DeleteCategory. Use this method to delete the specified category and inner templates.

In this Code example, you can find two sample implementations of this interface. The first one (ControlTemplateStorage) demonstrates how to create an in-memory storage, and the second one uses a DataSet instance for storing templates.

UI for Template Gallery:
As stated above, we added a custom Dock Panel that has two buttons (Add and Delete) for operating with templates and a TreeList instance that displays existing categories and templates. To create a new template, select the required controls in your report and click the Add button. You will see a new dialog requesting the Category and Template name.

To create controls from a template, select the required template in the TreeList and drag-and-drop it to a report design surface at the required location.

To delete a template or category, select it in the TreeList and click the Delete button.


reporting_winforms-eud-how-to-create-a-control-template-gallery-with-reusable-control-sets-t341218's People

Contributors

devexpressexamplebot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.