Skip to content

Commit c556bb9

Browse files
committed
#54 - Asset update.
1 parent 7b3beac commit c556bb9

File tree

3 files changed

+45
-18
lines changed

3 files changed

+45
-18
lines changed

assets/reportviewer.net.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@
4949
height: 150px;
5050
}
5151

52+
.reportparam-list-selectall {
53+
background-color: transparent;
54+
border: none;
55+
padding-left: 0;
56+
color: #007bff;
57+
}
58+
59+
.reportparam-list-selectall:hover {
60+
color: #0056b3;
61+
text-decoration: underline;
62+
background-color: transparent;
63+
border-color: transparent;
64+
}
65+
5266
.report-viewer {
5367
position: relative;
5468
}

assets/reportviewer.net.js

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@
6565
return dtoArr;
6666
}
6767

68+
self.selectCheckbox = function (element) {
69+
var id = $(element).attr('id');
70+
var list = id.indexOf('-') > -1;
71+
72+
var multivalue = $(element).data('multivalue');
73+
var checked = $(element).is(':checked');
74+
75+
if (list) {
76+
var idSplit = id.split('-')[0];
77+
var eles = $('input[id*="' + idSplit + '"]');
78+
79+
if (!multivalue || multivalue === 'false') {
80+
$(eles).prop('checked', false);
81+
}
82+
}
83+
84+
$(element).prop('checked', !checked);
85+
}
86+
6887
self.postReportParameters = function () {
6988
var dtoArr = constructReportParameters();
7089
var dto = {
@@ -116,29 +135,23 @@
116135
}
117136
});
118137

138+
$('.report-viewer .reportparam-list-dropdown .reportparam-list-selectall').on("click", function () {
139+
let dropdownContainer = $(this).closest('.reportparam-list').find('.reportparam-list-dropdown');
140+
let checkboxes = $(dropdownContainer).find('input[type="checkbox"]');
141+
142+
$.each(checkboxes, function (idx, ele) {
143+
self.selectCheckbox($(ele));
144+
});
145+
});
146+
119147
$('.report-viewer .custom-control-input[data-datatype="boolean"]').on("click", function () {
120148
if ($(this).data('requiredparam')) {
121149
self.postReportParameters();
122150
}
123151
});
124152

125153
$('.report-viewer input[type="checkbox"]').on("change", function (event) {
126-
var id = $(this).attr('id');
127-
var list = id.indexOf('-') > -1;
128-
129-
var multivalue = $(this).data('multivalue');
130-
var checked = this.checked;
131-
132-
if (list) {
133-
var idSplit = id.split('-')[0];
134-
var eles = $('input[id*="' + idSplit + '"]');
135-
136-
if (!multivalue || multivalue === 'false') {
137-
$(eles).prop('checked', false);
138-
}
139-
}
140-
141-
$(this).prop('checked', checked);
154+
self.selectCheckbox($(this));
142155
});
143156

144157
$('.report-viewer #RunReportBtn').on('click', function () {

src/ReportViewer.NET/LayoutProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ private async Task<IEnumerable<IDictionary<string, object>>> RunDataSetQuery(Rep
384384
// TODO: Log error.
385385
try
386386
{
387-
results = await conn.QueryAsync<dynamic>(dsQuery.CommandText, dynamicParams, commandType: dsQuery.CommandType == "StoredProcedure" ? CommandType.StoredProcedure : null);
387+
results = await conn.QueryAsync<dynamic>(dsQuery.CommandText, dynamicParams, commandType: dsQuery.CommandType == "StoredProcedure" ? CommandType.StoredProcedure : CommandType.Text);
388388
}
389389
catch
390390
{
@@ -400,7 +400,7 @@ private async Task<IEnumerable<IDictionary<string, object>>> RunDataSetQuery(Rep
400400
// TODO: Log error.
401401
try
402402
{
403-
results = await conn.QueryAsync<dynamic>(dsQuery.CommandText, null, commandType: dsQuery.CommandType == "StoredProcedure" ? CommandType.StoredProcedure : null);
403+
results = await conn.QueryAsync<dynamic>(dsQuery.CommandText, null, commandType: dsQuery.CommandType == "StoredProcedure" ? CommandType.StoredProcedure : CommandType.Text);
404404
}
405405
catch (Exception e)
406406
{

0 commit comments

Comments
 (0)