Reporting for Web Forms - Report Designer with Report Storage and Custom Command
This example integrates the End-User Report Designer into an ASP.NET WebForms application and implements a Microsoft SQL Server database report storage to add, edit and delete reports. This example also demonstrates how to add custom commands to the report designer menu at runtime. A custom Close menu command redirects the user to the homepage.
Before you start
Create Reports Database
Create a Reports database in the local Microsoft SQL Server. Add the ReportLayout table with the following script:
SQL
USE [Reports] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ReportLayout]( [ReportId] [int] IDENTITY(1,1) NOT NULL, [DisplayName] [nvarchar] NULL, [LayoutData] [varbinary] NULL, [ReportId] ASC CONSTRAINT [PK_ReportLayout6] PRIMARY KEY CLUSTERED ( )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO
SQL Server 2016 - v13.0.x.x
USE [Reports] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ReportLayout]( [ReportId] [int] IDENTITY(1,1) NOT NULL , [DisplayName] [nvarchar](50) NULL, [LayoutData] [varbinary](max) NULL, CONSTRAINT PK_ReportLayout PRIMARY KEY (ReportId) ); SELECT * FROM [dbo].[ReportLayout] ORDER BY [ReportId] ASC GO
Create Northwind Database
Create the Northwind database and add it to your local Microsoft SQL server.
Files to Review
- CustomReportStorageWebExtension.cs (VB: CustomReportStorageWebExtension.vb)
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
- Designer.aspx (VB: Designer.aspx)
- Designer.aspx.cs (VB: Designer.aspx.vb)
- DesignerTask.cs (VB: DesignerTask.vb)
- Global.asax.cs (VB: Global.asax.vb)
Documentation
- Create an ASP.NET Web Forms Application with a Report Designer
- Add a Report Storage (ASP.NET Web Forms)
- End-User Report Designer Customization (ASP.NET Web Forms)
More Examples
- How to Integrate Web Report Designer in an MVC Web Application
- Reporting for Web Forms - Report Designer with the ASPxFileManager Control in the Open Report Dialog
Does This Example Address Your Development Requirements/Objectives?
(you will be redirected to DevExpress.com to submit your response)
