Skip to content

Commit 736b4fc

Browse files
auto sync for version 2023.1
1 parent 9c4cd30 commit 736b4fc

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

CustomControlExample/Controllers/HomeController.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
using Microsoft.AspNetCore.Mvc;
2+
using DevExpress.XtraReports.Web.ReportDesigner;
3+
using DevExpress.XtraReports.Web.ReportDesigner.Services;
24

35
namespace Reporting_AspNetCore_Create_Custom_Control.Controllers {
46
public class HomeController : Controller {
5-
public IActionResult Index() {
6-
Models.ReportDesignerModel model = new Models.ReportDesignerModel();
7+
public IActionResult Index([FromServices] IReportDesignerModelBuilder reportDesignerModelBuilder) {
8+
ReportDesignerModel model = reportDesignerModelBuilder
9+
.Report("TestReport")
10+
.CustomControls(typeof(MyControl), typeof(NumericLabel))
11+
.BuildModel();
712
return View(model);
813
}
914
}

CustomControlExample/Views/Home/Index.cshtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@model DevExpress.XtraReports.Web.ReportDesigner.ReportDesignerModel
2+
13
<script type="text/html" id="dxrd-svg-toolbox-numericlabel">
24
<svg viewBox="-2 -4 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
35
<g id="Layer_1" transform="translate(-2, -4)" style="enable-background:new 0 0 32 32">
@@ -16,8 +18,7 @@
1618
@{
1719
var designerRender = Html.DevExpress().ReportDesigner("reportDesigner")
1820
.Height("1000px")
19-
.CustomControls(new [] { typeof(MyControl), typeof(NumericLabel)})
20-
.Bind("TestReport");
21+
.Bind(Model);
2122
@designerRender.RenderHtml();
2223
}
2324

CustomControlExample/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"bootstrap": "^4.3.1",
88
"cldrjs": "^0.5.0",
9-
"devextreme-dist": "23.1-next",
9+
"devextreme-dist": "23.1-stable",
1010
"@devexpress/analytics-core": "23.1-stable",
1111
"devexpress-reporting": "23.1-stable",
1212
"globalize": "^1.3.0"

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
<!-- default badges list -->
2-
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/329822299/2023.1)
3-
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T965031)
4-
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
5-
<!-- default badges end -->
61
# Reporting for ASP.NET Core - Create a Custom Report Control
72

83
This example demonstrates how to create a custom report control and add it to the End-User Report Designer toolbox.

0 commit comments

Comments
 (0)