Skip to content

Commit 1d52a7e

Browse files
auto sync for version 2022.2
1 parent fc3b422 commit 1d52a7e

40 files changed

+1268
-1309
lines changed

.gitattributes

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VB/* linguist-vendored
2-
scripts linguist-vendored
3-
*.css linguist-detectable=false
1+
VB/* linguist-vendored
2+
scripts linguist-vendored
3+
*.css linguist-detectable=false
44
*.aff linguist-detectable=false

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ FakesAssemblies/
244244
# Node.js Tools for Visual Studio
245245
.ntvs_analysis.dat
246246
node_modules/
247+
package-lock.json
247248

248249
# Typescript v1 declaration files
249250
typings/

CS/Reporting-Use-Async-Engine-In-AspNet-Core/.gitignore renamed to CS/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ FakesAssemblies/
244244
# Node.js Tools for Visual Studio
245245
.ntvs_analysis.dat
246246
node_modules/
247+
package-lock.json
247248

248249
# Typescript v1 declaration files
249250
typings/

CS/Reporting-Use-Async-Engine-In-AspNet-Core/Readme.md

-58
This file was deleted.

CS/Reporting-Use-Async-Engine-In-AspNet-Core/ReportingAppAsyncServices/package.json

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30309.148
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportingAppAsyncServices", "ReportingAppAsyncServices\ReportingAppAsyncServices.csproj", "{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}"
7-
EndProject
8-
Global
9-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|Any CPU = Debug|Any CPU
11-
Release|Any CPU = Release|Any CPU
12-
EndGlobalSection
13-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}.Release|Any CPU.Build.0 = Release|Any CPU
18-
EndGlobalSection
19-
GlobalSection(SolutionProperties) = preSolution
20-
HideSolutionNode = FALSE
21-
EndGlobalSection
22-
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {FA7A31AB-ED97-48E8-8E23-967CE3F273EA}
24-
EndGlobalSection
25-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30309.148
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportingAppAsyncServices", "ReportingAppAsyncServices\ReportingAppAsyncServices.csproj", "{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{5A3AB9F5-8B42-4C90-A6C1-3F06E990AB00}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {FA7A31AB-ED97-48E8-8E23-967CE3F273EA}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
using System.Collections.Generic;
2-
using System.ComponentModel.Design;
3-
using System.IO;
4-
using System.Threading.Tasks;
5-
using DevExpress.AspNetCore.Reporting.QueryBuilder;
6-
using DevExpress.AspNetCore.Reporting.ReportDesigner;
7-
using DevExpress.AspNetCore.Reporting.WebDocumentViewer;
8-
using DevExpress.DataAccess.Sql;
9-
using DevExpress.XtraReports.Services;
10-
using DevExpress.XtraReports.Web.ReportDesigner;
11-
using DevExpress.XtraReports.Web.WebDocumentViewer;
12-
using Microsoft.AspNetCore.Mvc;
13-
14-
namespace ReportingAppAsyncServices.Controllers
15-
{
16-
public class HomeController : Controller
17-
{
18-
public IActionResult Index()
19-
{
20-
return View();
21-
}
22-
23-
public async Task<IActionResult> Designer([FromQuery] string reportName = "RootReport")
24-
{
25-
var dataSources = new Dictionary<string, object>
26-
{
27-
["Northwind"] = GetNorthwindSqlDataSource()
28-
};
29-
var modelGenerator = new ReportDesignerClientSideModelGenerator(HttpContext.RequestServices);
30-
var model = await modelGenerator.GetModelAsync(reportName, dataSources, ReportDesignerController.DefaultUri, WebDocumentViewerController.DefaultUri, QueryBuilderController.DefaultUri);
31-
return View(model);
32-
}
33-
34-
public async Task<IActionResult> Viewer([FromQuery] string reportName = "RootReport")
35-
{
36-
var modelGenerator = new WebDocumentViewerClientSideModelGenerator(HttpContext.RequestServices);
37-
var model = await modelGenerator.GetModelAsync(reportName, WebDocumentViewerController.DefaultUri);
38-
return View(model);
39-
}
40-
public async Task<IActionResult> ExportToPdf([FromServices] IReportProviderAsync reportProviderAsync, [FromQuery] string reportName = "RootReport")
41-
{
42-
var report = await reportProviderAsync.GetReportAsync(reportName, null);
43-
var reportServiceContainer = (IServiceContainer)report;
44-
reportServiceContainer.RemoveService(typeof(IReportProviderAsync));
45-
reportServiceContainer.AddService(typeof(IReportProviderAsync), reportProviderAsync);
46-
using (var stream = new MemoryStream()) {
47-
await report.CreateDocumentAsync();
48-
await report.ExportToPdfAsync(stream);
49-
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf);
50-
}
51-
}
52-
53-
54-
SqlDataSource GetNorthwindSqlDataSource()
55-
{
56-
// Create a SQL data source with the specified connection string.
57-
SqlDataSource ds = new SqlDataSource("NWindConnectionString");
58-
// Create a SQL query to access the Products data table.
59-
SelectQuery query = SelectQueryFluentBuilder.AddTable("Products").SelectAllColumnsFromTable().Build("Products");
60-
ds.Queries.Add(query);
61-
ds.RebuildResultSchema();
62-
return ds;
63-
}
64-
}
65-
}
1+
using System.Collections.Generic;
2+
using System.ComponentModel.Design;
3+
using System.IO;
4+
using System.Threading.Tasks;
5+
using DevExpress.AspNetCore.Reporting.QueryBuilder;
6+
using DevExpress.AspNetCore.Reporting.ReportDesigner;
7+
using DevExpress.AspNetCore.Reporting.WebDocumentViewer;
8+
using DevExpress.DataAccess.Sql;
9+
using DevExpress.XtraReports.Services;
10+
using DevExpress.XtraReports.Web.ReportDesigner;
11+
using DevExpress.XtraReports.Web.WebDocumentViewer;
12+
using Microsoft.AspNetCore.Mvc;
13+
14+
namespace ReportingAppAsyncServices.Controllers
15+
{
16+
public class HomeController : Controller
17+
{
18+
public IActionResult Index()
19+
{
20+
return View();
21+
}
22+
23+
public async Task<IActionResult> Designer([FromQuery] string reportName = "RootReport")
24+
{
25+
var dataSources = new Dictionary<string, object>
26+
{
27+
["Northwind"] = GetNorthwindSqlDataSource()
28+
};
29+
var modelGenerator = new ReportDesignerClientSideModelGenerator(HttpContext.RequestServices);
30+
var model = await modelGenerator.GetModelAsync(reportName, dataSources, ReportDesignerController.DefaultUri, WebDocumentViewerController.DefaultUri, QueryBuilderController.DefaultUri);
31+
return View(model);
32+
}
33+
34+
public async Task<IActionResult> Viewer([FromQuery] string reportName = "RootReport")
35+
{
36+
var modelGenerator = new WebDocumentViewerClientSideModelGenerator(HttpContext.RequestServices);
37+
var model = await modelGenerator.GetModelAsync(reportName, WebDocumentViewerController.DefaultUri);
38+
return View(model);
39+
}
40+
public async Task<IActionResult> ExportToPdf([FromServices] IReportProviderAsync reportProviderAsync, [FromQuery] string reportName = "RootReport")
41+
{
42+
var report = await reportProviderAsync.GetReportAsync(reportName, null);
43+
var reportServiceContainer = (IServiceContainer)report;
44+
reportServiceContainer.RemoveService(typeof(IReportProviderAsync));
45+
reportServiceContainer.AddService(typeof(IReportProviderAsync), reportProviderAsync);
46+
using (var stream = new MemoryStream()) {
47+
await report.CreateDocumentAsync();
48+
await report.ExportToPdfAsync(stream);
49+
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf);
50+
}
51+
}
52+
53+
54+
SqlDataSource GetNorthwindSqlDataSource()
55+
{
56+
// Create a SQL data source with the specified connection string.
57+
SqlDataSource ds = new SqlDataSource("NWindConnectionString");
58+
// Create a SQL query to access the Products data table.
59+
SelectQuery query = SelectQueryFluentBuilder.AddTable("Products").SelectAllColumnsFromTable().Build("Products");
60+
ds.Queries.Add(query);
61+
ds.RebuildResultSchema();
62+
return ds;
63+
}
64+
}
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using DevExpress.AspNetCore.Reporting.QueryBuilder;
2+
using DevExpress.AspNetCore.Reporting.QueryBuilder.Native.Services;
3+
using DevExpress.AspNetCore.Reporting.ReportDesigner;
4+
using DevExpress.AspNetCore.Reporting.ReportDesigner.Native.Services;
5+
using DevExpress.AspNetCore.Reporting.WebDocumentViewer;
6+
using DevExpress.AspNetCore.Reporting.WebDocumentViewer.Native.Services;
7+
8+
namespace ReportingAppAsyncServices.Controllers {
9+
public class CustomWebDocumentViewerController : WebDocumentViewerController {
10+
public CustomWebDocumentViewerController(IWebDocumentViewerMvcControllerService controllerService) : base(controllerService) {
11+
}
12+
}
13+
14+
public class CustomReportDesignerController : ReportDesignerController {
15+
public CustomReportDesignerController(IReportDesignerMvcControllerService controllerService) : base(controllerService) {
16+
}
17+
}
18+
19+
public class CustomQueryBuilderController : QueryBuilderController {
20+
public CustomQueryBuilderController(IQueryBuilderMvcControllerService controllerService) : base(controllerService) {
21+
}
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
using DevExpress.XtraReports.UI;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Threading.Tasks;
6-
7-
namespace ReportingAppAsyncServices.PredefinedReports
8-
{
9-
public static class ReportsFactory
10-
{
11-
public static Dictionary<string, Func<XtraReport>> Reports = new Dictionary<string, Func<XtraReport>>()
12-
{
13-
["TestReport"] = () => new TestReport(),
14-
["RootReport"] = () => new RootReport(),
15-
["SubReport"] = () => new SubReport()
16-
};
17-
}
18-
}
1+
using DevExpress.XtraReports.UI;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
7+
namespace ReportingAppAsyncServices.PredefinedReports
8+
{
9+
public static class ReportsFactory
10+
{
11+
public static Dictionary<string, Func<XtraReport>> Reports = new Dictionary<string, Func<XtraReport>>()
12+
{
13+
["TestReport"] = () => new TestReport(),
14+
["RootReport"] = () => new RootReport(),
15+
["SubReport"] = () => new SubReport()
16+
};
17+
}
18+
}

0 commit comments

Comments
 (0)