Giter Site home page Giter Site logo

devexpress-examples / reporting_web-report-designer-how-to-add-edit-remove-datasourses-in-the-web-report-designer-t196136 Goto Github PK

View Code? Open in Web Editor NEW
1.0 56.0 0.0 542 KB

.NET, ASP.NET Web Forms, XtraReports Suite

License: Other

C# 11.63% JavaScript 17.10% ASP.NET 61.35% Visual Basic .NET 9.92%
dotnet xtrareports-suite asp-net

reporting_web-report-designer-how-to-add-edit-remove-datasourses-in-the-web-report-designer-t196136's Introduction

Reporting for Web Forms - Report Data Source Editor (up to v15.1)

Important: This example is relevant for versions prior to 15.1. Current versions provide a built-in Data Source Wizard in the designer's menu. Review the Register Data Connections and Register Data Sources topics for more information on how to add data sources to the built-in Wizard.

Overview

This example demonstrates how you can modify the list of DataSources that is passed to the ASPxReportDesigner on the fly.

To run the DataSource wizard, open the ASPxReportDesigner menu and click Run Report DataSource Editor:

The Report Data Source Editor is displayed:

This form displays the list of data sources. Select a data source and the list box on the right shows its queries. You can add, edit and remove data sources and queries.

Click the Apply button to post the data sources to the server. In case of any exception, an error message is displayed. The data sources are available in the Report Designer.

To add data sources, click the + (plus) button in the Field List:

Implementation Details

The main idea of this approach is to use the ASPxReportDesigner.DataSources property to pass the set of DataSources to ASPxReportDesigner. To update the set of DataSources passed to the designer dynamically, the ASPxReportDesinger control is placed in the ASPxCallbackPanel control. The callbacks are used to update the ASPxReportDesigner. 

The designer's DataSource list is populated on the server dynamically with the CustomQueryWizardModel class. This class is converted to JSON format and passed to the client in the CustomJSProperties event handler (review the How to Access Server Data on the Client Side topic for more information).

When the Wizard popup form opens, JSON data passed to the client is converted to the JavaScript object and used to populate a Wizard form. This object is used to edit the data source collection on the client side.

When the user clicks the Apply button, the modified CustomQueryWizardModel object is converted to JSON and passed back to the server as a callback parameter. The server-side ASPxCallbackPanel.Callback event handler restores the CustomQueryWizardModel class and updates the data source collection.

To save the report layout, the client-side ASPxClientReportDesigner.PerformCallback method triggers a callback and raises the server-side ASPxReportDesigner.SaveReportLayout event that saves the report layout to Session. Subsequently the ASPxCallbackPanel callback is triggered, and the saved report layout is restored from the Session in the ASPxReportDesigner.Init event handler.

When the user clicks the Save button, the ASPxCallback control sends a non-visual callback to the server to validate the data source or query. The data source and query instances are created. If any errors occur, the error message is sent back to the client. The client-side ASPxClientCallback.CallbackComplete event handler analyzes data that is sent back to the client and displays an error message.

Files to Look At

Documentation

reporting_web-report-designer-how-to-add-edit-remove-datasourses-in-the-web-report-designer-t196136's People

Contributors

briandx avatar 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

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.