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.
Create a Reports database in the local Microsoft SQL Server. Add the ReportLayout table with the following script:
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
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 the Northwind database and add it to your local Microsoft SQL server.
- 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)
- 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)
- 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
(you will be redirected to DevExpress.com to submit your response)