File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1
1
using Microsoft . AspNetCore . Mvc ;
2
+ using DevExpress . XtraReports . Web . ReportDesigner ;
3
+ using DevExpress . XtraReports . Web . ReportDesigner . Services ;
2
4
3
5
namespace Reporting_AspNetCore_Create_Custom_Control . Controllers {
4
6
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 ( ) ;
7
12
return View ( model ) ;
8
13
}
9
14
}
Original file line number Diff line number Diff line change
1
+ @model DevExpress .XtraReports .Web .ReportDesigner .ReportDesignerModel
2
+
1
3
<script type =" text/html" id =" dxrd-svg-toolbox-numericlabel" >
2
4
<svg viewBox =" -2 -4 32 32" xmlns =" http://www.w3.org/2000/svg" xmlns:xlink =" http://www.w3.org/1999/xlink" >
3
5
<g id =" Layer_1" transform =" translate(-2, -4)" style =" enable-background :new 0 0 32 32 " >
16
18
@{
17
19
var designerRender = Html .DevExpress ().ReportDesigner (" reportDesigner" )
18
20
.Height (" 1000px" )
19
- .CustomControls (new [] { typeof (MyControl ), typeof (NumericLabel )})
20
- .Bind (" TestReport" );
21
+ .Bind (Model );
21
22
@designerRender.RenderHtml() ;
22
23
}
23
24
Original file line number Diff line number Diff line change 6
6
"dependencies" : {
7
7
"bootstrap" : " ^4.3.1" ,
8
8
"cldrjs" : " ^0.5.0" ,
9
- "devextreme-dist" : " 23.1-next " ,
9
+ "devextreme-dist" : " 23.1-stable " ,
10
10
"@devexpress/analytics-core" : " 23.1-stable" ,
11
11
"devexpress-reporting" : " 23.1-stable" ,
12
12
"globalize" : " ^1.3.0"
Original file line number Diff line number Diff line change 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 -->
6
1
# Reporting for ASP.NET Core - Create a Custom Report Control
7
2
8
3
This example demonstrates how to create a custom report control and add it to the End-User Report Designer toolbox.
You can’t perform that action at this time.
0 commit comments