Skip to content

Commit a177139

Browse files
auto sync for version 2020.1
1 parent 481a31c commit a177139

File tree

237 files changed

+715
-519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+715
-519
lines changed

AspNetCore/Reporting_ObjectDS_AspNetCore/Views/Home/Index.cshtml

-44
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30413.136
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Reporting_ObjectDS_AspNetCore", "Reporting_ObjectDS_AspNetCore\Reporting_ObjectDS_AspNetCore.csproj", "{931E7ABE-1815-40F5-8AE2-6F0CDC9CB512}"
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+
{931E7ABE-1815-40F5-8AE2-6F0CDC9CB512}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{931E7ABE-1815-40F5-8AE2-6F0CDC9CB512}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{931E7ABE-1815-40F5-8AE2-6F0CDC9CB512}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{931E7ABE-1815-40F5-8AE2-6F0CDC9CB512}.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 = {221037F6-BBE0-400D-BA9A-B02551F712F3}
24+
EndGlobalSection
25+
EndGlobal

AspNetCore/Reporting_ObjectDS_AspNetCore/DataSources/EmployeesDataSource.cs CS/Reporting-How-To-Use-Object-Data-Source/AspNetCore/Reporting_ObjectDS_AspNetCore/DataSources/EmployeesDataSource.cs

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
using System.Collections.Generic;
22
using System.ComponentModel;
3+
using System.Linq;
34

4-
namespace Reporting_ObjectDS_AspNetCore.Employees
5+
namespace Reporting_ObjectDS_AspNetCore
56
{
67
[DisplayName("Employees")]
78
public class EmployeeList
89
{
910
public EmployeeList()
1011
{
11-
Items = GetData();
12+
Items = InitializeList();
1213
}
1314
public EmployeeList(int noOfItems)
1415
{
1516

16-
Items = GetData().GetRange(1, noOfItems);
17+
Items = InitializeList().GetRange(1, noOfItems);
1718
}
1819
public List<DataItem> Items { get; set; }
1920

20-
public List<DataItem> GetData()
21+
public List<DataItem> InitializeList()
2122
{
2223
return new List<DataItem>() {
2324
new DataItem(1, 101, "Andrew Fuller", "Dr.", "Vice President, Sales"),
@@ -40,6 +41,13 @@ public List<DataItem> GetData()
4041
new DataItem(5, 503, "Rita Müller", "Mrs.", "Sales Representative"),
4142
};
4243
}
44+
45+
public List<DataItem> GetData(int noOfItems)
46+
{
47+
List<DataItem> revertList = new List<DataItem>(Items);
48+
revertList.Reverse();
49+
return revertList.Take(noOfItems).ToList();
50+
}
4351
}
4452
public class DataItem
4553
{

AspNetCore/Reporting_ObjectDS_AspNetCore/PredefinedReports/EmployeeReport.Designer.cs CS/Reporting-How-To-Use-Object-Data-Source/AspNetCore/Reporting_ObjectDS_AspNetCore/PredefinedReports/EmployeeReport.Designer.cs

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AspNetCore/Reporting_ObjectDS_AspNetCore/PredefinedReports/EmployeeReport.repx CS/Reporting-How-To-Use-Object-Data-Source/AspNetCore/Reporting_ObjectDS_AspNetCore/PredefinedReports/EmployeeReport.repx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<XtraReportsLayoutSerializer SerializerVersion="20.1.4.0" Ref="1" ControlType="DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v20.1, Version=20.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Name="EmployeeReport" PageWidth="850" PageHeight="1100" Version="20.1" DataSource="#Ref-0" Font="Arial, 9.75pt">
2+
<XtraReportsLayoutSerializer SerializerVersion="20.1.7.0" Ref="1" ControlType="DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v20.1, Version=20.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Name="EmployeeReport" PageWidth="850" PageHeight="1100" Version="20.1" DataSource="#Ref-0" Font="Arial, 9.75pt">
33
<Bands>
44
<Item1 Ref="2" ControlType="TopMarginBand" Name="TopMargin" />
55
<Item2 Ref="3" ControlType="BottomMarginBand" Name="BottomMargin">
66
<Controls>
7-
<Item1 Ref="4" ControlType="XRPageInfo" Name="pageInfo1" PageInfo="DateTime" SizeF="315,23" LocationFloat="5,5" StyleName="PageInfo" />
8-
<Item2 Ref="5" ControlType="XRPageInfo" Name="pageInfo2" TextFormatString="Page {0} of {1}" TextAlignment="TopRight" SizeF="315,23" LocationFloat="330,5" StyleName="PageInfo" />
7+
<Item1 Ref="4" ControlType="XRPageInfo" Name="pageInfo1" PageInfo="DateTime" SizeF="313,23" LocationFloat="6,6" StyleName="PageInfo" />
8+
<Item2 Ref="5" ControlType="XRPageInfo" Name="pageInfo2" TextFormatString="Page {0} of {1}" TextAlignment="TopRight" SizeF="313,23" LocationFloat="331,6" StyleName="PageInfo" />
99
</Controls>
1010
</Item2>
1111
<Item3 Ref="6" ControlType="ReportHeaderBand" Name="ReportHeader" HeightF="60">
1212
<Controls>
13-
<Item1 Ref="7" ControlType="XRLabel" Name="label1" Text="Employees" SizeF="640,24.19433" LocationFloat="5,5" StyleName="Title" />
13+
<Item1 Ref="7" ControlType="XRLabel" Name="label1" Text="Report Title" SizeF="638,24.194334" LocationFloat="6,6" StyleName="Title" />
1414
</Controls>
1515
</Item3>
1616
<Item4 Ref="8" ControlType="GroupHeaderBand" Name="GroupHeader1" GroupUnion="WithFirstDetail" HeightF="28">
@@ -82,6 +82,6 @@
8282
<Item5 Ref="37" Name="PageInfo" BorderStyle="Inset" Padding="2,2,0,0,100" Font="Arial, 8.25pt, style=Bold" ForeColor="255,75,75,75" StringFormat="Near;Near;0;None;Character;Default" />
8383
</StyleSheet>
8484
<ComponentStorage>
85-
<Item1 Ref="0" ObjectType="DevExpress.DataAccess.ObjectBinding.ObjectDataSource,DevExpress.DataAccess.v20.1" Name="objectDataSource1" Base64="PE9iamVjdERhdGFTb3VyY2UgTmFtZT0ib2JqZWN0RGF0YVNvdXJjZTEiPjxEYXRhU291cmNlIFR5cGU9IlJlcG9ydGluZ19PYmplY3REU19Bc3BOZXRDb3JlLkVtcGxveWVlcy5FbXBsb3llZUxpc3QsIFJlcG9ydGluZ19PYmplY3REU19Bc3BOZXRDb3JlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbCIgLz48RGF0YU1lbWJlcj5JdGVtczwvRGF0YU1lbWJlcj48Q29uc3RydWN0b3IgLz48L09iamVjdERhdGFTb3VyY2U+" />
85+
<Item1 Ref="0" ObjectType="DevExpress.DataAccess.ObjectBinding.ObjectDataSource,DevExpress.DataAccess.v20.1" Name="objectDataSource1" Base64="PE9iamVjdERhdGFTb3VyY2UgTmFtZT0ib2JqZWN0RGF0YVNvdXJjZTEiPjxEYXRhU291cmNlIFR5cGU9IlJlcG9ydGluZ19PYmplY3REU19Bc3BOZXRDb3JlLkVtcGxveWVlTGlzdCwgUmVwb3J0aW5nX09iamVjdERTX0FzcE5ldENvcmUsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIiAvPjxEYXRhTWVtYmVyPkl0ZW1zPC9EYXRhTWVtYmVyPjxDb25zdHJ1Y3RvciAvPjwvT2JqZWN0RGF0YVNvdXJjZT4=" />
8686
</ComponentStorage>
8787
</XtraReportsLayoutSerializer>

AspNetCore/Reporting_ObjectDS_AspNetCore/Services/CustomObjectDataSourceConstructorFilterService.cs CS/Reporting-How-To-Use-Object-Data-Source/AspNetCore/Reporting_ObjectDS_AspNetCore/Services/CustomObjectDataSourceConstructorFilterService.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using DevExpress.DataAccess.Web;
2+
using Reporting_ObjectDS_AspNetCore;
23
using System;
34
using System.Collections.Generic;
45
using System.Linq;
@@ -7,7 +8,7 @@ public class CustomObjectDataSourceConstructorFilterService : IObjectDataSourceC
78
{
89
public IEnumerable<ConstructorInfo> Filter(Type dataSourceType, IEnumerable<ConstructorInfo> constructors)
910
{
10-
if (dataSourceType == typeof(Reporting_ObjectDS_AspNetCore.Employees.EmployeeList))
11+
if (dataSourceType == typeof(EmployeeList))
1112
return constructors;
1213
else
1314
return constructors.Where(x => x.GetParameters().Length > 0);

AspNetCore/Reporting_ObjectDS_AspNetCore/Services/CustomReportStorageWebExtension.cs CS/Reporting-How-To-Use-Object-Data-Source/AspNetCore/Reporting_ObjectDS_AspNetCore/Services/CustomReportStorageWebExtension.cs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1+
using DevExpress.XtraReports.UI;
2+
using DevExpress.XtraReports.Web.Extensions;
3+
using Microsoft.AspNetCore.Hosting;
14
using System;
2-
using System.Collections.Concurrent;
35
using System.Collections.Generic;
46
using System.IO;
57
using System.Linq;
6-
using System.Reflection;
7-
using DevExpress.XtraReports.Web.Extensions;
8-
using DevExpress.XtraReports.UI;
9-
using Microsoft.AspNetCore.Hosting;
10-
using Reporting_ObjectDS_AspNetCore.PredefinedReports;
11-
using DevExpress.DataAccess.ObjectBinding;
128

139
namespace Reporting_ObjectDS_AspNetCore.Services
1410
{
15-
public class CustomReportStorageWebExtension : DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension
11+
public class CustomReportStorageWebExtension : ReportStorageWebExtension
1612
{
1713
readonly string ReportDirectory;
1814
const string FileExtension = ".repx";

AspNetCore/Reporting_ObjectDS_AspNetCore/Services/CustomWebDocumentViewerReportResolver.cs CS/Reporting-How-To-Use-Object-Data-Source/AspNetCore/Reporting_ObjectDS_AspNetCore/Services/CustomWebDocumentViewerReportResolver.cs

+7-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private object CreateObjectDataSource(string reportName)
2323
{
2424
ObjectDataSource dataSource = new ObjectDataSource();
2525
dataSource.Name = "EmployeeObjectDS";
26-
dataSource.DataSource = typeof(Employees.EmployeeList);
26+
dataSource.DataSource = typeof(EmployeeList);
2727
dataSource.Constructor = ObjectConstructorInfo.Default;
2828
dataSource.DataMember = "Items";
2929
return dataSource;
@@ -33,7 +33,7 @@ private object CreateObjectDataSource(string reportName)
3333
{
3434
ObjectDataSource dataSource = new ObjectDataSource();
3535
dataSource.Name = "EmployeeObjectDS";
36-
dataSource.DataSource = typeof(Employees.EmployeeList);
36+
dataSource.DataSource = typeof(EmployeeList);
3737
// Specify the parameter's default value.
3838
var parameter = new Parameter("noOfItems", typeof(int), 7);
3939
dataSource.Constructor = new ObjectConstructorInfo(parameter);
@@ -45,13 +45,13 @@ private object CreateObjectDataSource(string reportName)
4545
{
4646
ObjectDataSource dataSource = new ObjectDataSource();
4747
dataSource.Name = "EmployeeObjectDS";
48-
dataSource.DataSource = typeof(Employees.EmployeeList);
48+
dataSource.DataSource = typeof(EmployeeList);
4949
// Map data source parameter to report's parameter.
5050
var parameter = new Parameter()
5151
{
5252
Name = "noOfItems",
5353
Type = typeof(DevExpress.DataAccess.Expression),
54-
Value = new DevExpress.DataAccess.Expression("[Parameters." + "parameterNoOfItems" + "]", typeof(int))
54+
Value = new DevExpress.DataAccess.Expression("?parameterNoOfItems", typeof(int))
5555
};
5656
dataSource.Constructor = new ObjectConstructorInfo(parameter);
5757
dataSource.DataMember = "Items";
@@ -61,9 +61,10 @@ private object CreateObjectDataSource(string reportName)
6161
{
6262
ObjectDataSource dataSource = new ObjectDataSource();
6363
dataSource.Name = "EmployeeObjectDS";
64-
dataSource.DataSource = typeof(Employees.EmployeeList);
65-
var parameterNoOfItems = new Parameter("noOfItems", typeof(int), 0);
64+
dataSource.DataSource = typeof(EmployeeList);
65+
var parameterNoOfItems = new Parameter("noOfItems", typeof(int), 12);
6666
dataSource.Parameters.Add(parameterNoOfItems);
67+
dataSource.Constructor = ObjectConstructorInfo.Default;
6768
dataSource.DataMember = "GetData";
6869
return dataSource;
6970
}

AspNetCore/Reporting_ObjectDS_AspNetCore/Services/ObjectDataSourceWizardCustomTypeProvider.cs CS/Reporting-How-To-Use-Object-Data-Source/AspNetCore/Reporting_ObjectDS_AspNetCore/Services/ObjectDataSourceWizardCustomTypeProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Reporting_ObjectDS_AspNetCore.Services {
66
public class ObjectDataSourceWizardCustomTypeProvider : IObjectDataSourceWizardTypeProvider {
77
public IEnumerable<Type> GetAvailableTypes(string context) {
8-
return new[] { typeof(Employees.EmployeeList) };
8+
return new[] { typeof(EmployeeList) };
99
}
1010
}
1111
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>ASP.NET Core Reporting Object Data Source Example</h1>

MVC/CS/Reporting_ObjectDS_Mvc/ObjectDataSource/EmployeesDataSource.cs CS/Reporting-How-To-Use-Object-Data-Source/MVC/CS/Reporting_ObjectDS_Mvc/ObjectDataSource/EmployeesDataSource.cs

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using System.ComponentModel;
3+
using System.Linq;
34

45
namespace Reporting_ObjectDS_Mvc.Employees
56
{
@@ -8,16 +9,16 @@ public class EmployeeList
89
{
910
public EmployeeList()
1011
{
11-
Items = GetData();
12+
Items = InitializeList();
1213
}
1314
public EmployeeList(int noOfItems)
1415
{
1516

16-
Items = GetData().GetRange(1, noOfItems);
17+
Items = InitializeList().GetRange(1, noOfItems);
1718
}
1819
public List<DataItem> Items { get; set; }
1920

20-
public List<DataItem> GetData()
21+
public List<DataItem> InitializeList()
2122
{
2223
return new List<DataItem>() {
2324
new DataItem(1, 101, "Andrew Fuller", "Dr.", "Vice President, Sales"),
@@ -40,6 +41,13 @@ public List<DataItem> GetData()
4041
new DataItem(5, 503, "Rita Müller", "Mrs.", "Sales Representative"),
4142
};
4243
}
44+
45+
public List<DataItem> GetData(int noOfItems)
46+
{
47+
List<DataItem> revertList = new List<DataItem>(Items);
48+
revertList.Reverse();
49+
return revertList.Take(noOfItems).ToList();
50+
}
4351
}
4452
public class DataItem
4553
{

0 commit comments

Comments
 (0)