Giter Club home page Giter Club logo

reporting-asp-net-core-customize-open-and-save-as-dialogs's Introduction

Reporting for ASP.NET Core - How to Customize the Save As and Open Dialogs in the Web End-User Report Designer

This example shows how to use the End-User Report Designer's client-side API to customize the Save As and Open dialogs.

Customize the Save As Dialog

Report files in this example are in folders in the root Reports folder. Folder names correspond to the report's category. The customized dialog displays report names and categories. The dialog allows users to do the following:

Custom Save As Dialog

  • Select the existing category and file name, and save the report
  • Enter the category name and create a new category
  • Enter the file name and save a report with a new name.

The dialog also displays reports that do not fall in any category - reports created by the ReportsFactory static class and reports in the root Reports folder.

Dialog Template

The Save As dialog is defined in an HTML template. The template contains the following widgets:

  • The TextBox editor is bound to the model's inputValue property and displays the report's name.
  • The SelectBox editor is bound to the model's categories property and displays the category name.
  • The List widget is bound to the model's categories property and displays reports grouped by category. The categories data is an array of keys (category names) associated with multiple values (report names). The dxListBox requires this structure to display grouped values.

Dialog Model

The dialog model defines the properties used in the dialog template and binds them to Knockout observables. The model specifies the following functions:

  • To set the current report URL
  • To get the current report URL
  • To update the model's properties when the dialog is displayed. The updateCategories JavaScript function is used.

The updateCategories function calls the client-side ReportStorageWeb.getUrls method to obtain report names and categories. This method uses the ReportStorageWebExtension.GetUrls method of server-side report storage to get a dictionary that contains report names and categories. The code processes the dictionary and fills the categories data array.

The model defines the dialog buttons and their actions. The Save button's action calls the e.Popup.save method and the Cancel button's action calls the e.Popup.cancel method.

The dialog HTML template and dialog model are passed to the e.Customize method to modify the Report Designer's Save As dialog. This method is available in the CustomizeSaveAsDialog event handler.

CustomizeSaveAsDialog event

The customizeSaveAsDialog function is the CustomizeSaveAsDialog event handler. The function uses the event handler argument’s Popup property to specify the dialog’s width, height, and title. The function defines variables used in the dialog model and defines the dialog model. Finally, the function calls the e.Customize method to modify the dialog based on the specified model and template.

The ReportDesignerClientSideEventsBuilder.CustomizeSaveAsDialog method is used to set the name of the JavaScript function that handles the CustomizeSaveAsDialog event (the customizeSaveAsDialog function in this example).

Customize the Open Dialog

The custom Open dialog allows the user to find a report in a list grouped by category, select the report, and open it. The user can type in the text box to filter the list and find report and category names that contain the input string.

Custom Open Dialog

The Open dialog is customized in the same way as the Save As dialog. The ReportDesignerClientSideEventsBuilder.CustomizeOpenDialog method specifies the name of the JavaScript function that handles the CustomizeOpenDialog event - the customizeOpenDialog function in this example.

The Open dialog template and the dialog model are defined and passed to the e.Customize method to modify the dialog.

Files to Review

Documentation

More Examples

reporting-asp-net-core-customize-open-and-save-as-dialogs's People

Contributors

andreylepikhov avatar devexpressexamplebot avatar pollyndos avatar yaroslav-kuznetsov avatar

Stargazers

 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

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.