Skip to content

Commit 163817f

Browse files
feature(REPORT-10918): Bold-reports 4.1 release changes
1 parent 707491a commit 163817f

Some content is hidden

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

52 files changed

+362
-116
lines changed

Controllers/PreviewController.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66

77
namespace ReportsCoreSamples.Controllers
88
{
9-
public class PreviewController: MetaData
9+
public class PreviewController : MetaData
1010
{
1111
public IActionResult Preview()
1212
{
13-
string foderName = this.ControllerContext.RouteData.Values["controller"].ToString();
13+
string foderName = this.ControllerContext.RouteData.Values["controller"].ToString();
1414
ViewBag.action = "Preview";
15+
if (foderName == "ExternalParameterReport")
16+
{
17+
ViewBag.parameterSettings = new BoldReports.Models.ReportViewer.ParameterSettings();
18+
ViewBag.parameterSettings.HideParameterBlock = true;
19+
}
1520
this.updateMetaData();
1621
return View("~/Views/" + foderName + "/Index.cshtml");
1722
}

Controllers/ReportDesignerWebApiController.cs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,13 @@ public void UploadReportAction()
174174

175175
private string GetFilePath(string itemName, string key)
176176
{
177-
string targetFolder = this._hostingEnvironment.WebRootPath + "\\";
178-
targetFolder += "Cache";
179-
180-
if (!System.IO.Directory.Exists(targetFolder))
181-
{
182-
System.IO.Directory.CreateDirectory(targetFolder);
183-
}
184-
185-
if (!System.IO.Directory.Exists(targetFolder + "\\" + key))
177+
string dirPath = Path.Combine(this._hostingEnvironment.WebRootPath,"Cache",key);
178+
if (!System.IO.Directory.Exists(dirPath))
186179
{
187-
System.IO.Directory.CreateDirectory(targetFolder + "\\" + key);
180+
System.IO.Directory.CreateDirectory(dirPath);
188181
}
189182

190-
return targetFolder + "\\" + key + "\\" + itemName;
183+
return Path.Combine(dirPath, itemName);
191184
}
192185

193186
public bool SetData(string key, string itemId, ItemInfo itemData, out string errMsg)
@@ -238,7 +231,17 @@ public ResourceInfo GetData(string key, string itemId)
238231
var resource = new ResourceInfo();
239232
try
240233
{
241-
resource.Data = System.IO.File.ReadAllBytes(this.GetFilePath(itemId, key));
234+
var filePath = this.GetFilePath(itemId, key);
235+
if (itemId.Equals(Path.GetFileName(filePath), StringComparison.InvariantCultureIgnoreCase) && System.IO.File.Exists(filePath))
236+
{
237+
resource.Data = System.IO.File.ReadAllBytes(filePath);
238+
LogExtension.LogInfo(string.Format("Method Name: {0}; Class Name: {1}; Message: {2};", "GetData", "CacheHelper", string.Format("File data retrieved from the path: {0}", filePath)), null);
239+
}
240+
else
241+
{
242+
resource.ErrorMessage = "File not found from the specified path";
243+
LogExtension.LogInfo(string.Format("Method Name: {0}; Class Name: {1}; Message: {2};", "GetData", "CacheHelper", string.Format("File not found from the specified path: {0}", filePath)), null);
244+
}
242245
}
243246
catch (Exception ex)
244247
{

Controllers/ReportViewerWebApiController.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,13 @@ public void LogError(string errorCode, string message, Exception exception, stri
9595
{
9696
LogExtension.LogError(message, exception, System.Reflection.MethodBase.GetCurrentMethod(), errorCode + "-" + errorDetail);
9797
}
98+
99+
[HttpGet]
100+
public object GetExternalParameterData()
101+
{
102+
var productCategory = Models.SqlQuery.getProductCategory(this._cache);
103+
var productSubCategory = Models.SqlQuery.getProductSubCategory(this._cache);
104+
return Json(new { ProductCategoryDetail = productCategory, ProductSubCategoryDetail = productSubCategory });
105+
}
98106
}
99107
}

Models/SqlQuery.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,43 @@ public static string getJson(IMemoryCache _cache)
3030
}
3131
return null;
3232
}
33+
public static string getProductCategory(IMemoryCache _cache)
34+
{
35+
36+
using (SqlConnection connection = new SqlConnection("Data Source=dataplatformdemodata.syncfusion.com;Initial Catalog=AdventureWorks2016;user id=demoreadonly@data-platform-demo;password=N@c)=Y8s*1&dh;"))
37+
{
38+
connection.Open();
39+
40+
string queryString = "SELECT DISTINCT ProductCategoryID, Name FROM Production.ProductCategory";
41+
SqlDataAdapter adapter = new SqlDataAdapter(queryString, connection);
42+
43+
using (DataSet ProductCategories = new DataSet())
44+
{
45+
adapter.Fill(ProductCategories, "Orders");
46+
_cache.Set("ProductCategoryDetail", ProductCategories.Tables[0]);
47+
connection.Close();
48+
return JsonConvert.SerializeObject(_cache.Get("ProductCategoryDetail"));
49+
}
50+
}
51+
}
52+
public static string getProductSubCategory(IMemoryCache _cache)
53+
{
54+
55+
using (SqlConnection connection = new SqlConnection("Data Source=dataplatformdemodata.syncfusion.com;Initial Catalog=AdventureWorks2016;user id=demoreadonly@data-platform-demo;password=N@c)=Y8s*1&dh;"))
56+
{
57+
connection.Open();
58+
59+
string queryString = $"SELECT ProductSubcategoryID, ProductCategoryID, Name FROM Production.ProductSubcategory";
60+
SqlDataAdapter adapter = new SqlDataAdapter(queryString, connection);
61+
62+
using (DataSet ProductCategories = new DataSet())
63+
{
64+
adapter.Fill(ProductCategories, "Orders");
65+
_cache.Set("ProductSubCategoryDetail", ProductCategories.Tables[0]);
66+
connection.Close();
67+
return JsonConvert.SerializeObject(_cache.Get("ProductSubCategoryDetail"));
68+
}
69+
}
70+
}
3371
}
3472
}

NuGet.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<packageSources>
44
<clear />
55
<add key="NuGet.org" value="https://www.nuget.org/api/v2" />
6+
<add key="reportsnuget" value="Nuget" />
67

78
</packageSources>
89

ReportsCoreSamples.csproj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Bold.Licensing" Version="3.3.23" />
19-
<PackageReference Include="BoldReports.AspNet.Core" Version="3.3.23" />
20-
<PackageReference Include="BoldReports.Net.Core" Version="3.3.23" />
21-
<PackageReference Include="BoldReports.Data.WebData" Version="3.3.23" />
22-
<PackageReference Include="BoldReports.Data.Csv" Version="3.3.23" />
23-
<PackageReference Include="BoldReports.Data.Excel" Version="3.3.23" />
18+
<PackageReference Include="Bold.Licensing" Version="4.1.78" />
19+
<PackageReference Include="BoldReports.AspNet.Core" Version="4.1.78" />
20+
<PackageReference Include="BoldReports.CRI.Barcode" Version="4.1.78" />
21+
<PackageReference Include="BoldReports.Net.Core" Version="4.1.78" />
22+
<PackageReference Include="BoldReports.Data.WebData" Version="4.1.78" />
23+
<PackageReference Include="BoldReports.Data.Csv" Version="4.1.78" />
24+
<PackageReference Include="BoldReports.Data.Excel" Version="4.1.78" />
2425
<PackageReference Include="BuildBundlerMinifier" Version="2.9.406" />
2526
<PackageReference Include="log4net" Version="2.0.10" />
2627
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.1.1" />

Startup.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ public void Configure(IApplicationBuilder app)
152152
routes.MapRoute(
153153
name: "default",
154154
template: "{controller=Main}/{action=Index}/{id?}");
155+
routes.MapRoute("NotFound", "{*url}",
156+
new { controller = "main", action = "index" });
155157
});
156158
#else
157159
app.UseRouting();

Views/DynamicChartSeries/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@section description {
1818
<div id="description">
1919
<p>
20-
This demo shows the VisitorsCount, PurchaserCount, AddedToCartCount by dynamically chossing the chart series.
20+
This demo shows the VisitorsCount, PurchaserCount, AddedToCartCount by dynamically choosing the chart series.
2121
</p>
2222
<p>
2323
More information about the Chart report item can be found in this <a href="https://help.boldreports.com/enterprise-reporting/designer-guide/report-designer/report-items/chart/"

Views/RDLC/Index.cshtml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
@section control {
44

5-
<bold-report-designer id="reportdesigner" ajax-before-load="onAjaxBeforeLoad" report-opened="onReportOpened" service-url="@Globals.DESIGNER_SERVICE_URL" toolbar-settings="ViewBag.toolbarSettings" create="controlCreate" toolbar-rendering="toolbarRendering" toolbar-click="toolbarClick" />
5+
@{
6+
List<BoldReports.Models.ReportDesigner.ReportItemExtensionsModule> extensions = new List<BoldReports.Models.ReportDesigner.ReportItemExtensionsModule>(){
7+
new BoldReports.Models.ReportDesigner.ReportItemExtensionsModule{Name="barcode",ClassName="EJBarcode",ImageClass="customitem-barcode",DisplayName="1D Barcode",Category="Barcodes"},
8+
new BoldReports.Models.ReportDesigner.ReportItemExtensionsModule{Name="matrixbarcode",ClassName="EJQRBarcode",ImageClass="customitem-qrbarcode",DisplayName="2D Barcode",Category="Barcodes"}
9+
};
10+
}
11+
12+
<bold-report-designer id="reportdesigner" ajax-before-load="onAjaxBeforeLoad" report-opened="onReportOpened" service-url="@Globals.DESIGNER_SERVICE_URL" toolbar-settings="ViewBag.toolbarSettings" create="controlCreate" report-item-extensions="extensions" toolbar-rendering="toolbarRendering" toolbar-click="toolbarClick" />
613
<script>
714
let designerInst;
815
let isServerReoport;

Views/ReportDesigner/Index.cshtml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
@section control {
44

5-
<bold-report-designer id="reportdesigner" ajax-before-load="onAjaxBeforeLoad" service-url="@Globals.DESIGNER_SERVICE_URL" toolbar-settings="ViewBag.toolbarSettings" create="controlCreate" toolbar-rendering="toolbarRendering" toolbar-click="toolbarClick" />
5+
@{
6+
List<BoldReports.Models.ReportDesigner.ReportItemExtensionsModule> extensions = new List<BoldReports.Models.ReportDesigner.ReportItemExtensionsModule>(){
7+
new BoldReports.Models.ReportDesigner.ReportItemExtensionsModule{Name="barcode",ClassName="EJBarcode",ImageClass="customitem-barcode",DisplayName="1D Barcode",Category="Barcodes"},
8+
new BoldReports.Models.ReportDesigner.ReportItemExtensionsModule{Name="matrixbarcode",ClassName="EJQRBarcode",ImageClass="customitem-qrbarcode",DisplayName="2D Barcode",Category="Barcodes"}
9+
};
10+
}
11+
12+
<bold-report-designer id="reportdesigner" ajax-before-load="onAjaxBeforeLoad" service-url="@Globals.DESIGNER_SERVICE_URL" toolbar-settings="ViewBag.toolbarSettings" create="controlCreate" report-item-extensions="extensions" toolbar-rendering="toolbarRendering" toolbar-click="toolbarClick" />
613
<script>
714
let designerInst;
815
function controlCreate() {
@@ -14,7 +21,7 @@
1421
}
1522
});
1623
if (reportName) {
17-
designerInst.openReport(reportName);
24+
designerInst.openReport(reportName.indexOf("external-parameter-report") !== -1 ? "product-line-sales.rdl" : reportName);
1825
}
1926
}
2027

Views/ReportWriter/Index.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
<div class="r-w-samples">
88
<div class="r-w-samples-portrait">
99
<div class="r-w-sample r-w-sample-portrait" onclick="onSampleClick({event: event, name:'website-visitor-analysis'})">
10-
<img class="r-w-sample-image" style="background-position-y: -2400px" />
10+
<img class="r-w-sample-image" style="background-position-y: -2640px" />
1111
<div class="r-w-sample-title">Website Visitor Analysis</div>
1212
</div>
1313
<div class="r-w-sample r-w-sample-portrait" onclick="onSampleClick({event: event, name:'northwind-products-suppliers-report'})">
1414
<img class="r-w-sample-image" style="background-position-y: -960px" />
1515
<div class="r-w-sample-title">Northwind Products and Suppliers Report</div>
1616
</div>
1717
<div class="r-w-sample r-w-sample-portrait" onclick="onSampleClick({event: event, name:'sales-report'})">
18-
<img class="r-w-sample-image" style="background-position-y: 960px" />
18+
<img class="r-w-sample-image" style="background-position-y: 1200px" />
1919
<div class="r-w-sample-title">Sales Report</div>
2020
</div>
2121
</div>

appsettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"AllowedHosts": "*",
88
"appSettings": {
9-
"ExtAssemblies": "BoldReports.Data.WebData;BoldReports.Data.Csv;BoldReports.Data.Excel;",
10-
"IsOfflineLicense": "false"
9+
"ExtAssemblies": "BoldReports.Data.WebData;BoldReports.Data.Csv;BoldReports.Data.Excel;BoldReports.CRI.Barcode;",
10+
"IsOfflineLicense": "false"
1111
}
1212
}

bundleconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
"wwwroot/scripts/bold-reports/bold.report-viewer.min.js",
6565
"wwwroot/scripts/bold-reports/common/bold.report-designer-widgets.min.js",
6666
"wwwroot/scripts/bold-reports/bold.report-designer.min.js",
67+
"wwwroot/scripts/extensions/barcode.js",
68+
"wwwroot/scripts/extensions/qrbarcode.js",
6769
"wwwroot/scripts/bold-reports/data-visualization/ej.bulletgraph.min.js",
6870
"wwwroot/scripts/bold-reports/data-visualization/ej.chart.min.js"
6971
],
@@ -112,7 +114,8 @@
112114
"wwwroot/css/bold-reports/bold.widgets.core.material.min.css",
113115
"wwwroot/css/bold-reports/material/bold.theme.min.css",
114116
"wwwroot/css/bold-reports/bold.reportdesigner.core.material.min.css",
115-
"wwwroot/css/bold-reports/material/bold.reportdesigner.theme.min.css"
117+
"wwwroot/css/bold-reports/material/bold.reportdesigner.theme.min.css",
118+
"wwwroot/extensions/barcode.css"
116119
]
117120
}
118121
]

web.config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3+
<configSections>
4+
<section name="ReportingExtensions" type="BoldReports.Configuration.Extensions, BoldReports.Web" allowLocation="true" allowDefinition="Everywhere" />
5+
</configSections>
6+
<ReportingExtensions>
7+
<ReportItems>
8+
<ReportItem Name="Barcode" Assembly="BoldReports.CRI.Barcode" Type="BoldReports.CRI.Barcode.BarcodeCustomReportItem" />
9+
<ReportItem Name="MatrixBarcode" Assembly="BoldReports.CRI.Barcode" Type="BoldReports.CRI.Barcode.BarcodeCustomReportItem" />
10+
</ReportItems>
11+
</ReportingExtensions>
312
<system.webServer>
413
<security>
514
<requestFiltering>

wwwroot/assets/sidebar/landscape.png

110 KB
Loading

wwwroot/assets/sidebar/portrait.png

122 KB
Loading

wwwroot/css/bold-reports/bold.reportdesigner.core.material.min.css

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wwwroot/css/bold-reports/bold.widgets.core.material.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wwwroot/css/bold-reports/material/bold.reportdesigner.theme.compatibility.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wwwroot/css/bold-reports/material/bold.reportdesigner.theme.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wwwroot/css/bold-reports/material/bold.theme.compatibility.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wwwroot/css/bold-reports/material/bold.theme.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading

wwwroot/css/common/common.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,46 @@
5454
-webkit-animation-delay: -0.16s;
5555
animation-delay: -0.16s;
5656
}
57+
#category_hidden, #category_dropdown, #subcategory_hidden, #subcategory_dropdown,#startdate,#enddate {
58+
background-color: #fafafa;
59+
}
60+
#update {
61+
width: 100px;
62+
font-size: 13px
63+
}
64+
#checkall_wrap {
65+
height: 35px;
66+
display: block;
67+
padding: 15px 0 15px 18px;
68+
padding-top: 5px;
69+
border-bottom: 1px solid #c8c8c8;
70+
}
71+
#r-w-property-name-category, #r-w-property-name-subcategory, #r-w-property-name-startdate, #r-w-property-name-enddate,#category_hidden, #subcategory_hidden {
72+
font-size: 13px
73+
}
74+
#r-w-property-subcategory, #r-w-property-startdate, #r-w-property-enddate{
75+
margin-top:15px;
76+
}
77+
#r-w-property-value-subcategory {
78+
position: relative;
79+
right: 25px
80+
}
81+
#r-w-property-value-startdate {
82+
position:relative;
83+
right:5px
84+
}
85+
#ejcheckall.e-chkbox-wrap .e-text {
86+
vertical-align: middle;
87+
font-size: 14px;
88+
padding-left: 24px;
89+
}
90+
@media only screen and (max-width: 1080px) {
91+
92+
#r-w-property-value-subcategory{
93+
margin: 0 0 0 20px;
94+
}
5795

96+
}
5897
@-webkit-keyframes sk-bouncedelay {
5998

6099
0%, 80%, 100% {

wwwroot/css/common/sidebar.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
width: 120px;
4444
margin: 8px;
4545
background-image: url('./../../assets/sidebar/landscape.png');
46-
background-size: 100% 1000%;
46+
background-size: 100% 1200%;
4747
}
4848

4949
.ej-sidebar-content .ej-sb-toc .ej-sb-toc-card .ej-portrait-img {
@@ -52,7 +52,7 @@
5252
width: 90px;
5353
margin: 8px;
5454
background-image: url('./../../assets/sidebar/portrait.png');
55-
background-size: 100% 1300%;
55+
background-size: 100% 1400%;
5656
}
5757

5858
.ej-sidebar-content .ej-sb-toc .ej-sb-toc-card .ej-sb-toc-title {

0 commit comments

Comments
 (0)